The solution to the mismatch between the native CUDA running version and the driver version

Source of problem:

        I have been exposed to the field of artificial intelligence recently, so I need to download CUDA and many applications to support the Pytorch operating environment. Due to the high version of CUDA downloaded for the first time, the Pytorch official website has no time to update and support the high version of CUDA, so it can only uninstall the current version of CUDA 11.7 and download the CUDA 11.6 supported by the Pytorch official website. Due to a lot of obstacles, it is recorded in the blog to share with you the pits I have stepped on.

Solution:

        First open the cmd command window and output the following command:

nvidia-smi

        As you can see, in the table displayed at this time, there is a field called CUDA Version, and my interface looks like this:

 

         You can see that my CUDA version is 11.7, and the version here refers to the driver version information, that is to say, the CUDA driver version on my machine is 11.7.

        There is another way to check the CUDA driver version of the machine: first open the NVIDIA Control Panel -> System Information -> Components, you can check the CUDA driver version on the machine, as shown in the figure below:

         Then check the runtime version information of CUDA on the current machine, open the command line window, and enter the following command:

nvcc -V

        You can see that the terminal outputs information about the CUDA runtime version on the machine, as shown in the figure below:

         It should be noted that it is not necessarily necessary to make the runtime version of CUDA consistent with the driver version of CUDA. From the first screenshot, we can see that there is a Driver Version: 516.01 on the left side of the circled CUDA Version: 11.7, which is a watershed. First of all, we go online to find the corresponding relationship between CUDA Toolkit and Driver Version. The link to the official website is as follows: Release Notes :: CUDA Toolkit Documentation . The screenshot from the official website is shown below. If you don’t have the Driver Version corresponding to your machine on the list, you can go to the official website to check it yourself.

         It can be seen that my Driver Version is 516.01, and the highest version that can be supported is CUDA Version 11.7. However, since the Pytorch official website has not had time to launch Pytorch that supports CUDA 11.7, I can only download the CUDA 11.6 version to cater to the lower version of Pytorch. So far, the problem about CUDA runtime version and driver version has been solved.

Guess you like

Origin blog.csdn.net/m0_59705760/article/details/125757532