unsloth/studio/backend
Daniel Han ae2b1b97ba
fix(studio): add pip-installed nvidia CUDA libs to LD_LIBRARY_PATH for llama-server (#4590)
The prebuilt llama.cpp binary (cuda13-newer) links against
libcudart.so.13 and libcublas.so.13. When torch is installed via pip,
these libraries live in the venv's site-packages under
nvidia/cu13/lib/, not in /usr/local/cuda/.

The existing LD_LIBRARY_PATH logic only searched /usr/local/cuda*
paths (which have CUDA 12.x), so the CUDA backend failed to load
silently and llama-server fell back to CPU -- even with -ngl -1.

This adds a glob scan of the venv's nvidia package directories
(cu*, cudnn, nvjitlink) to LD_LIBRARY_PATH before launching
llama-server, matching where pip puts the CUDA runtime.

Tested on Colab with RTX PRO 6000 Blackwell (CUDA 13.0, pip torch):
before -- 3 MiB GPU, 0% util, CPU inference
after  -- 13317 MiB GPU, 77% util, full GPU inference

Co-authored-by: Daniel Han <danielhanchen@users.noreply.github.com>
2026-03-25 06:24:40 -07:00
..
assets studio: improve onboarding UX, tooltips, and training defaults (#4355) 2026-03-17 07:46:07 -07:00
auth fix: remove old comments (#4292) 2026-03-14 16:50:13 +04:00
core fix(studio): add pip-installed nvidia CUDA libs to LD_LIBRARY_PATH for llama-server (#4590) 2026-03-25 06:24:40 -07:00
loggers Final cleanup 2026-03-12 18:28:04 +00:00
models feat(studio): training history persistence and past runs viewer (#4501) 2026-03-25 00:58:55 -07:00
plugins Bump Data Designer to 0.5.4 (removes litellm dependency) (#4569) 2026-03-25 02:01:43 -07:00
requirements Bump Data Designer to 0.5.4 (removes litellm dependency) (#4569) 2026-03-25 02:01:43 -07:00
routes feat(studio): training history persistence and past runs viewer (#4501) 2026-03-25 00:58:55 -07:00
state Final cleanup 2026-03-12 18:28:04 +00:00
storage feat(studio): training history persistence and past runs viewer (#4501) 2026-03-25 00:58:55 -07:00
tests feat: support GGUF export for non-PEFT models + fix venv_t5 switching for local checkpoints (#4455) 2026-03-20 12:13:18 +04:00
utils feat(studio): training history persistence and past runs viewer (#4501) 2026-03-25 00:58:55 -07:00
__init__.py Final cleanup 2026-03-12 18:28:04 +00:00
_platform_compat.py Fix Studio crash on Anaconda/conda-forge Python (#4484) 2026-03-22 05:36:55 -07:00
colab.py Consolidate dual venvs and separate install from update (#4530) 2026-03-25 05:24:21 -07:00
main.py feat(studio): training history persistence and past runs viewer (#4501) 2026-03-25 00:58:55 -07:00
run.py Fix Studio port conflict detection for loopback addresses (#4532) 2026-03-23 22:34:47 -07:00