Repository navigation
Studio: reuse llama.cpp's CUDA wheels for audio.cpp on Windows chat-only installs - #18275
Conversation
…els for audio.cpp instead of its cudart archive
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
## Name the encoding on the sd.cpp nvidia-smi probe `studio/backend/tests/test_text_io_encoding.py::test_text_io_names_its_encoding[sd_cpp_backend.py]` fails on `main` since #18210. On staging it shows up as `(Python 3.13, rest)` failing on unrelated PRs, for example #17694 and #18275: ``` E sd_cpp_backend.py:3146: subprocess(text = True) without encoding E assert not ['sd_cpp_backend.py:3146: subprocess(text = True) without encoding'] ``` ### Cause #18210 added `_sole_nvidia_card_mib()`, which reads nvidia-smi's output with `subprocess.run(..., text = True)` but no `encoding`. That falls back to `locale.getencoding()`, the ANSI codepage on Windows, which is exactly what this lint exists to catch. The other three `subprocess.run(text = True)` calls in `sd_cpp_backend.py` already pass `encoding = "utf-8", errors = "replace"`. The new probe just missed it. ### Fix The probe now passes `encoding = "utf-8", errors = "replace"` like its neighbours. nvidia-smi's CSV output is ASCII, so what the probe parses does not change. A stray byte can no longer raise inside the probe. ### Verification - `tests/test_text_io_encoding.py`: fails on `main` on this line and passes with this change. - `tests/test_sd_cpp_backend.py` also passes: 1289 passed across both files. - ruff is clean.
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Chat-only (no torch) Windows x64 installs with an NVIDIA GPU download cuBLAS twice: once for llama.cpp, once for audio.cpp.
Why
Since #17463 the llama.cpp step installs NVIDIA's
nvidia-cuda-runtimeandnvidia-cublaswheels into the Studio env on chat-only installs (about 410 MB for CUDA 13). The audio.cpp Windows CUDA bundle then downloads its owncudart-windows-x64-cuda13.zip(589 MB; 724 MB for CUDA 12), becausetorch_provides_cuda_runtimeonly looks intorch\lib. That archive holdscudart64_13.dll,cublas64_13.dll,cublasLt64_13.dll(458 MiB) andcufft64_12.dll(271 MiB), so everything but cuFFT is already on disk.Change
studio/install_audio_cpp_prebuilt.py, Windows x64 only, when there is no torch and the bundle would download its cudart archive:nvidia\*wheel dirs (the onesaudio_cpp_serveralready puts onPATH) holdcudart64_N,cublas64_NandcublasLt64_Nfor the bundle's CUDA line, install onlynvidia-cufft(nvidia-cufft-cu12for CUDA 12), check again, and skip the archive._cuda_runtime_satisfied), so a later setup reinstalls if they go away. Installs that already carry the archive are untouched.Saves about 395 MB per chat-only Windows CUDA 13 install and about 500 MB per CUDA 12 install. Linux, macOS, AMD, Windows ARM64 and installs with torch take the same path as before. On Windows
audiocpp_server.exeimportscufft64_12.dllandggml-cuda.dllimportscublas64_13.dll, so both have to resolve from the wheel dirs, which the run below checks.Tests
windows-latest(no GPU), each arm a torch-free venv holding llama.cpp's chat-only CUDA 13 wheels, bundleaudio-v0.9.5-unsloth.1-bin-windows-x64-cuda13.zip:cudart-windows-x64-cuda13.zip, 4 DLLs beside the servernvidia-cufft12.5.0.14 (+nvidia-nvjitlink), no DLLs beside the serveraudiocpp_server.exe --versionwith the Studio runtime dirs onPATHbackends: cpu,cudabackends: cpu,cudaggml-cuda.dllloads0xC0000135(DLL not found)already matches, nothing installedtests/studio/install/test_install_audio_cpp_prebuilt_logic.py: 255 passed (14 new). With only the two functional hunks reverted (helpers kept), the install-skips-the-archive and intact-install tests fail.Not covered here: a real Windows NVIDIA GPU running audio.cpp on CUDA (no runner has one).