Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

Ensure that you create the CUDA_HOME environment variable as described in the NVIDIA documentation.

I cannot find any mention of CUDA_HOME in the NVIDIA instructions for cuDNN v6 or in the NVIDIA CUDA Toolkit install instructions . Does anyone know how this variable should be set on linux?

If you installed CUDA in /usr/local then in .bashrc file enter export PATH=/usr/local/cuda-8.0/bin:$PATH export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64:$LD_LIBRARY_PATH . zindarod Sep 5, 2017 at 23:04 @Zindarod that is definitely part of the LD_LIBRARY_PATH step, which is the step before the question about CUDA_HOME, but that doesn't address the question about CUDA_HOME. carbocation Oct 21, 2017 at 14:29 This should probably be updated to cuda-9.0 now that the recommended installation is version 9.0. Wade Feb 18, 2018 at 8:14 I note that the nvidia-cuda-toolkit package on Ubuntu 20.04 creates a folder /usr/lib/cuda which contains bin , include etc. So presumably CUDA_HOME should in this case be set to /usr/lib/cuda? user2023370 Sep 4, 2020 at 11:13
export CUDA_HOME=$CONDA_PREFIX

You can add this to ~/.bashrc or ~/.bash_profile to have this environment variable persist between sessions. To apply this change in the bash file to your current session run: source ~/.bashrc or source ~/.bash_profile

Verify this by issuing an echo $CUDA_HOME command.

Just had this issue whilst trying to install NVIDIAs Kaolin. As @user2023370 said the nvidia-cuda-toolkit creates a bunch of folders and I can confirm that it will set CUDA_HOME. This circumvents the need to set the variable with export CUDA_HOME=/usr/local/cuda-X.X

tldr; install nvidia-cuda-toolkit to set CUDA_HOME

https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#post-installation-actions

or for the latest version of cuda put export PATH=/usr/local/cuda-11.6/bin${PATH:+:${PATH}} at the end of your bashrc.

It should work

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.