1.UserWarning: CUDA initialization: The NVIDIA driver on your system is too old (found version 10010)

Analysis:

CUDA version < Torch version. There are two solutions:

  • Upgrade CUDA
  • Reduced Torch version

Screen:

print(torch.version.cuda)
Copy the code

Check the CUDA version used by Torch and the result is 10.2

nvcc -V
Copy the code

Looking at the current CUDA version of the graphics card, we can see that the error was caused by a mismatch between the graphics card and the CUDA version of the Torch

Solution:

Click the link below to find cuda10.1 versions on pyTorch’s website pytorch.org/get-started… Select the version of cuda10.1 corresponding to torch1.7.1 to download and install. Since conda is not supported in China, PIP is selected to install

# CUDA 10.1 PIP install Torch ==1.7.1+ CU101 TorchVision ==0.8.2+ Cu101 Torchaudio ==0.7.2 -f https://download.pytorch.org/whl/torch_stable.htmlCopy the code

Validation:

Cudd.version. Cuda is back to 10.1.

References:

  1. Blog.csdn.net/weixin_4373…
  2. www.zhihu.com/question/30…