camera_viz setup fails with a distro CUDA toolkit: "Cannot determine the CUDA toolkit version at /usr"
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Start with examples/camera_viz/scripts/check_cuda.py, _install_deps.sh, and camera_viz.sh; then read tests/python/examples/camera_viz/test_cuda_setup.py and the CUDA lookup notes in docs/source/references/camera_streaming.rst. Reproduce the distro layout and PATH ordering cases described in the issue, then check how the detected root reaches CuPy during setup and viewer runs. Done means detection and runtime checks work for the reported layouts and the tests and docs cover the behavior.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
examples/camera_viz/camera_viz.sh setup aborts on machines where CUDA comes from the Ubuntu/Debian nvidia-cuda-toolkit package. The toolkit works: the same machine builds Isaac Capture from source with BUILD_VIZ=ON, and build_from_source/index.rst lists nvidia-cuda-toolkit as a supported way to get it. Fixing version detection alone is not enough. With CuPy 14, the viewer also needs CUDA_PATH=/usr at runtime to find the headers.
=== Local setup ===
CUDA check failed: Cannot determine the CUDA toolkit version at /usr. Install the toolkit matching your JetPack/driver and set CUDA_PATH to its directory, then rerun setup.
error: CUDA toolkit detection failed
Environment
- Ubuntu 24.04, x86_64, RTX 6000 Ada, driver 580
nvidia-cuda-toolkit12.0.140 from the Ubuntu archive; no/usr/local/cuda*;CUDA_PATHunset/usr/bin/nvccis a#!/bin/shwrapper around/usr/lib/nvidia-cuda-toolkit/bin/nvcc- Headers are in
/usr/include, andlibnvrtc.so.12is in/usr/lib/x86_64-linux-gnu - main at 1339a9cd3
Steps to reproduce
Detection alone (system Python, the way setup calls it):
python3 examples/camera_viz/scripts/check_cuda.py --detect
# CUDA check failed: Cannot determine the CUDA toolkit version at /usr. ...
CUDA_PATH=/usr python3 examples/camera_viz/scripts/check_cuda.py --detect
# same error: no CUDA_PATH value is accepted for this layout
The kernel check that setup runs last, in a venv with the CuPy that setup installs:
uv venv /tmp/cupy-venv && uv pip install --python /tmp/cupy-venv/bin/python cupy-cuda12x numpy
/tmp/cupy-venv/bin/python examples/camera_viz/scripts/check_cuda.py --cuda-major 12
# CUDA check failed: Failed to find CUDA headers. ... specify CUDA_PATH environment variable.
CUDA_PATH=/usr /tmp/cupy-venv/bin/python examples/camera_viz/scripts/check_cuda.py --cuda-major 12
# CuPy kernel check passed: NVIDIA RTX 6000 Ada Generation, CuPy 14.2.0, NVRTC 12.0
Root cause
There are two independent gaps. Each one blocks this layout on its own.
1. Setup cannot read the toolkit version. detect_toolkit() picks a root from CUDA_PATH, else dirname(dirname(nvcc)) for the first nvcc on PATH, else /usr/local/cuda. It then reads the version only from <root>/version.json, <root>/version.txt or a cuda-X.Y directory name. The distro layout roots at /usr and has none of the three. _install_deps.sh:92 treats the error as fatal.
Two more consequences of the same logic:
- Only the first
nvcconPATHis considered, with no fallback. A machine with an official toolkit and a distronvccearlier onPATHfails the same way. - The pip
nvidia-cuda-nvcc-cu12wheel ships nonvccbinary. A machine whose CUDA comes only from pip wheels falls through to/usr/local/cudaand fails too, even though CuPy can run from those wheels.
CMake's FindCUDAToolkit is not affected, because it gets the version by running nvcc --version.
2. CuPy 14 does not find distro headers on its own. Setup installs an unpinned cupy-cuda12x, which is currently 14.2.0. CuPy 14.2.0 locates headers through cuda.pathfinder (1.8.4 here), which searches, in order: NVIDIA wheels in site-packages, conda, CUDA_PATH/CUDA_HOME, a root derived from the loaded libcudart, and fixed system directories. On this layout only CUDA_PATH=/usr resolves to /usr/include. CuPy 13.6 derived its root from nvcc on PATH and passes the same kernel check without CUDA_PATH. Nothing in setup or camera_viz.sh exports CUDA_PATH. So even with gap 1 fixed, the final setup check, camera_viz.sh run and the camera_viz GPU tests all fail with "Failed to find CUDA headers".
Regression
Setup started failing with #1194 (bb59d39b6). Before it, setup defaulted to CUDA 12.0 unless /usr/local/cuda pointed at a cuda-X.Y directory. On this machine that picked cupy-cuda12x and finished. Whether the viewer then worked depended on the CuPy release resolved: 13.6.0 runs kernels on this layout without CUDA_PATH, and 14.2.0 does not. #1194 moved that runtime failure into setup, and its detection rejects CUDA_PATH=/usr, which is the value CuPy 14 needs.
Who is affected
- Distro
nvidia-cuda-toolkitinstalls, including users who followedbuild_from_source/index.rst.setup --build-from-sourcepoints at that same page, but detection fails before setup reaches the build. - Machines where a distro
nvccprecedes an official toolkit onPATH. - Machines whose CUDA comes only from pip wheels.
- Every setup mode is affected,
--sender-onlyincluded, because detection runs unconditionally. - Not affected, by inspection of the logic: the official runfile/deb installers and JetPack (
/usr/local/cuda-X.Ywith a version file). Conda layouts were not checked.
Suggested fix
- Detection. When no version file is present, parse
nvcc --version, as CMake does. Treat a distronvccas rooted at/usronce/usr/include/cuda_runtime.hexists. Try eachnvcconPATH, then/usr/local/cuda, and use the first one that resolves, rather than only the firstnvccfound. - Runtime. Export the detected root as
CUDA_PATHfor setup's kernel check and forcamera_viz.sh run/loopback, so setup verifies the environment the viewer will use. One way is to write it next to the venv and source it incamera_viz.sh; setting it in the generated.venv/bin/activatewould cover users who activate the venv.- Alternative: install
cupy-cuda12x[ctk]so CuPy takes headers and NVRTC from wheels. This decouples CuPy from the system layout, but makes the venv much larger and needs checking on Jetson.
- Alternative: install
- Messages and docs. Drop "JetPack" from the desktop error, or make it conditional, and say which layouts are recognized. Update
camera_streaming.rst:82-84, which currently describes setup's lookup order but not the layouts it accepts or what CuPy needs at runtime. - Tests. Extend
tests/python/examples/camera_viz/test_cuda_setup.pywith a distro layout (annvccwrapper under a temporaryusr/bin,nvcc --versionstubbed) and aPATHordering case.
Workaround
Give setup a cuda-X.Y directory to read the version from, and give CuPy headers through it. The name must match the installed toolkit:
mkdir -p ~/.local/cuda-12.0 && ln -s /usr/include ~/.local/cuda-12.0/include
export CUDA_PATH=~/.local/cuda-12.0 # keep it set for setup and for every run
With this, check_cuda.py --detect and check_cuda.py --cuda-major 12 both pass on the machine above. A full setup run with the workaround has not been tested.
- Lingua principale
- Python
- Stelle
- 412
- Fork
- 97
- Merge medio
- 1g 23h
- PR unite (30g)
- 157
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di NVIDIA/IsaacCapture
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
NVIDIA/IsaacCapture#910 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
NVIDIA/IsaacCapture#891 ·
I maintainer di solito rispondono entro 1 giorno
-
Expose per-glove health and data freshness in the Avatar SDK and Isaac Teleop pluginForse già presa @zihanjiang321 l’ha presa 2 giorni fa. Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
NVIDIA/IsaacCapture#1319 ·
I maintainer di solito rispondono entro 1 giorno
-
Add OneRobotics A1 asset and Isaac Teleop exampleForse già presa @WangXuechun-woan l’ha presa 8 giorni fa. Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
NVIDIA/IsaacCapture#1291 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
NVIDIA/IsaacCapture#1217 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di NVIDIA/IsaacCapture
Issue simili
-
PAC Wording
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Harmony OPeNDAP SubSetter (HOSS) Geographic production rssmif16d 7 XYZ_PROV
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
nasa/harmony-autotester#372 ·
-
Add DomainAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
disposable/disposable#318 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
developmentseed/titiler-cmr#270 ·
I maintainer di solito rispondono entro 1 giorno
-
Chart: a failed venv install is marked ready, and the 10Gi venv PVC is too small for itForse già presa @andyne13 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno