nvcc: command not found C/C++ Origin: Application & API OSI layer 7 · Application Last updated 2 Dec 2026

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
Seen on: C/C++ CUDA Linux

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

  1. Install the toolkit (not just the driver)
  2. Add export PATH=/usr/local/cuda/bin:$PATH
  3. Use an nvidia/cuda:*-devel Docker image

Detailed fix by platform

Linux

  1. export PATH=/usr/local/cuda/bin:$PATH; export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH

How to diagnose

  1. Toolkit — Installed?
  2. PATH — Contains cuda/bin?
  3. 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:

Where this error sits

Origin: Application & API. Errors that are often confused with or caused by this one (click to open):

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" (macOS)CMake Error: CMAKE_C_…CUDA error: out of memory — CUDA error: out of memory (cudaErrorMemoryAllocation) (C/C++)CUDA error: out of me…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 (Rust)E0658: use of unstabl…error: linker `cc` not found — Rust: error: linker `cc` not found — note: No such file or directory (os error 2) (Rust)error: linker `cc` no…error: toolchain 'stable' is not installed / override toolchain not found — rustup: error: toolchain 'nightly-x86_64-unknown-linux-gnu' is not installed / error: no override and no default toolchain set (Rust)error: toolchain 'sta…gcc is actually clang on macOS / make: command not found — zsh: command not found: make (macOS)gcc is actually clang…Unsupported gpu architecture — nvcc fatal: Unsupported gpu architecture 'compute_90' (C/C++)Unsupported gpu archi…nvcc: com…

Explore the map of this error Full error map →

🧠 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.