CUDA errorsdraft
Reproduced 2026-09-01

CUDA ERROR

nvcc: command not found, but nvidia-smi works

The driver and toolkit are separate installs. On CUDA 12.6, the shell and env printed different messages for the same missing binary; both exited 127.

The shell cannot find the CUDA compiler, which almost always means the toolkit is not installed or not on PATH, even when the GPU and its driver are perfectly healthy.

Kind Environment and build. No cudaError code
Captured with CUDA 12.6 (V12.6.85), 2026-09-01
Source code/errors/_toolchain/evidence/run-2026-09-01.txt

Strings a reader might paste

We reproduced this on a node that has a working toolkit, by stripping PATH down to the system directories. From code/errors/_toolchain/evidence/run-2026-09-01.txt:

$ env PATH=/usr/bin:/bin nvcc --version
env: 'nvcc': No such file or directory
exit: 127

$ env PATH=/usr/bin:/bin bash -c "nvcc --version"
bash: line 1: nvcc: command not found
exit: 127

One missing binary, two different messages, because the program that failed to find it is different: env reports in its own words, the shell reports in its. Both exit 127, which is the portable signal for "command not found" and the thing to check in a build script, since the text is not stable across tools.

A third form exists on Debian and Ubuntu and we did not capture it, because it comes from a distribution helper rather than from CUDA: Command 'nvcc' not found, but can be installed with: sudo apt install nvidia-cuda-toolkit. Take that suggestion carefully. The distribution package is often several releases behind the toolkit you want.

Cause 1: the driver is installed and the toolkit is not

The most common cause by a wide margin, and the reason this page's title names nvidia-smi. nvidia-smi ships with the driver. nvcc ships with the toolkit. They are separate downloads, and having one tells you nothing about the other.

The "CUDA Version" that nvidia-smi prints in its header is the highest runtime the installed driver can support. It is a ceiling, not an inventory. A machine can honestly report CUDA 13.0 there and have no compiler at all, which is exactly the confusion behind the most-viewed questions in this corner of Stack Overflow.

Fix: install the CUDA toolkit.

Cause 2: conda cudatoolkit was expected to bring a compiler

conda install cudatoolkit installs runtime libraries. It does not install nvcc.

Fix: install the compiler package explicitly, cuda-nvcc from the nvidia channel, or use a system toolkit. Our own capture node runs its toolkit out of a micromamba environment, so this route does work; it just needs the right package name.

Cause 3: the toolkit is installed and not on PATH

Which is precisely what our transcript reproduces. /usr/local/cuda/bin is not added to PATH for you by most installers.

Fix: add /usr/local/cuda/bin to PATH and /usr/local/cuda/lib64 to LD_LIBRARY_PATH, in your shell profile rather than in one terminal, or the next login undoes it.

Confirm which one you have

ls -d /usr/local/cuda*
ls /usr/local/cuda/bin/nvcc

If the binary is there, it is cause 3 and you now have the exact directory to put on PATH. If it is not, it is cause 1 or 2 and you have an install to do. Then compare the two version reports side by side, because they answer different questions:

nvidia-smi          # driver, and the highest runtime it supports
nvcc --version      # the toolkit you will actually compile with

These two disagreeing is normal and is not a bug.

Prevention

  • Put the PATH and LD_LIBRARY_PATH lines in the shell profile the moment you install, and log out and back in to prove they survive.
  • In build scripts, test the exit status rather than matching the message text. Our capture shows two different strings for one condition; 127 was the same in both.

Related errors

The lesson

Day 3 owns installation, and /setup/install-cuda is the page to follow from here. Day 0 covers what you need before that, and day 67 is where the toolchain moves into CMake. The full code table is on the error hub.


Written 2026-09-01. Shell output from code/errors/_toolchain/evidence/run-2026-09-01.txt, captured 2026-09-01 with CUDA 12.6 (V12.6.85) on ornn-internal-t4-spot-5v08. Reproduced by restricting PATH on a machine whose toolkit works, so the transcript shows the symptom without a broken install. Author and reviewer: not yet assigned; this page does not publish until both are named.