Fix nvcc self-test: copy nvcc into the merged CUDA tree

nvcc resolves its toolkit from its real path, so a symlink made it look
for lib64 inside a single pip wheel and fail to link cudart_static.
Also make `llmhost start` start the dashboard after `setup --no-start`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QaE1hpvyZTJixEbUUMj9Ca
This commit is contained in:
neil 2026-11-02 03:52:33 -08:00
parent 5b9586ac80
commit f0ea0bd7bb
2 changed files with 11 additions and 1 deletions

View file

@ -73,6 +73,14 @@ def build_cuda_home(log=print):
for sub, target in (("bin", "bin"), ("include", "include"), ("lib", "lib64"), ("lib64", "lib64"), ("nvvm", "nvvm")):
if (pkg / sub).is_dir():
_link_tree(pkg / sub, CUDA_DIR / target)
# nvcc finds the toolkit (lib64, nvvm, include) relative to its *real* path, so a symlink
# would send it back into a single wheel's directory. A copy makes it use the merged tree.
for name in ("nvcc", "nvcc.profile"):
p = CUDA_DIR / "bin" / name
if p.is_symlink():
real = p.resolve()
p.unlink()
shutil.copy2(real, p)
lib = CUDA_DIR / "lib64"
if lib.is_dir():
for f in lib.glob("lib*.so.*"):

View file

@ -126,7 +126,7 @@ Done.
API: http://{host}:{cfg['api_port']}/v1 (OpenAI-compatible)
Dashboard: http://{host}:{cfg['web_port']}
API key: {paths.KEY_FILE} (show it with: llmhost key)
Model: {active} — {"loading" if hfcache.is_downloaded(first["repo"]) else "downloading, then loading"}; watch with: llmhost logs -f
Model: {active} — {"not started yet; run: llmhost start" if a.no_start else ("loading" if hfcache.is_downloaded(first["repo"]) else "downloading, then loading") + "; watch with: llmhost logs -f"}
Connect opencode: run `llmhost opencode-config` and follow what it prints.""")
@ -183,6 +183,8 @@ def cmd_switch(a):
def cmd_ctl(a):
_service_check()
if a.cmd == "start":
service.start("web") # after `setup --no-start` neither service is running
getattr(service, a.cmd)("model")
say(f"model server: {a.cmd} requested")