The computing power of RTX 3090 is 8.6, and the pytorch version must be above 11.1, otherwise the code cannot be run on the GPU, and the corresponding cuda version should also be updated
One, uninstall the original cuda
sudo /usr/local/cuda-10.0/bin/uninstall_cuda_10.0.pl
sudo rm -rf /usr/local/cuda-10.0
Second, install cuda
cuda11.1 URL: CUDA Toolkit 11.1.0 | NVIDIA Developer
After selecting, copy the link below to the Linux terminal
sudo sh cuda_11.1.0_455.23.05_linux.run
During the installation process, the following interface will pop up
Since the graphics card driver has been installed before, select the driver here, click Enter to remove the X number, and then select Install and press Enter to install normally. 4. Open the .bashrc file (in the home directory), and enter the following lines
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64
export PATH=$PATH:/usr/local/cuda/bin
export CUDA_HOME=$CUDA_HOME:/usr/local/cuda
After saving, exit and enter source ~/.bashrc to activate
Enter nvcc -V in the terminal to see if cuda is installed successfully
Re-download the pytorch corresponding to cuda11.1 version
conda install pytorch torchvision torchaudio cudatoolkit=11.1 -c pytorch-lts -c nvidia