NVCC Master Guide: From Installation to Performance Tuning
1 Installation 1.1 Installation for python environment To install nvcc inside a Python virtual environment, conda is all you need. It lets you pick the exact CUDA version for each env, so you never clash with system-wide installs. Please follow the steps below to install nvcc: Search for all available nvcc version 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 # activate your conda environment first $ conda activate xxenv # search for available cudatoolkit versions $ conda search cudatoolkit --channel conda-forge # output like this: Loading channels: done # Name Version Build Channel cudatoolkit 5.5rc1 p0 anaconda/pkgs/pro cudatoolkit 5.5.1 p0 anaconda/pkgs/pro cudatoolkit 6.0 p0 anaconda/pkgs/pro cudatoolkit 7.0 1 anaconda/pkgs/pro cudatoolkit 7.5 0 anaconda/pkgs/free cudatoolkit 7.5 2 anaconda/pkgs/free cudatoolkit 8.0 1 anaconda/pkgs/free cudatoolkit 8.0 3 anaconda/pkgs/free cudatoolkit 9.0 h13b8566_0 anaconda/pkgs/main cudatoolkit 9.0 h13b8566_0 pkgs/main cudatoolkit 9.2 0 anaconda/pkgs/main cudatoolkit 9.2 0 pkgs/main ... Install specific version of nvcc If you install nvcc within the base environment, you may run into errors such as OSError: [Errno 39] Directory not empty: 'xxx/anaconda3/lib/ossl-modules'. Therefore, I recommend installing it in a manually created virtual environment instead. 1 2 # Install specific version of `nvcc` $ conda install -c nvidia cudatoolkit=11.8 -y # or conda install -c conda-forge cudatoolkit=x.x Now let us check what we have obtained by running this. ...