J.B-Lin commited on
Commit
1a07461
·
1 Parent(s): 2e7d8b3

deploy_omni: llFile llama.cpp-omni compile succeeds on Modal T4

Browse files

- CUDA Toolkit 12.4 + cuda-compiler + cuda-driver-dev from NVIDIA apt repo
- GGML_CUDA_NO_VMM=ON to avoid libcuda.so.1 linking in build phase
- CUDA arch 75 (T4) + 89 (L4)
- LLAMA_CUDA_FORCE_MMQ=ON for faster compilation
- Source from tc-mb/llama.cpp-omni fork, stored in modal_deploy/llamacpp_omni/
- Build time ~77 min on Modal infra

Resolves: modal deploy build failures due to GitHub access and CUDA linking

docs/deploy_omni_build_log_20260611.md ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Build Log 2026-06-11: deploy_omni.py Success
2
+
3
+ ## Status
4
+ llama.cpp-omni (OpenBMB fork) compiled successfully on Modal T4.
5
+ Image: im-AxWdR31ZWeEDIfXIPcxAhZ
6
+ Build time: ~4641s (77 min)
7
+
8
+ ## Key Fixes
9
+ 1. Source: cloned from tc-mb/llama.cpp-omni, stored in modal_deploy/llamacpp_omni/
10
+ 2. Build flags: GGML_CUDA=ON, LLAMA_CUDA_FORCE_MMQ=ON, GGML_CUDA_NO_VMM=ON
11
+ 3. CUDA arch: 75 (T4) + 89 (L4)
12
+ 4. CUDA Toolkit: cuda-toolkit-12-4 + cuda-compiler-12-4 + cuda-driver-dev-12-4 from NVIDIA apt repo
13
+ 5. Critical: libcuda.so.1 linking issue fixed via GGML_CUDA_NO_VMM=ON
14
+
15
+ ## Volume Status - minicpm-o-4_5-models
16
+ All 10 model files present, GGUF magic verified.
17
+
18
+ ## Next Steps
19
+ 1. Run test_inference to verify text inference on T4
20
+ 2. Test TTS endpoints (v1/audio/speech)
21
+ 3. Test STT endpoints (v1/audio/transcriptions)
22
+ 4. modal deploy to production (prego-pal-minicpm-omni)
23
+ 5. Consider L4 GPU - cheaper, sm_89 already compiled
modal_deploy/deploy_omni.py CHANGED
@@ -43,7 +43,7 @@ _omni_image = (
43
  "curl -L -o /tmp/cuda-keyring.deb https://developer.download.nvidia.com/compute/cuda/repos/debian12/x86_64/cuda-keyring_1.1-1_all.deb",
44
  "dpkg -i /tmp/cuda-keyring.deb",
45
  "apt-get update",
46
- "apt-get install -y cuda-toolkit-12-4 cuda-compiler-12-4",
47
  )
48
  .apt_install(
49
  "curl",
@@ -72,16 +72,15 @@ _omni_image = (
72
  .run_commands(
73
  "cd /llama.cpp-omni && cmake -B build "
74
  "-DGGML_CUDA=ON "
75
- "-DLLAMA_CURL=ON "
76
  "-DLLAMA_BUILD_SERVER=ON "
77
  "-DLLAMA_BUILD_TESTS=OFF "
78
  "-DLLAMA_BUILD_EXAMPLES=OFF "
79
  "-DLLAMA_CUDA_FORCE_MMQ=ON "
 
80
  "-DCMAKE_CUDA_ARCHITECTURES='75;89' "
81
  "-DCMAKE_BUILD_TYPE=Release "
82
  "-DCMAKE_CUDA_COMPILER=/usr/local/cuda-12/bin/nvcc",
83
- "cd /llama.cpp-omni && cmake --build build --config Release -j $(nproc) "
84
- "--target llama-server",
85
  "ls -lh /llama.cpp-omni/build/bin/llama-server",
86
  )
87
  )
@@ -444,6 +443,20 @@ def diagnose_volume():
444
  else:
445
  print(f"[WARN] Main model NOT valid GGUF (magic={magic.hex()})")
446
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
447
 
448
  # ============================================================================
449
  # 5. TEST INFERENCE (standalone - not via ASGI)
 
43
  "curl -L -o /tmp/cuda-keyring.deb https://developer.download.nvidia.com/compute/cuda/repos/debian12/x86_64/cuda-keyring_1.1-1_all.deb",
44
  "dpkg -i /tmp/cuda-keyring.deb",
45
  "apt-get update",
46
+ "apt-get install -y cuda-toolkit-12-4 cuda-compiler-12-4 cuda-driver-dev-12-4",
47
  )
48
  .apt_install(
49
  "curl",
 
72
  .run_commands(
73
  "cd /llama.cpp-omni && cmake -B build "
74
  "-DGGML_CUDA=ON "
 
75
  "-DLLAMA_BUILD_SERVER=ON "
76
  "-DLLAMA_BUILD_TESTS=OFF "
77
  "-DLLAMA_BUILD_EXAMPLES=OFF "
78
  "-DLLAMA_CUDA_FORCE_MMQ=ON "
79
+ "-DGGML_CUDA_NO_VMM=ON "
80
  "-DCMAKE_CUDA_ARCHITECTURES='75;89' "
81
  "-DCMAKE_BUILD_TYPE=Release "
82
  "-DCMAKE_CUDA_COMPILER=/usr/local/cuda-12/bin/nvcc",
83
+ "cd /llama.cpp-omni && cmake --build build --config Release -j $(nproc) --target llama-server",
 
84
  "ls -lh /llama.cpp-omni/build/bin/llama-server",
85
  )
86
  )
 
443
  else:
444
  print(f"[WARN] Main model NOT valid GGUF (magic={magic.hex()})")
445
 
446
+ print(f"\n{'='*60}")
447
+ print(f"[Diagnose] CUDA library files in container")
448
+ print(f"{'='*60}")
449
+ import subprocess
450
+ result = subprocess.run(
451
+ "find / -name 'libcuda*' -type f,l 2>/dev/null | head -30",
452
+ shell=True, capture_output=True, text=True
453
+ )
454
+ cuda_files = result.stdout.strip().split("\\n")
455
+ for f in cuda_files:
456
+ if f:
457
+ size = os.path.getsize(f) if os.path.exists(f) else 0
458
+ print(f" {f} ({size:,} bytes)")
459
+
460
 
461
  # ============================================================================
462
  # 5. TEST INFERENCE (standalone - not via ASGI)