Nvcc missing when installing cudatoolkit?

Luca Thiede picture Luca Thiede · Jun 6, 2019 · Viewed 13.6k times · Source

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

Answer

Bo Li picture Bo Li · Apr 16, 2020

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