CUDA is a tool launched by NVIDIA that allows your graphics card to do more work. In this software (pyVideoTrans), if you want to enable CUDA acceleration
, you must first install the CUDA environment. This article will guide you step by step to install CUDA 12.6 and its matching cuDNN 9.8 on Windows 10.
Why choose CUDA 12.6 instead of 12.8? Because 12.8 is the latest version, some software may not be adapted yet, which can easily cause compatibility issues. And 12.6 is a relatively stable and not outdated version. Of course, if you want 12.4 or 12.8, the installation method is similar, you can refer to this tutorial to adjust the version number.
Step 1: Check if Your Graphics Card is NVIDIA
Open Device Manager
- Right-click the "Start" button (the Windows icon) in the lower-left corner of the desktop.
- In the pop-up menu, select "Windows Administrative Tools - Computer Management" to open the window.
Find Graphics Card Information
In the window opened by Computer Management, click
Device Manager
on the left, and find "Display adapters" on the right, click the small arrow in front to expand it.See if there is "NVIDIA" in it, such as "NVIDIA GeForce GTX 1660" or similar.
If so, congratulations, your graphics card is NVIDIA, you can continue. If not (for example, "Intel" or "AMD" is displayed), then CUDA cannot be used, and the tutorial ends here.
Step 2: Check and Upgrade the Graphics Card Driver Version
Open NVIDIA Management Software
If you have installed the graphics card driver, there may be a green "NVIDIA" icon in the taskbar in the lower-right corner of the desktop (next to the time). Right-click it and select "NVIDIA GeForce Experience" to open it.
If not, skip to step 3 to download it manually.
Check the Driver Version and Upgrade
- After opening, click "Drivers" in the upper-left corner.
- It will display the current driver version (such as "546.33"). If there is a new version, there will be a "Download" button.
- Click "Download", and then follow the prompts to install. Restart your computer after installation.
No Software? Manually Download the Driver
- Open your browser and enter the website: https://www.nvidia.com/en-us/geforce/drivers/ to download the driver upgrade software, and then install it.
- Open it after installation and check for updated drivers according to the instructions.
Step 3: Check if CUDA is Already Installed and Determine the Maximum Supported Version
- Open Command Line Terminal (CMD)
- Press and hold the Windows key + R on the keyboard to pop up the "Run" window.
- Enter
cmd
and press Enter to open a black command line window.
- Check CUDA Version
- Enter in the command line:
nvcc -V
- Enter in the command line:
Press Enter. If it displays something like Cuda compilation tools, release 12.6, V12.6.xxx
, it means CUDA has been installed and the version is 12.6. If it displays "is not an internal or external command", it means it has not been installed. Go ahead with the installation.
- View the Maximum Supported CUDA Version
- Enter in the command line:
nvidia-smi
- Enter in the command line:
Press Enter, a table will be displayed, and there is "CUDA Version" in the upper right corner (such as 12.6 or higher). This indicates the highest version supported by your driver. As long as it is 12.6 or above, you can install the CUDA 12.6 we want.
Step 4: Download and Install CUDA 12.6
- Download CUDA 12.6
- Open your browser and go to the NVIDIA official website download page: https://developer.nvidia.com/cuda-downloads?target_os=Windows&target_arch=x86_64&target_version=10&target_type=exe_local
- Select "Windows" > "x86_64" > "10" > "exe (local)", and click "Download".
- The file name is probably
cuda_12.8.1_572.61_windows.exe
, which will be downloaded to your "Downloads" folder.
- Install CUDA (Custom Mode)
Double-click the downloaded file, a installation window will pop up, agree to the agreement and click "Next".
Select "Custom (Advanced)" installation and click "Next".
In the option list, only check the first line "CUDA", and uncheck all other options to avoid conflicts.
Then click the
+
sign in front ofCUDA
to uncheckVisual Studio Integration
, otherwise it is easy to fail to install.Click "Next" and follow the prompts to complete the installation. The default path is
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6
.
What to do if you encounter an error?
- If the installation is interrupted and prompts "Not installed" or "Failed", it may be that the options are not selected correctly. Re-run the installation program, select custom installation, make sure to only select the first line "CUDA", uncheck all others, and open CUDA to uncheck
Visual Studio Integration
. - If the error still occurs, skip to the next step to install Visual Studio.
- If the installation is interrupted and prompts "Not installed" or "Failed", it may be that the options are not selected correctly. Re-run the installation program, select custom installation, make sure to only select the first line "CUDA", uncheck all others, and open CUDA to uncheck
Step 5: Install Visual Studio (If CUDA Installation Fails)
If you uncheck
Visual Studio Integration
in the previous step, there should be no errors. If an error occurs, please install Visual Studio accordingly.
Download Visual Studio Community Edition
- Open your browser and go to: https://visualstudio.microsoft.com/zh-hans/free-developer-offers/
- Click "Free download Visual Studio Community" (Community Edition) to download the installer.
Install C++ Development Environment
- Double-click the installer. After the window pops up, select "Desktop development with C++".
- Click "Install", which may take several tens of minutes. Restart your computer after installation.
- Reinstall CUDA 12.6
- Return to the fourth step and re-run the CUDA installation program. Select "Runtime" installation in custom mode. This time it should be successful.
Step 6: Verify CUDA Installation and Configure Environment Variables
Check if the Installation is Successful
- Open CMD (Windows key + R, enter
cmd
). - Enter:
nvcc -V
If it displays
Cuda compilation tools, release 12.6, V12.6.xxx
, it means the installation is successful. If it prompts "is not an internal or external command", you need to add environment variables.
- Open CMD (Windows key + R, enter
Add CUDA to Environment Variables
- Right-click "This PC", select "Properties" > "Advanced system settings" > "Environment Variables".
- In the "Path" of "System variables", click "New" and enter:
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\bin C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\lib C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\include C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\libnvvp
- Click "OK" to save and close all windows.
- Reopen CMD and enter
nvcc -V
. You should be able to see the version information now.
Step 7: Install cuDNN 9.8
- Download cuDNN 9.8
- Open your browser and go to: https://developer.nvidia.com/cudnn-downloads?target_os=Windows&target_arch=x86_64&target_version=10&target_type=exe_local
- You may need to log in to your NVIDIA account (register for one if you don't have one, it's free).
- Select "local version" and download the Windows
.exe
file.
- Install cuDNN
- Double-click the downloaded
.exe
file and follow the prompts to install.
- Double-click the downloaded
If cuDNN cannot be used in the program after installation, you can open the installation directory, default
C:\Program Files\NVIDIA\CUDNN\v9.8
, copy the 3 folderslib
,bin
, andinclude
, and copy them toC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6
to overwrite.
Finally: Success!
Now CUDA 12.6 and cuDNN 9.8 are installed! You can start running programs that require GPU support. If there are software instructions (such as running python script.py
), enter the project folder in CMD and enter the corresponding command to try.