bash: nvcc: command not found — CUDA toolkit not installed or not on PATH
The shell cannot find the CUDA compiler.
Exact message you may see
nvcc: command not foundnvcc not foundCUDA toolkit not found Meaning
nvidia-smi only shows the driver; nvcc comes from the CUDA Toolkit, which installs under /usr/local/cuda-XX/bin and needs to be added to PATH.
Common causes
- CUDA Toolkit not installed (driver only)
- PATH missing
/usr/local/cuda/bin - Installed in a container without the devel image
- Wrong shell profile edited
⚡ Quick fix
- Install the toolkit (not just the driver)
- Add
export PATH=/usr/local/cuda/bin:$PATH - Use an
nvidia/cuda:*-develDocker image
Detailed fix by platform
Linux
export PATH=/usr/local/cuda/bin:$PATH; export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
How to diagnose
- Toolkit — Installed?
- PATH — Contains cuda/bin?
- Image — devel not runtime?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- CMake Error: CMAKE_C_COMPILER not set / No CMAKE_CXX_COMPILER could be found CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles"
- CUDA error: out of memory CUDA error: out of memory (cudaErrorMemoryAllocation)
- E0658: use of unstable library feature Rust: error[E0658]: use of unstable library feature `let_chains` / `#![feature]` may not be used on the stable release channel
Most viewed in C/C++
- Bus error C/C++: Bus error (core dumped) — SIGBUS from misaligned access or a bad memory-mapped file
- AddressSanitizer: heap-buffer-overflow C/C++: ==ERROR: AddressSanitizer: heap-buffer-overflow on address — READ/WRITE of size N
- AddressSanitizer: heap-use-after-free C/C++: ==ERROR: AddressSanitizer: heap-use-after-free on address — memory used after delete/free
Other ways to find it
Where this error sits
Origin: Application & API. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Did this fix work for you?
Report a correction or suggest an improvement
Last updated 2 Dec 2026