Install CUDA On Windows: The Definitive Guide

Nilton Cesar Rojas Vales
6 min readApr 4, 2019

--

Cuda Property Management LLC logo

Nvidia provides us oficial documentation about CUDA , regrettably, lacks information, Not only it is assumed that you already know CUDA and its complements, but the official documentation also avoids many important steps. For this reason I wrote this guide.

Here I’m going to show you how to install CUDA toolKit (whichever version) on Windows 7,8 and 10 and an extra step for those having further problems.

If you tried installing CUDA before, you might have found the following:

  • Windows 10 CUDA installation failure.
  • Problem when trying to install CUDA 10 on Windows.
  • Cannot install due to failed Visual Studio Integration.
  • cudaErrorUnknown / cudaGraphicsGLRegisterBuffer.
  • Etc.

There are a lot of errors that surely were presented when you tried to install CUDA or just compile a sample. It’s impossible to try to find the specific fail because of the number of libraries and options in general that you can have in your computer or laptop and if you have these problems when you just installed CUDA it’s very likely that a correct installation fixes all problems.

You probably have the wrong CUDA version:

We will start by erasing everything about Nvidia CUDA.To do this correctly, we need a specified program called DDU Uninstaller. Click here to download.

Once DDU Uninstaller has been downloaded, we will proceed to uninstall Nvidia CUDA in this way:

  1. Go to control panel and uninstall all about Nvidia CUDA except Nvidia driver and Nvidia driver 3d.

2. In order to use DDU Uninstaller, you need to run Windows on safe mode, there are a lot of tutorials about this, please use DDU correctly.

You need a correct version of Nvidia drivers , in other words, the driver which work with your pc or laptop should be the correct. In this step you have two options :

  • On your Disk C:/ there is a folder called “Drivers” , on this folder you going to be able to look at GPU folder, please install that driver which is the correct driver for your computer or laptop.
  • But if you don’t have this driver don’t worry, you can find your correct driver on internet in specified the official page of your laptop company also I recommend you don’t use programs like “easydriver” because could be not reliable.

A big way to verify if you Nvidia driver is the correct for your computer or laptop is look at Nvidia control panel and realise if appear the name of own graph card. Below you can look (in green box) my graph card GeForce GTX 1050.

Now you have the correct nvidia driver and we can install CUDA Tool Kit without problems…

Install without problems doesn’t mean that you can install CUDA without care, you have to pay close attention to steps we will talk next.

It’s very important to install in the order that the following programs appear. In Windows we will need Visual Studio to build and compile CUDA programs, and I recommend using this tool because although there are ways to not use it, Visual Studio simplifies the work much because it has project templates of CUDA (the own Nvidia enterprise recommends it ). Having a template of CUDA involves don’t worry about libraries and having everything at hand.

Visual Studio

I have installed Visual Studio 15 community but you can choose any version. You may wonder if you can use Visual Studio 2017 or 2019 : Guiding us of these two articles:

You will be able to use the Visual Studio of your preference, but In my opinion Visual Studio 2015 is slightly easier to install, and if you are newbie I recommend for you Visual Studio 2015.

You can get visual studio 2015 community here. There are a lot options when you install visual studio 2015 but remember you need C or C++ to use CUDA so this option you need check when you install visual studio 2015.

Be patient the installation of Visual studio takes many minutes.

Cuda ToolKit

We need CUDA TOOLKIT but the correct version. In this step we need to download CUDA TOOLKIT of this list (click here) and based on this box:

You can find this information in https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html. On the section “RESOLVE PROBLEMS” on this guide we installed a specific and correct version of nvidia driver , based on this version, please download you correct CUDA VERSION (in my case 10.0), remeber that we have not installed CUDA TOOLKIT yet.

To install CUDA TOOLKIT:
A simple but important note is uncheck the box where we accept to install another nvidia driver because we can’t improve or decrease the correct version of nvidia which installed in the first part of this guide, in this image we choose Custom (Advanced).

Next uncheck Driver components in this way:

We will end soon…

I hope that until this part of the guide it hasn’t been submitted problems to install Visual Studio, and if you have doubts about the components in Visual Studio don’t worry because to open or compile a simple sample of CUDA, Visual Studio will ask you the componentes which you need to run CUDA.

In C:\ProgramData\NVIDIA Corporation\CUDA Samples\v10.0 you can find a different samples of Nvidia and it’s a good way to detect if you installation is OK.

I suggest you open Simulations folder and open nbody proyect, If you first visualization about a CUDA program is this project it is safe you will be amazed. Open the correct version, in my case nbody_vs2015.sln.

Build, run and Fun

Finally we have finished installing, now compiling and running the program will not be a problem if we have not been presented with an error message.

I wonder how many people did not use CUDA because they were not able to install it in their operating system, how many hours lost by people who decided to install CUDA in Linux, changing their operating system and how many questions on the internet were made just for a bad installation of CUDA I hope it helps many people to enter the CUDA world and that the people of Nvidia can be more detailed with their guides.

--

--