Skip to content

If you want to run programs that require GPU acceleration (like AI software) on your computer, you might need to install CUDA.

CUDA is a tool developed by NVIDIA that allows your graphics card to handle more tasks. This article will guide you step-by-step through installing CUDA 12.6 and the corresponding cuDNN 9.8 on Windows 10.

Why choose CUDA 12.6 instead of 12.8? Because 12.8 is the latest version and may not be compatible with all software yet, potentially causing compatibility issues. Version 12.6 is a relatively stable and up-to-date version. Of course, if you want 12.4 or 12.8, the installation method is similar, and you can adjust the version number using this tutorial as a reference.

Don't worry, even if you're not tech-savvy, you can follow these steps and get it done! Let's get started!


Step 1: Check if Your Graphics Card is NVIDIA

  1. 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.
  2. Find Graphics Card Information

    • In the Computer Management window, click Device Manager on the left side, and find "Display adapters" on the right side. Click the small arrow in front of it to expand.

    • Check if there is "NVIDIA" in the name, such as "NVIDIA GeForce GTX 1660".

    • If yes, congratulations, your graphics card is NVIDIA, and you can continue. If not (e.g., it shows "Intel" or "AMD"), CUDA cannot be used, and this tutorial ends here.


Step 2: Check and Upgrade Your Graphics Card Driver

  1. Open NVIDIA Control Panel

    • If you have installed the graphics card driver, there might be a green "NVIDIA" icon in the taskbar (next to the time) in the lower-right corner of the desktop. Right-click it and select "NVIDIA GeForce Experience" to open it.

    • If not, skip to step 3 to download manually.

  2. Check Driver Version and Upgrade

    • After opening, click "Drivers" in the upper-left corner.
    • It will display the current driver version (e.g., "546.33"). If there is a new version, there will be a "Download" button.
    • Click "Download" and follow the prompts to install it. Restart your computer after installation.
  3. No Software? Manually Download Driver

    • Open a 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 follow the instructions to check for driver updates.

Step 3: Check if CUDA is Already Installed and Determine the Maximum Supported Version

  1. Open Command Prompt (CMD)
    • Press the Windows key + R on the keyboard to bring up the "Run" window.
    • Enter cmd and press Enter to open a black command line window.

  1. Check CUDA Version
    • Enter the following in the command line: nvcc -V

Press Enter. If it displays something like Cuda compilation tools, release 12.6, V12.6.xxx, it means CUDA has already been installed, and the version is 12.6. If it displays "is not recognized as an internal or external command", it means it has not been installed, continue to the installation steps.

  1. View the Maximum Supported CUDA Version
    • Enter the following in the command line: nvidia-smi

Press Enter, and a table will be displayed. The upper-right corner has "CUDA Version" (e.g., 12.6 or higher). This indicates the highest version supported by your driver. As long as it is 12.6 or higher, you can install the CUDA 12.6 version we want.


Step 4: Download and Install CUDA 12.6

  1. Download CUDA 12.6

  1. Install CUDA (Custom Mode)
    • Double-click the downloaded file, and the installation window will pop up. Agree to the agreement and click "Next".

    • Select "Custom (Advanced)" installation, click "Next".

    • In the option list, only check "CUDA" in the first line, and uncheck all other options to avoid conflicts.

  • Then click the + sign in front of CUDA and uncheck Visual Studio Integration, otherwise the installation may fail.

  • Click "Next" and follow the prompts to complete the installation. The default path is C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6.

  1. 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 "CUDA" in the first line, uncheck all other options, and open CUDA to uncheck Visual Studio Integration.
    • If the error persists, skip to the next step to install Visual Studio.

Step 5: Install Visual Studio (If CUDA Installation Fails)

If you uncheck Visual Studio Integration in the previous step, it should not go wrong. If it does, please install Visual Studio as described below.

  1. Download Visual Studio Community Edition

  2. Install C++ Development Environment

    • Double-click the installer. After the window pops up, select "Desktop development with C++".
    • Click "Install", which may take tens of minutes. Restart the computer after installation.

  1. Reinstall CUDA 12.6
    • Return to step 4 and rerun the CUDA installation program. Install only "Runtime" in custom mode. This time it should be successful.

Step 6: Verify CUDA Installation and Configure Environment Variables

  1. Check If the Installation Was 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 was successful. If it prompts "is not recognized as an internal or external command", you need to add environment variables.
  2. 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, enter nvcc -V, and you should be able to see the version information.


Step 7: Install cuDNN 9.8

  1. Download cuDNN 9.8

  1. Install cuDNN
    • Double-click the downloaded .exe file and follow the prompts to install.

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 folders lib bin include, and copy them to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6 to overwrite.


Finally: Congratulations!

CUDA 12.6 and cuDNN 9.8 are now 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.