usb-configuration-base: disable CUDA in onnxruntime - #151
Conversation
The dgx-spark module sets nixpkgs.config.cudaSupport = true globally, so the USB image builds Firefox's onnxruntime dependency (via its optional ML features) with CUDA. That pulls in cudnn-frontend, which fails to build on this nixpkgs pin: FindCUDAToolkit gets a mangled CUDAToolkit_ROOT and cannot find nvcc (aarch64 / CMake 4.3 bug). Firefox is the only consumer of onnxruntime in the image closure, so disable CUDA there to sidestep the broken toolchain path. This mirrors the spark host's existing local overlay for the same bug. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
I think this should be fixed since NixOS/nixpkgs#547077 (and another related fix that came before it). @graham33 Maybe the agent could benefit from a "check pending nixpkgs updates for relevant changes" memory? :) |
Oh nice, thanks! Yes probably, although in this case I'm trying to stick with a reasonably 'known good' nixpkgs pin, so I'd probably want to bump nixpkgs in a separate change, since it's a fairly expensive rebuild/retest. In this case I just happen to need the USB image and found it broken (need proper CI...). Ideally I would have this all building and testing better in CI, and then have an agent auto-generating PRs to bump nixpkgs etc. If I get time maybe that will happen at some point! |
Summary
The
usb-imagebuild fails because the dgx-spark module setsnixpkgs.config.cudaSupport = trueglobally, so Firefox's onnxruntime dependency (via its optional ML features) is built with CUDA. That pulls in cudnn-frontend, which fails on the current nixpkgs pin:FindCUDAToolkitreceives a mangledCUDAToolkit_ROOTand cannot findnvcc(aarch64 / CMake 4.3 bug).This adds an overlay to the USB image configuration disabling CUDA in onnxruntime, mirroring the spark host's existing local overlay for the same bug.
Firefox is the only direct referrer of onnxruntime in the ISO's full derivation closure (verified across all 7,501 paths), so nothing else in the image is affected.
Testing
nix build .#usb-image --dry-run --builders ""confirms cudnn-frontend is no longer in the build plan and onnxruntime resolves to a non-CUDA derivation.Note: opencv (via firefox → onnxruntime → openvino) still builds locally with CUDA 12.9 — it builds successfully, just slowly, and is not addressed here.
🤖 Generated with Claude Code