How to Install and Configure CUDA on Windows

NVIDIA CUDA Zone

CUDA is NVIDIA’s relatively mature API for data parallel GPU computing. I already explained the benefits of CUDA and even showed a simple code example. Now, you surely want to try it out yourself. This guide will explain how to correctly install and configure CUDA on Windows.

0. Make sure your computer can run CUDA

DirectX Properties

Find out which graphics card your computer has by going to the Run Dialog with Win+R and typing dxdiag. This will open the DirectX properties. Select the Display tab and it will tell you which card you have.

Next, go to NVIDIA’s list of CUDA-enabled products and search for you graphics card on the list. If you find it, you can run CUDA. All GeForce cards in the 8000 series or above in desktops and laptops as well as ION chipsets being used in new netbooks can run CUDA. Tesla and Quadro cards can also run CUDA. Check the list for your particular model just to make sure.

If your computer cannot run CUDA, you can still program and compile your projects in emulation mode, but it will be really slow.

1. Install Visual Studio 2008

Visual C++Visual C++ is arguably the best and the standard C++ IDE for Windows. You will need it to program and compile CUDA projects in Windows.

If you have 32-bit Windows, you can use Visual C++ 2008 Express Edition, which is free and works great for most projects.

If you have 64-bit Windows, you must use Visual Studio 2008 Professional, as the Express Edition does not compile to 64-bit binaries. If you’re a student, you can probably get it for free at Dreamspark. I’m not sure if Visual Studio 2008 Standard Edition works on 64-bit Windows. Please leave a comment if you can confirm this.

2. Install latest NVIDIA Driver

NVIDIA Driver Download

The driver is what lets you access all of your NVIDIA’s card latest features, including support for CUDA.

Go to NVIDIA’s Driver Download page, select your operating system and graphics card, and download the latest driver.

After installing the driver, you’ll have to restart your computer.

3. Install CUDA Toolkit and SDK

NVIDIA CUDA Download

The CUDA Toolkit will let you compile CUDA programs. The CUDA SDK contains sample projects that you can use when starting your own.

Go to NVIDIA’s CUDA Download page and select your OS. Next, download the correct version of the CUDA Toolkit and SDK for your system. Do not download the drivers on this page, you already downloaded the latest ones in the last step.

If you have a laptop, as of this writing the latest compatible version of CUDA is 2.2. Do not download 2.3, it will not work.

If you have a desktop, as of this writing the latest compatible version of CUDA is 2.3.

4. Try out the examples

CUDA SDK

Run the examples in the CUDA SDK to make sure everything works. In CUDA 2.2, search for NVIDIA CUDA SDK Browser in the Start Menu. In CUDA 2.3, search for NVIDIA GPU Computing SDK Browser. If they work, you have successfully installed the correct CUDA driver.

5. Test your setup by compiling an example

Compiling CUDA with Visual C++

Open the CUDA SDK folder by going to the SDK browser and choosing Files in any of the examples. Go to  the src (CUDA 2.3) or projects (CUDA 2.2) folder and then to one example. Open its Visual Studio 9.0 project in Visual C++. Compile it from scratch by choosing Build > Rebuild Solution.

Run it by choosing Debug > Start Without Debugging. If you are able to compile it without error, and it runs successfully, congratulations! You have correctly installed everything you need to develop with CUDA on Windows.

What if it doesn’t work?

