Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nvcc missing when installing cudatoolkit?

I have installed cuda along pytorch with

conda install pytorch torchvision cudatoolkit=10.0 -c pytorch

However, it seems like nvcc was not installed along with it. If I want to use for example nvcc -V, I get the error that nvcc was not found, and that I should install it with sudo apt install nvidia-cuda-toolkit. Can I do this (I dont want to just try and then find out that it is not working/messes up the whole cuda setup). And is this a bug or expected behavior?

I am using Ubuntu 18.04 and have cuda 10.2

like image 219
Luca Thiede Avatar asked Jun 06 '19 03:06

Luca Thiede


People also ask

Where nvcc is installed?

The nvcc compiler driver is installed in /usr/local/cuda/bin, and the CUDA 64-bit runtime libraries are installed in /usr/local/cuda/lib64.

Does cuda Toolkit include nvcc?

Unfortunately, for the moment at least, the cudatoolkit packages available via Conda do not include the NVIDIA CUDA Compiler (NVCC), which is required in order to build Horovod extensions for PyTorch, TensorFlow, or MXNet.

How do I know if nvcc is installed?

Run which nvcc to find if nvcc is installed properly. You should see something like /usr/bin/nvcc. If that appears, your NVCC is installed in the standard directory. If you have installed the CUDA toolkit but which nvcc returns no results, you might need to add the directory to your path.


1 Answers

Met this question when installing cudatoolkit of 10.1 with PyTorch 1.4.

There is a conda-forge package https://anaconda.org/conda-forge/cudatoolkit-dev. After installing this, nvcc as well as other CUDA libraries will be then available at /home/li/anaconda3/envs/<env_name>/pkgs/cuda-toolkit in bin/ and lib/.

like image 142
Bo Li Avatar answered Sep 19 '22 17:09

Bo Li