Skip to content

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

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

Why choose CUDA 12.6 instead of 12.8? Because 12.8 is the latest version and may not be fully compatible with some software yet, which could lead to issues. On the other hand, 12.6 is a relatively stable and up-to-date version. Of course, if you prefer 12.4 or 12.8, the installation process is similar—just adjust the version number according to this tutorial.

Don’t worry, even if you’re not tech-savvy, just follow the steps and you’ll get it done! Let’s get started!


Step 1: Check if Your Graphics Card is from NVIDIA

  1. Open Device Manager

    • Right-click the "Start" button (the Windows icon) in the bottom-left corner of your desktop.
    • From the menu, select "Windows Administrative Tools" > "Computer Management" to open a window.
  2. Find Graphics Card Information

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

    • Look for "NVIDIA" in the list, such as "NVIDIA GeForce GTX 1660".

    • If you see it, congratulations—your graphics card is from NVIDIA, and you can proceed. If not (e.g., it shows "Intel" or "AMD"), CUDA won’t work, and this tutorial ends here.


Step 2: Check and Update Your Graphics Card Driver

  1. Open NVIDIA Management Software

    • If you’ve installed the graphics driver before, there might be a green "NVIDIA" icon in the taskbar (next to the time). 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 Update

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


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 your keyboard to open the "Run" window.
    • Type cmd and press Enter to open a black command-line window.
  2. Check CUDA Version

    • In the command prompt, type: nvcc -V

    Press Enter. If it shows something like Cuda compilation tools, release 12.6, V12.6.xxx, CUDA is already installed with version 12.6. If it says "not recognized as an internal or external command", CUDA is not installed—proceed with the installation.

  3. Check the Maximum Supported CUDA Version

    • In the command prompt, type: nvidia-smi

    Press Enter, and a table will appear. Look for "CUDA Version" in the top-right corner (e.g., 12.6 or higher). This indicates the highest version your driver supports. As long as it’s 12.6 or above, you can install CUDA 12.6.


Step 4: Download and Install CUDA 12.6

  1. Download CUDA 12.6

  2. Install CUDA (Custom Mode)

    • Double-click the downloaded file, agree to the license, and click Next.

    • Choose "Custom (Advanced)" installation, then click Next.

    • In the options list, only check the first row "CUDA" and uncheck all others to avoid conflicts.

    • Then click the + next to CUDA and uncheck Visual Studio Integration to prevent installation failures.

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

  3. What to Do If You Encounter Errors?

    • If the installation fails with "Not installed" or "Failed", you may have selected the wrong options. Run the installer again, choose custom installation, ensure only the first row "CUDA" is selected, uncheck all others, and expand CUDA to uncheck Visual Studio Integration.
    • If it still fails, proceed to the next step to install Visual Studio.

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

If you unchecked Visual Studio Integration in the previous step, errors should be unlikely. But if errors occur, follow this step to install Visual Studio.

  1. Download Visual Studio Community Edition

  2. Install C++ Development Environment

    • Double-click the installer, and in the pop-up window, select "Desktop development with C++".
    • Click "Install". This may take several tens of minutes. Restart your computer after installation.
  3. Reinstall CUDA 12.6

    • Go back to Step 4, run the CUDA installer again, and choose custom mode to install only "Runtime". This time it should succeed.

Step 6: Verify CUDA Installation and Configure Environment Variables

  1. Check if Installation Was Successful

    • Open CMD (Windows key + R, type cmd).
    • Type: nvcc -V

    If it shows Cuda compilation tools, release 12.6, V12.6.xxx, the installation was successful. If it says "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".
    • Under "System variables", find "Path", click "New", and add the following paths:
      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, then close all windows.
    • Reopen CMD and type nvcc -V—you should now see the version information.

Step 7: Install cuDNN 9.8

  1. Download cuDNN 9.8

  2. Install cuDNN

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

If cuDNN doesn’t work in your programs after installation, open the installation directory (default: C:\Program Files\NVIDIA\CUDNN\v9.8), copy the lib, bin, and include folders, and paste them into C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6, overwriting existing files if prompted.


Final Step: All Done!

Now CUDA 12.6 and cuDNN 9.8 are successfully installed! You can start running programs that require GPU support. If there are software instructions (e.g., running python script.py), open CMD, navigate to your project folder, and try the corresponding commands.