If you followed this guide and CUDA still does not work, go back and make sure you installed the correct version of Visual Studio, drivers, toolkit and SDK. If it still does not work, leave a comment bellow and we’ll probably be able to help you. If you had problems installing CUDA but managed to solve them using a different method, also leave a comment sharing your solution.

  • Jose Antonio

    Hola Juliana,

    soy un estudiante de Valencia (España) y voy a empezar a hacer mi doctorado implementando aplicaciones de procesado de señal sobre las GPUs. He estado trabajando durante 3 meses con el EmuDebug en el VisualStudio 2008. Hoy por fin!!, tengo una targeta GE force 285 con un SO de windows 64 bits. He instalado todo, he abierto el Visual Studio, y no me deja compilar ninguno de los ejemplos. Creo que es porque el Visual Studio 2008 no esta preparado para aplicaciones de 64 bits. Sabes de alguna solucion para poder utilizar el VISUAL STUDIO 2008, ¿que deberia instalar?

    Muchas Gracias,

    Un saludo,
    Jose Antonio

  • Jose Antonio

    Hola Juliana,

    soy un estudiante de Valencia (España) y voy a empezar a hacer mi doctorado implementando aplicaciones de procesado de señal sobre las GPUs. He estado trabajando durante 3 meses con el EmuDebug en el VisualStudio 2008. Hoy por fin!!, tengo una targeta GE force 285 con un SO de windows 64 bits. He instalado todo, he abierto el Visual Studio, y no me deja compilar ninguno de los ejemplos. Creo que es porque el Visual Studio 2008 no esta preparado para aplicaciones de 64 bits. Sabes de alguna solucion para poder utilizar el VISUAL STUDIO 2008, ¿que deberia instalar?

    Muchas Gracias,

    Un saludo,
    Jose Antonio

  • http://julianapena.com Juliana Peña

    Trata desinstalar CUDA de 64 bits e instalar el de 32 bits, seguro esta es la solución más fácil. Si necesitas a fuerza usar 64 bits (el programa va a usar más de 4 GB de memoria), reinstala VS y asegúrate que esté seleccionada la opción de compilador de 64 bits (bajo Visual C++). Debes tener VS Profesional, el Express no tiene el compilador.Si sigues teniendo problemas me avisas. Saludos!

  • http://julianapena.com Juliana Peña

    @Jose Antonio
    Trata desinstalar CUDA de 64 bits e instalar el de 32 bits, seguro esta es la solución más fácil.

    Si necesitas a fuerza usar 64 bits (el programa va a usar más de 4 GB de memoria), reinstala VS y asegúrate que esté seleccionada la opción de compilador de 64 bits (bajo Visual C++). Debes tener VS Profesional, el Express no tiene el compilador.

    Si sigues teniendo problemas me avisas. Saludos!

  • Jose Antonio

    Hola Juliana!Bueno, he instalado el Windows server 2008 y el VS con el paquete ENTERO, y ya deja compilar los ejemplos del SDK de 64 bits, asique ya tengo puesta en marcha la GPU!! :-). De todas maneras, de momento, tenemos una maquina, y nos gustaria utilizarla utilizando “Acceso Escritorio Remoto”, pero si lo hacemos asi, resulta que la GPU, no la reconoce cuando estas en otro ordenador. ¿Sabes si existe alguna manera de hacer que la reconozca?Muchas GraciasSaludos

  • Jose Antonio

    @ Juliana Peña
    Hola Juliana!

    Bueno, he instalado el Windows server 2008 y el VS con el paquete ENTERO, y ya deja compilar los ejemplos del SDK de 64 bits, asique ya tengo puesta en marcha la GPU!! :-). De todas maneras, de momento, tenemos una maquina, y nos gustaria utilizarla utilizando “Acceso Escritorio Remoto”, pero si lo hacemos asi, resulta que la GPU, no la reconoce cuando estas en otro ordenador. ¿Sabes si existe alguna manera de hacer que la reconozca?

    Muchas Gracias

    Saludos

  • http://julianapena.com Juliana Peña

    La verdad nunca he usado acceso remoto, pero creo que lo que pasa es que el GPU no es accesible por acceso remoto.

  • http://julianapena.com Juliana Peña

    La verdad nunca he usado acceso remoto, pero creo que lo que pasa es que el GPU no es accesible por acceso remoto.

  • http://julianapena.com Juliana Peña

    La verdad nunca he usado acceso remoto, pero creo que lo que pasa es que el GPU no es accesible por acceso remoto.

  • http://julianapena.com Juliana Peña

    La verdad nunca he usado acceso remoto, pero creo que lo que pasa es que el GPU no es accesible por acceso remoto.

  • klavdij

    hi

    I have win7 premium (32bit) and GF8800GT and am trying to install CUDA … i installed tje latest driver from nvidia page but cant install the Cuda toolkit. It freezes (acces violation?) when i run the install (i tried both cuda versions – 2.3 and 2.2). I had 64bit Vista before and it worked fine … (yes i downloaded 32bit win7 cuda for win7 :)

    any help would be really welcome since i need cuda to finish my diploma :(

  • http://julianapena.com Juliana Peña

    Try to uninstall anything Nvidia from your PC, restart, and install the latest drivers (http://nvidia.com/drivers) and the CUDA 2.3 toolkit and SDK (http://nvidia.com/cuda). Beyond that, I wouldn't know what else to do.

  • almatuiti

    Hola: alguien me puede ayudar estoy instalando cuda pero al momento de correr los ejemplos me genera un herror y eso evita que vea los ejemplos.

  • http://julianapena.com Juliana Peña

    Qué error te genera? Y qué tarjeta de video tienes?

  • almatuiti

    Hola buenos dias el error que me genera es el siguiente: This application has failed to start because nvcuda.dll was not found.
    Re-installing the application may fix this problem.
    ya reinstale el cuda pero aun me sigue generando el mismo error.

    otro error que genera es al momento de correr un ejecutable me aparece el siguiente mensaje “Start program 'C:/ProgramData/NVIDIA Corporation/NVIDIA GPU Computing SDK/C/bin/win64/Release/bicubicTexture.exe' run #1 …
    Required OpenGL extensions are missing.
    Program run #1 failed, exit code: -1
    Error in program execution.”

    soy nueva en esto me prodrias proporcionar algun tutorial o informacion de como instalar y configurar el Nvidia, las ejecusiones las estoy haciendo ataraves de una simulacion ya que por el momento no cuento con la targeta todavia. es posible simular en windows vista sin tener instalada la targeta grafica”.

  • http://julianapena.com Juliana Peña

    Tienes que asegurarte que nvcuda.dll esté en tu PATH. Normalmente está en la carpeta System32. Te recomiendo desinstalar CUDA por completeo e instalar la versión de 32 bits a ver si eso funciona.

  • almatuiti

    Hola Buenas tardes solo para hacer una pregunta es posible instalar el cuda en un procesador AMD de windows vista por que estoy intentando instalarlo con el de 32 bits pero me genera un herror con el driver no me permite instalarlo le mando el error que me genera:
    “The NVIDIA Setup program could not locate any drivers that are compatible with your current hardware.setup will now exist.”

    espero y me pueda ayudar

  • http://julianapena.com Juliana Peña

    El driver TIENE que ser de la misma arquitectura que tu sistema operativo. Si usas 64 bits, instala del driver de 64 bits. El toolkit y el SDK pueden ser de 32 bits si tienes una arquitectura de 64, pero los dos deben ser iguales.

  • almatuiti

    Hola buenas tardes descargue para 32 bits el SDK y el toolkit en conjunto con su controlador pero al momento de querer correr los ejemplo que trae por default me genera el siguiente error:
    “cudaDecodeGL.exe has stopped working
    Aproblem caused the program to stop working correctly.
    Windows will close the program and notify you if a solution is available”

    NO ENTIENDIO POR QUE ME GENERA ESTE ERROR SI INSTALE CORRECTAMENTE AL toolking y el sdk los driver aun no los instalo por que estoy tratando de simular los ejemplos que trae por defauld. espero y me pueda ayudar gracias

  • almatuiti

    HOLA: BUENOS DIAS SOLO PARA HACER UNA PREGUNTA.

    ¿SE PUEDE EMULAR CUDA SIN NECESIDAD DE LA TARJETA NVIDIA EN WINDOWS?

    LO QUE PASA QUE ESTOY INSTALANDO CUDA PERO AUN NO TENGO LA TARGETA FISICAMENTE

  • http://julianapena.com Juliana Peña

    Sí se puede emular CUDA. Sólo recuerda compilar con Visual Studio en modo emu-debug o emu-release.

  • almatuiti

    HOLA: BUENOS DIAS SOLO PARA HACER UNA PREGUNTA.

    ¿SE PUEDE EMULAR CUDA SIN NECESIDAD DE LA TARJETA NVIDIA EN WINDOWS?

    LO QUE PASA QUE ESTOY INSTALANDO CUDA PERO AUN NO TENGO LA TARGETA FISICAMENTE

  • http://julianapena.com Juliana Peña

    Sí se puede emular CUDA. Sólo recuerda compilar con Visual Studio en modo emu-debug o emu-release.

  • Knut Guenther

    Hi there, I need to know if there is a possibility to use a GeForce 9800 GT within a Windows Server 2008 R2 Enterprise x64 System using CUDA? I tried the hole day but it seems there are now suitable drivers. I used the Windows 7 x64 driver (Vers. 196.21) but the CUDA Visual Profiler says: “Unable to initialize CUDA. CUDA Visual Profiler device features will be disabled.” Hope you had an idea!
    Greetings

  • jose

    Saludos. En razon a tu respuesta: Sí se puede emular CUDA. Sólo recuerda compilar con Visual Studio en modo emu-debug o emu-release. Pudieras ser mas especifica al respecto? o colocar un tutorial asi como este?…Exactamente que obtendria al simular? solo los calculos y la corrida como consola o podria ejecutar algunos de los ejemplos del nvidia sdk como la haces en este ejemplo? o que exactamente? y cuando dices sin tener tarjeta nvidia pudiera ser un video integrado? u obligatoriamente una tarjeta nvidia, asi sea de menor capacidad?

  • http://twitter.com/MichelCantagalo Michel Cantagalo

    I'm new on CUDA, and I'm learning it for scientific experimentations.
    I tried to compile the Simple Monte Carlo example and I received the following errors:

    1>—— Rebuild All started: Project: CUDAWinApp4, Configuration: Debug Win32 ——
    1>Deleting intermediate and output files for project 'CUDAWinApp4', configuration 'Debug|Win32'
    1>Compiling…
    1>MonteCarlo.cpp
    1>Linking…
    1>MonteCarlo.obj : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification
    1>MonteCarlo.obj : error LNK2019: unresolved external symbol _MonteCarloCPU referenced in function _main
    1>MonteCarlo.obj : error LNK2019: unresolved external symbol _BlackScholesCall referenced in function _main
    1>MonteCarlo.obj : error LNK2019: unresolved external symbol _closeMonteCarlo_SM10 referenced in function _main
    1>MonteCarlo.obj : error LNK2019: unresolved external symbol _closeMonteCarlo_SM13 referenced in function _main
    1>MonteCarlo.obj : error LNK2019: unresolved external symbol _MonteCarlo_SM10 referenced in function _main
    1>MonteCarlo.obj : error LNK2019: unresolved external symbol _MonteCarlo_SM13 referenced in function _main
    1>MonteCarlo.obj : error LNK2019: unresolved external symbol _initMonteCarlo_SM10 referenced in function _main
    1>MonteCarlo.obj : error LNK2019: unresolved external symbol _initMonteCarlo_SM13 referenced in function _main
    1>MonteCarlo.obj : error LNK2019: unresolved external symbol _inverseCND_SM10 referenced in function _main
    1>MonteCarlo.obj : error LNK2019: unresolved external symbol _inverseCND_SM13 referenced in function _main
    1>C:Documents and SettingsUserMeus documentosVisual Studio 2008ProjectsCUDAWinApp4DebugCUDAWinApp4.exe : fatal error LNK1120: 10 unresolved externals
    1>Build log was saved at “file://c:Documents and SettingsUserMeus documentosVisual Studio 2008ProjectsCUDAWinApp4CUDAWinApp4DebugBuildLog.htm”
    1>CUDAWinApp4 – 11 error(s), 1 warning(s)
    ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

    You know what is the problem?
    Thanks for your post and for your help!

    Michel.

  • Chris

    does visual express compile c as well as c++?

    if not, what is a good IDE for compiling C?

    Chris

  • Chris

    does visual express compile c as well as c++?

    if not, what is a good IDE for compiling C?

    Chris

  • http://inoportuno.aiz.es/?p=68 Configurar CUDA y Visual Basic Studio 2008

    [...] Visual Studio 2008 y CUDA | CUDA en Windows | CUDA y Visual C++ Esta entrada fue publicada en PFC y clasificada en CUDA, Visual Studio 2008. [...]

  • Ixperte

    error C3861: “cudaMalloc”: Bezeichner wurde nicht gefunden.

    what to do?

  • Priyanka

    sir , i install visual studio 2008 professional version with cuda 3.0 toolkit and sdk according to your insruction . but it could not work …that means i could not compile program written in vc++ with sdk.

  • Eric

    Got the following upon trying to compile and run an example!

    [CUDA FFT Ocean Simulation]

    Left mouse button – rotate
    Middle mouse button – pan
    Left + middle mouse button – zoom
    ‘w’ key – toggle wireframe
    [CUDA FFT Ocean Simulation]
    cufft: ERROR: D:/Bld/rel/gpgpu/toolkit/r2.2/cufft/src/config.cu, line 133
    cufft: ERROR: CUFFT_INTERNAL_ERROR
    CUFFT error in file ‘.oceanFFT.cpp’ in line 337.
    Press any key to continue . . .

  • Mika55589

    Hi Juliana,

    Please help me to solve the problem. When I compile some project it gives me this error…

    1>Linking…
    1>LINK : fatal error LNK1181: cannot open input file ‘.Debugtemplate.obj’
    1>Build log was saved at “file://c:UsershasmikoDocumentsVisual Studio 2008ProjectstemplateDebugBuildLog.htm”
    1>template – 1 error(s), 0 warning(s)

    What can I do???

  • Perftune

    Should I use CUDA compatible Video card even for monitor?
    I am installing Tesla2050 but my onboard graphic is Nvidia.

  • Sunilappu90

    i have installed cuda 2.3 – but compute visual profile is not initiating, it is giving an error “unable to load ‘nvcuda’ library, compute visual profiler features will be disabled.

  • Guest

    Unfortunately, you’ve skipped over the most important information covering the set-up of MSVC++2008 express. It is not intuitive. You must point the project to the lib and include directories, ensuring that you point to the correct subs as needed by your code, in the CUDA SDK so that you can compile test code.

  • Stannour

    with the newest versions of cuda toolkit and newest driver: can, Visual Studio 2010 express on a Windows-XP, compile Cuda c programs?

  • Fortinbras222

    Thanks a bunch!!

  • Akshay Verleker

    I have installed cuda toolkit, sdk and visual studio 2008. However I get build errors and I am not able to build the code. Please help.

  • Maha

    my display information for my notebook is GeForce G210M

    I tried to install the driver for CUDA “260.99_notebook_winvista_win7_32bit_international_whqland” I got this error :

    This file does’nt have a valid digital signature that verifies its publisher.
    and i after i run the file i got this error
    non 7- Zip error
    also when when i was installing the cudatoolkit_3.0 for win32 I got the same error above.

    I need help please

  • Vaee

    Hello Juliana, I tryed to run the same project you have above “oceanFFT “but it when I rebuild it on msVisualStudio8, it shows me 1 warning and 1 fatal error:

    Warning 1 Command line warning D9035 : option ‘Wp64′ has been deprecated and will be removed in a future release cl oceanFFT

    Error 2 fatal error LNK1181: cannot open input file ‘cutil32D.lib’ oceanFFT oceanFFT

    Any sugestion?
    Thank you

    PS> By the way Im using 64bits on windows 7 and on all the packages.

    -erix

  • Chaitu Pinninty

    Hi,
    I want to do programming on CUDA,I tried installing CUDA toolkit 3.2 and CUDA SDK 3.2 which i downloaded from the nvidia site,but i don’t have Cuda enabled hardware,but i happened to read that it can be possible to execute CUDA c programs without the CUDA enabled GPU which i read from a pdf downloaded from nvidia site , My sys configuration is Intel(R) pentium -4 with 2.80GHz 2.79GHz and 3.24GB RAM,and i have on board intel graphic port(Intel(R)82915G/GV/910GL Express Chipset Family)
    please help me with this hardware can i execute CUDA c with some software tools in emulation mode,please help me.
    with this configuration can i execute CUDA in c language,please guide me which softwares and tools required.

  • Vivek

    How do I get this to work with Visual Studio 2010? When I open existing projects using VS2010, I get a conversion error.

  • Ramon

    ¡Hola Juliana! Gracias por crear esta página. Tengo una laptop Sony Vaio con una tarjeta NVIDIA GeForce 310M. El sistema la reconoce bien. Sin embargo, al instalar el driver, el programa controlador gráfico de NVIDIA 266.58 me dice que no encontró el hardware compatible. Tengo Windows 7 de 64 bits, y descargu{e el programa de la p{agina de NVIDIA.

    ¿Qué puedo hacer? Mil gracias…

    Ramón.

  • Guest

    What errors do you get?

  • Arastoo

    hi every body,
    i started using CUDA for 1 week. i download CUDA Toolkit 3.2 , SDK 3.2 , devDriver and install them to
    my system. also i’m using MS Visual Studio 2008. i try , as you say , to run an example in NVIDIA GPU Computing SDK but the browser has not any sample and in itsown screen writes that ‘no search results’. then i tried to search internet to understanding how to use CUDA. i found a web page that says me you should set ‘custom build rules’ and i do that and i wrote a sample code (from internet) an try to compile it. but VS gaves me two errors that says :

    “C:Program FilesNVIDIA GPU Computing ToolkitCUDAv3.2\binnvcc.exe” -gencode=arch=compute_10,code=”sm_10,compute_10″ -gencode=arch=compute_20,code=”sm_20,compute_20″ –machine 32 -ccbin “C:Program Files (x86)Microsoft Visual Studio 9.0VCbin” -Xcompiler “/EHsc /W3 /nologo /O2 /Zi /MT ” -I”C:Program FilesNVIDIA GPU Computing ToolkitCUDAv3.2\include” -maxrregcount=32 –compile -o “Debug/FirstCUDA.cu.obj” FirstCUDA.cu
    1>FirstCUDA.cu
    1>c:/Users/admian/Documents/Visual Studio 2008/Projects/FirstCUDA/FirstCUDA/FirstCUDA.cu(2): error: expected a “{”
    1>1 error detected in the compilation of “C:/Users/admian/AppData/Local/Temp/tmpxft_000003cc_00000000-8_FirstCUDA.compute_20.cpp1.ii”.
    1>Project : error PRJ0019: A tool returned an error code from “Compiling with CUDA Build Rule…”
    1>Build log was saved at “file://c:UsersadmianDocumentsVisual Studio 2008ProjectsFirstCUDAFirstCUDADebugBuildLog.htm”

    please, please , please , sombody say me how to configure my system to be able compile a simple hello world CUDA project? I’m not a proffesional programmer please explain it step by step and clear.
    so thanks

  • Guest

    so I am runninc cuda on Windows 7 64 bit
    I downloaded and installed Cuda toolkit 3.1+SDK
    followed all the instructions in the programming guide
    Driver NVS 3100M on Lenovo thinkPad

    AND still
    I tried to run the template project and I fot the following error
    Error 1 error C3861: ‘__cudaInitArgBlock’: identifier not found C:UserscrdAppDataLocalTemp tmpxft_00000da8_00000000-6_template.compute_10.cudafe1.stub.c

    do u have any ideas about fixing this?

  • Dfsg

    FARK FARK FARK FATTYRI FAT

  • Eshanaka

    There is a copy of the the *.rules files installed in the CUDA toolkit directory. You can copy the *.rules files from:

    C:Program FilesNVIDIA CorporationNVIDIA GPU Computing ToolkitCUDAr4.0extrasvisual_studio_integration rules*.rules

    to

    ${Your Visual Studio Location}VCVCProjectDefaults

    And that should enable you to build the SDK projects.

  • Joelias Júnior

    Hello Juliana,

    I’m having problems to run it in Emulation mode. I’ve got some errs before install Visual Studio and try to build the CUDA code. Now it seems to be solved, but I didn’t found the place where I set the Visual Studio in emulation mode.

    Could you help me?

  • Bakhti Physics

    Is it possible to use visual studio 2010 in place of vs 2008.

    best,

  • Marco Polo

    Thank you.