CUDA Installation Guide for Microsoft Windows
The installation instructions for the CUDA Toolkit on Microsoft Windows systems.
CUDA® is a parallel computing platform and programming model invented by NVIDIA. It enables dramatic increases in computing performance by harnessing the power of the graphics processing unit (GPU).
CUDA was developed with several design goals in mind:
-
Provide a small set of extensions to standard programming languages, like C, that enable a straightforward implementation of parallel algorithms. With CUDA C/C++, programmers can focus on the task of parallelization of the algorithms rather than spending time on their implementation.
-
Support heterogeneous computation where applications use both the CPU and GPU. Serial portions of applications are run on the CPU, and parallel portions are offloaded to the GPU. As such, CUDA can be incrementally applied to existing applications. The CPU and GPU are treated as separate devices that have their own memory spaces. This configuration also allows simultaneous computation on the CPU and GPU without contention for memory resources.
CUDA-capable GPUs have hundreds of cores that can collectively run thousands of computing threads. These cores have shared resources including a register file and a shared memory. The on-chip shared memory allows parallel tasks running on these cores to share data without sending it over the system memory bus.
This guide will show you how to install and check the correct operation of the CUDA development tools.
1.1. System Requirements
To use CUDA on your system, you will need the following installed:
-
A CUDA-capable GPU
-
A supported version of Linux with a gcc compiler and toolchain
-
NVIDIA CUDA Toolkit (available at https://developer.nvidia.com/cuda-downloads)
Supported Microsoft Windows® operating systems:
-
Microsoft Windows 11 24H2
-
Microsoft Windows 11 22H2-SV2
-
Microsoft Windows 11 23H2
-
Microsoft Windows 10 22H2
-
Microsoft Windows Server 2022
-
Microsoft Windows Server 2025
Table 1 Windows Compiler Support in CUDA 12.9
Compiler* |
IDE |
Native x86_64 |
Cross-compilation (32-bit on 64-bit) |
C++ Dialect |
---|---|---|---|---|
MSVC Version 193x |
Visual Studio 2022 17.x |
YES |
Not supported |
C++14 (default), C++17, C++20 |
MSVC Version 192x |
Visual Studio 2019 16.x |
YES |
C++14 (default), C++17 |
* Support for Visual Studio 2015 is deprecated in release 11.1; support for Visual Studio 2017 is deprecated in release 12.5 and dropped in release 12.9.
32-bit compilation native and cross-compilation is removed from CUDA 12.0 and later Toolkit. Use the CUDA Toolkit from earlier releases for 32-bit compilation. CUDA Driver will continue to support running 32-bit application binaries on GeForce GPUs until Ada. Ada will be the last architecture with driver support for 32-bit applications. Hopper does not support 32-bit applications.
Support for running x86 32-bit applications on x86_64 Windows is limited to use with:
-
CUDA Driver
-
CUDA Runtime (cudart)
-
CUDA Math Library (math.h)
1.2. About This Document
This document is intended for readers familiar with Microsoft Windows operating systems and the Microsoft Visual Studio environment. You do not need previous experience with CUDA or experience with parallel computation.
2. Installing CUDA Development Tools
Basic instructions can be found in the Quick Start Guide. Read on for more detailed instructions.
The setup of CUDA development tools on a system running the appropriate version of Windows consists of a few simple steps:
-
Verify the system has a CUDA-capable GPU.
-
Download the NVIDIA CUDA Toolkit.
-
Install the NVIDIA CUDA Toolkit.
-
Test that the installed software runs correctly and communicates with the hardware.
2.1. Verify You Have a CUDA-capable GPU
You can verify that you have a CUDA-capable GPU through the Display Adapters section in the Windows Device Manager. Here you will find the vendor name and model of your graphics card(s). If you have an NVIDIA card that is listed in https://developer.nvidia.com/cuda-gpus, that GPU is CUDA-capable. The Release Notes for the CUDA Toolkit also contain a list of supported products.
The Windows Device Manager can be opened via the following steps:
-
Open a run window from the Start Menu
-
Run:
control /name Microsoft.DeviceManager
2.2. Download the NVIDIA CUDA Toolkit
The NVIDIA CUDA Toolkit is available at https://developer.nvidia.com/cuda-downloads. Choose the platform you are using and one of the following installer formats:
-
Network Installer: A minimal installer which later downloads packages required for installation. Only the packages selected during the selection phase of the installer are downloaded. This installer is useful for users who want to minimize download time.
-
Full Installer: An installer which contains all the components of the CUDA Toolkit and does not require any further download. This installer is useful for systems which lack network access and for enterprise deployment.
The CUDA Toolkit installs the CUDA driver and tools needed to create, build and run a CUDA application as well as libraries, header files, and other resources.
The download can be verified by comparing the MD5 checksum posted at https://developer.download.nvidia.com/compute/cuda/9.0/docs/sidebar/md5sum.txt with that of the downloaded file. If either of the checksums differ, the downloaded file is corrupt and needs to be downloaded again.
2.3. Install the CUDA Software
Before installing the toolkit, you should read the Release Notes, as they provide details on installation and software functionality.
Note
The driver and toolkit must be installed for CUDA to function. If you have not installed a stand-alone driver, install the driver from the NVIDIA CUDA Toolkit.
Note
The installation may fail if Windows Update starts after the installation has begun. Wait until Windows Update is complete and then try the installation again.
Graphical Installation
Install the CUDA Software by executing the CUDA installer and following the on-screen prompts.
Silent Installation
The installer can be executed in silent mode by executing the package with the -s
flag. Additional parameters can be passed which will install specific subpackages instead of all packages. See the table below for a list of all the subpackage names.
Table 2 Possible Subpackage Names
Subpackage Name |
Subpackage Description |
---|---|
Toolkit Subpackages (defaults to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.9) |
|
cublas_12.9 cublas_dev_12.9 |
cuBLAS runtime libraries |
cuda_profiler_api_12.9 |
CUDA Profiler API |
cudart_12.9 |
CUDA Runtime libraries |
cufft_12.9 cufft_dev_12.9 |
cuFFT runtime libraries |
cuobjdump_12.9 |
Extracts information from cubin files |
cupti_12.9 |
The CUDA Profiling Tools Interface for creating profiling and tracing tools that target CUDA applications |
curand_12.9 curand_dev_12.9 |
cuRAND runtime libraries |
cusolver_12.9 cusolver_dev_12.9 |
cuSOLVER runtime libraries |
cusparse_12.9 cusparse_dev_12.9 |
cuSPARSE runtime libraries |
cuxxfilt_12.9 |
The CUDA cu++ filt demangler tool |
demo_suite_12.9 |
Prebuilt demo applications using CUDA |
Display.Driver |
The NVIDIA Display Driver. Required to run CUDA applications |
documentation_12.9 |
CUDA HTML and PDF documentation files including the CUDA C++ Programming Guide, CUDA C++ Best Practices Guide, CUDA library documentation, etc |
nsight_compute_12.9 |
Nsight Compute |
nsight_systems_12.9 |
Nsight Systems |
nsight_vse_12.9 |
Installs the Nsight Visual Studio Edition plugin in all VS |
npp_12.9 npp_dev_12.9 |
NPP runtime libraries |
nvcc_12.9 |
CUDA compiler |
nvdisasm_12.9 |
Extracts information from standalone cubin files |
nvfatbin_12.9 |
Library for creating fatbinaries at runtime |
nvjitlink_12.9 |
nvJitLink library |
nvjpeg_12.9 nvjpeg_dev_12.9 |
nvJPEG libraries |
nvml_dev_12.9 |
NVML development libraries and headers |
nvprof_12.9 |
Tool for collecting and viewing CUDA application profiling data from the command-line |
nvprune_12.9 |
Prunes host object files and libraries to only contain device code for the specified targets |
nvrtc_12.9 nvrtc_dev_12.9 |
NVRTC runtime libraries |
nvtx_12.9 |
NVTX on Windows |
occupancy_calculator_12.9 |
Installs the CUDA_Occupancy_Calculator.xls tool |
opencl_12.9 |
OpenCL library |
sanitizer_12.9 |
Compute Sanitizer API |
thrust_12.9 |
CUDA Thrust |
visual_profiler_12.9 |
Visual Profiler |
visual_studio_integration_12.9 |
Installs CUDA project wizard and builds customization files in VS |
For example, to install only the compiler and driver components:
<PackageName>.exe -s nvcc_12.1 Display.Driver
Use the -n
option if you do not want to reboot automatically after install or uninstall, even if reboot is required.
Extracting and Inspecting the Files Manually
Sometimes it may be desirable to extract or inspect the installable files directly, such as in enterprise deployment, or to browse the files before installation. The full installation package can be extracted using a decompression tool which supports the LZMA compression method, such as 7-zip or WinZip.
Once extracted, the CUDA Toolkit files will be in the CUDAToolkit
folder, and similarly for CUDA Visual Studio Integration. Within each directory is a .dll and .nvi file that can be ignored as they are not part of the installable files.
Note
Accessing the files in this manner does not set up any environment settings, such as variables or Visual Studio integration. This is intended for enterprise-level deployment.
2.3.1. Uninstalling the CUDA Software
All subpackages can be uninstalled through the Windows Control Panel by using the Programs and Features widget.
2.4. Using Conda to Install the CUDA Software
This section describes the installation and configuration of CUDA when using the Conda installer. The Conda packages are available at https://anaconda.org/nvidia.
2.4.1. Conda Overview
The Conda installation installs the CUDA Toolkit. The installation steps are listed below.
2.4.2. Installation
To perform a basic install of all CUDA Toolkit components using Conda, run the following command:
conda install cuda -c nvidia
2.4.3. Uninstallation
To uninstall the CUDA Toolkit using Conda, run the following command:
2.4.4. Installing Previous CUDA Releases
All Conda packages released under a specific CUDA version are labeled with that release version. To install a previous version, include that label in the install
command such as:
conda install cuda -c nvidia/label/cuda-11.3.0
Note
Some CUDA releases do not move to new versions of all installable components. When this is the case these components will be moved to the new label, and you may need to modify the install command to include both labels such as:
conda install cuda -c nvidia/label/cuda-11.3.0 -c nvidia/label/cuda-11.3.1
This example will install all packages released as part of CUDA 11.3.1.
2.5. Use a Suitable Driver Model
On Windows 10 and later, the operating system provides two driver models under which the NVIDIA Driver may operate:
-
The WDDM driver model is used for display devices.
-
The Tesla Compute Cluster (TCC) mode of the NVIDIA Driver is available for non-display devices such as NVIDIA Tesla GPUs and the GeForce GTX Titan GPUs; it uses the Windows WDM driver model.
TCC is enabled by default on most recent NVIDIA Tesla GPUs. To check which driver mode is in use and/or to switch driver modes, use the nvidia-smi
tool that is included with the NVIDIA Driver installation (see nvidia-smi -h
for details).
Note
Keep in mind that when TCC mode is enabled for a particular GPU, that GPU cannot be used as a display device.
Note
NVIDIA GeForce GPUs (excluding GeForce GTX Titan GPUs) do not support TCC mode.
2.6. Verify the Installation
Before continuing, it is important to verify that the CUDA toolkit can find and communicate correctly with the CUDA-capable hardware. To do this, you need to compile and run some of the included sample programs.
2.6.1. Running the Compiled Examples
The version of the CUDA Toolkit can be checked by running nvcc -V
in a Command Prompt window. You can display a Command Prompt window by going to:
Start > All Programs > Accessories > Command Prompt
CUDA Samples are located in https://github.com/nvidia/cuda-samples. To use the samples, clone the project, build the samples, and run them using the instructions on the Github page.
To verify a correct configuration of the hardware and software, it is highly recommended that you build and run the deviceQuery
sample program. The sample can be built using the provided VS solution files in the deviceQuery
folder.
This assumes that you used the default installation directory structure. If CUDA is installed and configured correctly, the output should look similar to Figure 1.
Figure 1 Valid Results from deviceQuery CUDA Sample
The exact appearance and the output lines might be different on your system. The important outcomes are that a device was found, that the device(s) match what is installed in your system, and that the test passed.
If a CUDA-capable device and the CUDA Driver are installed but deviceQuery
reports that no CUDA-capable devices are present, ensure the device and driver are properly installed.
Running the bandwidthTest
program, located in the same directory as deviceQuery
above, ensures that the system and the CUDA-capable device are able to communicate correctly. The output should resemble Figure 2.
Figure 2 Valid Results from bandwidthTest CUDA Sample
The device name (second line) and the bandwidth numbers vary from system to system. The important items are the second line, which confirms a CUDA device was found, and the second-to-last line, which confirms that all necessary tests passed.
If the tests do not pass, make sure you do have a CUDA-capable NVIDIA GPU on your system and make sure it is properly installed.
To see a graphical representation of what CUDA can do, run the particles
sample at
https://github.com/NVIDIA/cuda-samples/tree/master/Samples/2_Concepts_and_Techniques/particles
3. Pip Wheels
NVIDIA provides Python Wheels for installing CUDA through pip, primarily for using CUDA with Python. These packages are intended for runtime use and do not currently include developer tools (these can be installed separately).
Please note that with this installation method, CUDA installation environment is managed via pip and additional care must be taken to set up your host environment to use CUDA outside the pip environment.
3.1. Prerequisites
To install Wheels, you must first install the nvidia-pyindex
package, which is required in order to set up your pip installation to fetch additional Python modules from the NVIDIA NGC PyPI repo. If your pip and setuptools Python modules are not up-to-date, then use the following command to upgrade these Python modules. If these Python modules are out-of-date then the commands which follow later in this section may fail.
py -m pip install --upgrade setuptools pip wheel
You should now be able to install the nvidia-pyindex
module.
py -m pip install nvidia-pyindex
If your project is using a requirements.txt
file, then you can add the following line to your requirements.txt
file as an alternative to installing the nvidia-pyindex
package:
--extra-index-url https://pypi.ngc.nvidia.com
3.2. Procedure
Install the CUDA runtime package:
py -m pip install nvidia-cuda-runtime-cu12
Optionally, install additional packages as listed below using the following command:
py -m pip install nvidia-<library>
3.3. Metapackages
The following metapackages will install the latest version of the named component on Linux for the indicated CUDA version. “cu12” should be read as “cuda12”.
-
nvidia-cublas-cu12
-
nvidia-cuda-cccl-cu12
-
nvidia-cuda-cupti-cu12
-
nvidia-cuda-nvcc-cu12
-
nvidia-cuda-nvrtc-cu12
-
nvidia-cuda-opencl-cu12
-
nvidia-cuda-runtime-cu12
-
nvidia-cuda-sanitizer-api-cu12
-
nvidia-cufft-cu12
-
nvidia-curand-cu12
-
nvidia-cusolver-cu12
-
nvidia-cusparse-cu12
-
nvidia-npp-cu12
-
nvidia-nvfatbin-cu12
-
nvidia-nvjitlink-cu12
-
nvidia-nvjpeg-cu12
-
nvidia-nvml-dev-cu12
-
nvidia-nvtx-cu12
These metapackages install the following packages:
-
nvidia-cublas-cu129
-
nvidia-cuda-cccl-cu129
-
nvidia-cuda-cupti-cu129
-
nvidia-cuda-nvcc-cu129
-
nvidia-cuda-nvrtc-cu129
-
nvidia-cuda-opencl-cu129
-
nvidia-cuda-runtime-cu129
-
nvidia-cuda-sanitizer-api-cu129
-
nvidia-cufft-cu129
-
nvidia-curand-cu129
-
nvidia-cusolver-cu129
-
nvidia-cusparse-cu129
-
nvidia-npp-cu129
-
nvidia-nvfatbin-cu129
-
nvidia-nvjitlink-cu129
-
nvidia-nvjpeg-cu129
-
nvidia-nvml-dev-cu129
-
nvidia-nvtx-cu129
4. Compiling CUDA Programs
The project files in the CUDA Samples have been designed to provide simple, one-click builds of the programs that include all source code. To build the Windows projects (for release or debug mode), use the provided *.sln
solution files for Microsoft Visual Studio 2015 (deprecated in CUDA 11.1), 2017 (deprecated in 12.5), 2019, or 2022. You can use either the solution files located in each of the examples directories in https://github.com/nvidia/cuda-samples
4.1. Compiling Sample Projects
The bandwidthTest
project is a good sample project to build and run. It is located in https://github.com/NVIDIA/cuda-samples/tree/master/Samples/1_Utilities/bandwidthTest.
If you elected to use the default installation location, the output is placed in CUDA Samples\v12.9\bin\win64\Release
. Build the program using the appropriate solution file and run the executable. If all works correctly, the output should be similar to Figure 2.
4.2. Sample Projects
The sample projects come in two configurations: debug and release (where release contains no debugging information) and different Visual Studio projects.
A few of the example projects require some additional setup.
These sample projects also make use of the $CUDA_PATH
environment variable to locate where the CUDA Toolkit and the associated .props
files are.
The environment variable is set automatically using the Build Customization CUDA 12.9.props
file, and is installed automatically as part of the CUDA Toolkit installation process.
Table 3 CUDA Visual Studio .props locations
Visual Studio |
CUDA 12.9 .props file Install Directory |
---|---|
Visual Studio 2019 |
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\VC\v160\BuildCustomizations |
Visual Studio 2022 |
C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\VC\v170\BuildCustomizations |
You can reference this CUDA 12.9.props
file when building your own CUDA applications.
4.3. Build Customizations for New Projects
When creating a new CUDA application, the Visual Studio project file must be configured to include CUDA build customizations. To accomplish this, click File-> New | Project… NVIDIA-> CUDA->, then select a template for your CUDA Toolkit version. For example, selecting the “CUDA 12.9 Runtime” template will configure your project for use with the CUDA 12.9 Toolkit. The new project is technically a C++ project (.vcxproj) that is preconfigured to use NVIDIA’s Build Customizations. All standard capabilities of Visual Studio C++ projects will be available.
To specify a custom CUDA Toolkit location, under CUDA C/C++, select Common, and set the CUDA Toolkit Custom Dir field as desired. Note that the selected toolkit must match the version of the Build Customizations.
Note
A supported version of MSVC must be installed to use this feature.
4.4. Build Customizations for Existing Projects
When adding CUDA acceleration to existing applications, the relevant Visual Studio project files must be updated to include CUDA build customizations. This can be done using one of the following two methods:
-
Open the Visual Studio project, right click on the project name, and select Build Dependencies > Build Customizations…, then select the CUDA Toolkit version you would like to target.
-
Alternatively, you can configure your project always to build with the most recently installed version of the CUDA Toolkit. First add a CUDA build customization to your project as above. Then, right click on the project name and select Properties. Under CUDA C/C++, select Common, and set the CUDA Toolkit Custom Dir field to
$(CUDA_PATH)
. Note that the$(CUDA_PATH)
environment variable is set by the installer.
While Option 2 will allow your project to automatically use any new CUDA Toolkit version you may install in the future, selecting the toolkit version explicitly as in Option 1 is often better in practice, because if there are new CUDA configuration options added to the build customization rules accompanying the newer toolkit, you would not see those new options using Option 2.
If you use the $(CUDA_PATH)
environment variable to target a version of the CUDA Toolkit for building, and you perform an installation or uninstallation of any version of the CUDA Toolkit, you should validate that the $(CUDA_PATH)
environment variable points to the correct installation directory of the CUDA Toolkit for your purposes. You can access the value of the $(CUDA_PATH)
environment variable via the following steps:
-
Open a run window from the Start Menu.
-
Run:
-
Select the Advanced tab at the top of the window.
-
Click Environment Variables at the bottom of the window.
Files which contain CUDA code must be marked as a CUDA C/C++
file. This can done when adding the file by right clicking the project you wish to add the file to, selecting Add New Item, selecting NVIDIA CUDA 12.9\CodeCUDA C/C++ File, and then selecting the file you wish to add.
For advanced users, if you wish to try building your project against a newer CUDA Toolkit without making changes to any of your project files, go to the Visual Studio command prompt, change the current directory to the location of your project, and execute a command such as the following:
msbuild <projectname.extension> /t:Rebuild /p:CudaToolkitDir="drive:/path/to/new/toolkit/"
5. Additional Considerations
Now that you have CUDA-capable hardware and the NVIDIA CUDA Toolkit installed, you can examine and enjoy the numerous included programs. To begin using CUDA to accelerate the performance of your own applications, consult the CUDA C Programming Guide, located in the CUDA Toolkit documentation directory.
A number of helpful development tools are included in the CUDA Toolkit or are available for download from the NVIDIA Developer Zone to assist you as you develop your CUDA programs, such as NVIDIA® Nsight™ Visual Studio Edition, and NVIDIA Visual Profiler.
For technical support on programming questions, consult and participate in the developer forums by clicking here.
6. Notices
6.1. Notice
This document is provided for information purposes only and shall not be regarded as a warranty of a certain functionality, condition, or quality of a product. NVIDIA Corporation (“NVIDIA”) makes no representations or warranties, expressed or implied, as to the accuracy or completeness of the information contained in this document and assumes no responsibility for any errors contained herein. NVIDIA shall have no liability for the consequences or use of such information or for any infringement of patents or other rights of third parties that may result from its use. This document is not a commitment to develop, release, or deliver any Material (defined below), code, or functionality.
NVIDIA reserves the right to make corrections, modifications, enhancements, improvements, and any other changes to this document, at any time without notice.
Customer should obtain the latest relevant information before placing orders and should verify that such information is current and complete.
NVIDIA products are sold subject to the NVIDIA standard terms and conditions of sale supplied at the time of order acknowledgement, unless otherwise agreed in an individual sales agreement signed by authorized representatives of NVIDIA and customer (“Terms of Sale”). NVIDIA hereby expressly objects to applying any customer general terms and conditions with regards to the purchase of the NVIDIA product referenced in this document. No contractual obligations are formed either directly or indirectly by this document.
NVIDIA products are not designed, authorized, or warranted to be suitable for use in medical, military, aircraft, space, or life support equipment, nor in applications where failure or malfunction of the NVIDIA product can reasonably be expected to result in personal injury, death, or property or environmental damage. NVIDIA accepts no liability for inclusion and/or use of NVIDIA products in such equipment or applications and therefore such inclusion and/or use is at customer’s own risk.
NVIDIA makes no representation or warranty that products based on this document will be suitable for any specified use. Testing of all parameters of each product is not necessarily performed by NVIDIA. It is customer’s sole responsibility to evaluate and determine the applicability of any information contained in this document, ensure the product is suitable and fit for the application planned by customer, and perform the necessary testing for the application in order to avoid a default of the application or the product. Weaknesses in customer’s product designs may affect the quality and reliability of the NVIDIA product and may result in additional or different conditions and/or requirements beyond those contained in this document. NVIDIA accepts no liability related to any default, damage, costs, or problem which may be based on or attributable to: (i) the use of the NVIDIA product in any manner that is contrary to this document or (ii) customer product designs.
No license, either expressed or implied, is granted under any NVIDIA patent right, copyright, or other NVIDIA intellectual property right under this document. Information published by NVIDIA regarding third-party products or services does not constitute a license from NVIDIA to use such products or services or a warranty or endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectual property rights of the third party, or a license from NVIDIA under the patents or other intellectual property rights of NVIDIA.
Reproduction of information in this document is permissible only if approved in advance by NVIDIA in writing, reproduced without alteration and in full compliance with all applicable export laws and regulations, and accompanied by all associated conditions, limitations, and notices.
THIS DOCUMENT AND ALL NVIDIA DESIGN SPECIFICATIONS, REFERENCE BOARDS, FILES, DRAWINGS, DIAGNOSTICS, LISTS, AND OTHER DOCUMENTS (TOGETHER AND SEPARATELY, “MATERIALS”) ARE BEING PROVIDED “AS IS.” NVIDIA MAKES NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL NVIDIA BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, PUNITIVE, OR CONSEQUENTIAL DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF ANY USE OF THIS DOCUMENT, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Notwithstanding any damages that customer might incur for any reason whatsoever, NVIDIA’s aggregate and cumulative liability towards customer for the products described herein shall be limited in accordance with the Terms of Sale for the product.
6.2. OpenCL
OpenCL is a trademark of Apple Inc. used under license to the Khronos Group Inc.
6.3. Trademarks
NVIDIA and the NVIDIA logo are trademarks or registered trademarks of NVIDIA Corporation in the U.S. and other countries. Other company and product names may be trademarks of the respective companies with which they are associated.
CUDA Quick Start Guide
Minimal first-steps instructions to get CUDA running on a standard system.
This guide covers the basic instructions needed to install CUDA and verify that a CUDA application can run on each supported platform.
These instructions are intended to be used on a clean installation of a supported platform. For questions which are not answered in this document, please refer to the Windows Installation Guide and Linux Installation Guide.
The CUDA installation packages can be found on the CUDA Downloads Page.
2. Windows
When installing CUDA on Windows, you can choose between the Network Installer and the Local Installer. The Network Installer allows you to download only the files you need. The Local Installer is a stand-alone installer with a large initial download. For more details, refer to the Windows Installation Guide.
2.1. Network Installer
Perform the following steps to install CUDA and verify the installation.
-
Launch the downloaded installer package.
-
Read and accept the EULA.
-
Select next to download and install all components.
-
Once the download completes, the installation will begin automatically.
-
Once the installation completes, click “next” to acknowledge the Nsight Visual Studio Edition installation summary.
-
Click close to close the installer.
-
Navigate to the Samples’
nbody
directory in https://github.com/NVIDIA/cuda-samples/tree/master/Samples/5_Domain_Specific/nbody. -
Open the
nbody
Visual Studio solution file for the version of Visual Studio you have installed, for example,nbody_vs2019.sln
. -
Open the Build menu within Visual Studio and click Build Solution.
-
Navigate to the CUDA Samples build directory and run the nbody sample.
Note
Run samples by navigating to the executable’s location, otherwise it will fail to locate dependent resources.
2.2. Local Installer
Perform the following steps to install CUDA and verify the installation.
-
Launch the downloaded installer package.
-
Read and accept the EULA.
-
Select next to install all components.
-
Once the installation completes, click next to acknowledge the Nsight Visual Studio Edition installation summary.
-
Click close to close the installer.
-
Navigate to the Samples’
nbody
directory in https://github.com/NVIDIA/cuda-samples/tree/master/Samples/5_Domain_Specific/nbody. -
Open the nbody Visual Studio solution file for the version of Visual Studio you have installed.
-
Open the Build menu within Visual Studio and click Build Solution.
-
Navigate to the CUDA Samples build directory and run the nbody sample.
Note
Run samples by navigating to the executable’s location, otherwise it will fail to locate dependent resources.
2.3. Pip Wheels — Windows
NVIDIA provides Python Wheels for installing CUDA through pip, primarily for using CUDA with Python. These packages are intended for runtime use and do not currently include developer tools (these can be installed separately).
Please note that with this installation method, CUDA installation environment is managed via pip and additional care must be taken to set up your host environment to use CUDA outside the pip environment.
Prerequisites
To install Wheels, you must first install the nvidia-pyindex
package, which is required in order to set up your pip installation to fetch additional Python modules from the NVIDIA NGC PyPI repo. If your pip and setuptools Python modules are not up-to-date, then use the following command to upgrade these Python modules. If these Python modules are out-of-date then the commands which follow later in this section may fail.
py -m pip install --upgrade setuptools pip wheel
You should now be able to install the nvidia-pyindex
module.
py -m pip install nvidia-pyindex
If your project is using a requirements.txt
file, then you can add the following line to your requirements.txt
file as an alternative to installing the nvidia-pyindex
package:
--extra-index-url https://pypi.ngc.nvidia.com
Procedure
Install the CUDA runtime package:
py -m pip install nvidia-cuda-runtime-cu12
Optionally, install additional packages as listed below using the following command:
py -m pip install nvidia-<library>
Metapackages
The following metapackages will install the latest version of the named component on Windows for the indicated CUDA version. “cu12” should be read as “cuda12”.
-
nvidia-cuda-runtime-cu12
-
nvidia-cuda-cupti-cu12
-
nvidia-cuda-nvcc-cu12
-
nvidia-nvml-dev-cu12
-
nvidia-cuda-nvrtc-cu12
-
nvidia-nvtx-cu12
-
nvidia-cuda-sanitizer-api-cu12
-
nvidia-cublas-cu12
-
nvidia-cufft-cu12
-
nvidia-curand-cu12
-
nvidia-cusolver-cu12
-
nvidia-cusparse-cu12
-
nvidia-npp-cu12
-
nvidia-nvjpeg-cu12
These metapackages install the following packages:
-
nvidia-nvml-dev-cu126
-
nvidia-cuda-nvcc-cu126
-
nvidia-cuda-runtime-cu126
-
nvidia-cuda-cupti-cu126
-
nvidia-cublas-cu126
-
nvidia-cuda-sanitizer-api-cu126
-
nvidia-nvtx-cu126
-
nvidia-cuda-nvrtc-cu126
-
nvidia-npp-cu126
-
nvidia-cusparse-cu126
-
nvidia-cusolver-cu126
-
nvidia-curand-cu126
-
nvidia-cufft-cu126
-
nvidia-nvjpeg-cu126
2.4. Conda
The Conda packages are available at https://anaconda.org/nvidia.
Installation
To perform a basic install of all CUDA Toolkit components using Conda, run the following command:
conda install cuda -c nvidia
Uninstallation
To uninstall the CUDA Toolkit using Conda, run the following command:
3. Linux
CUDA on Linux can be installed using an RPM, Debian, Runfile, or Conda package, depending on the platform being installed on.
3.1. Linux x86_64
For development on the x86_64 architecture. In some cases, x86_64 systems may act as host platforms targeting other architectures. See the Linux Installation Guide for more details.
3.1.1. Redhat / CentOS
When installing CUDA on Redhat or CentOS, you can choose between the Runfile Installer and the RPM Installer. The Runfile Installer is only available as a Local Installer. The RPM Installer is available as both a Local Installer and a Network Installer. The Network Installer allows you to download only the files you need. The Local Installer is a stand-alone installer with a large initial download. In the case of the RPM installers, the instructions for the Local and Network variants are the same. For more details, refer to the Linux Installation Guide.
3.1.1.1. RPM Installer
Perform the following steps to install CUDA and verify the installation.
-
Install EPEL to satisfy the DKMS dependency by following the instructions at EPEL’s website.
-
Enable optional repos:
On RHEL 8 Linux only, execute the following steps to enable optional repositories.
-
On x86_64 workstation:
subscription-manager repos --enable=rhel-8-for-x86_64-appstream-rpms subscription-manager repos --enable=rhel-8-for-x86_64-baseos-rpms subscription-manager repos --enable=codeready-builder-for-rhel-8-x86_64-rpms
-
-
Install the repository meta-data, clean the yum cache, and install CUDA:
sudo rpm --install cuda-repo-<distro>-<version>.<architecture>.rpm sudo rpm --erase gpg-pubkey-7fa2af80* sudo yum clean expire-cache sudo yum install cuda
-
Reboot the system to load the NVIDIA drivers:
-
Set up the development environment by modifying the
PATH
andLD_LIBRARY_PATH
variables:export PATH=/usr/local/cuda-12.8/bin${PATH:+:${PATH}} export LD_LIBRARY_PATH=/usr/local/cuda-12.8/lib64\ ${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
-
Install a writable copy of the samples from https://github.com/nvidia/cuda-samples, then build and run the nbody sample using the Linux instructions in https://github.com/NVIDIA/cuda-samples/tree/master/Samples/5_Domain_Specific/nbody.
Note
Run samples by navigating to the executable’s location, otherwise it will fail to locate dependent resources.
3.1.1.2. Runfile Installer
Perform the following steps to install CUDA and verify the installation.
-
Disable the Nouveau drivers:
-
Create a file at
/etc/modprobe.d/blacklist-nouveau.conf
with the following contents:blacklist nouveau options nouveau modeset=0
-
Regenerate the kernel initramfs:
-
-
Reboot into runlevel 3 by temporarily adding the number “3” and the word “nomodeset” to the end of the system’s kernel boot parameters.
-
Run the installer silently to install with the default selections (implies acceptance of the EULA):
sudo sh cuda_<version>_linux.run --silent
-
Create an xorg.conf file to use the NVIDIA GPU for display:
-
Reboot the system to load the graphical interface:
-
Set up the development environment by modifying the PATH and LD_LIBRARY_PATH variables:
export PATH=/usr/local/cuda-12.8/bin${PATH:+:${PATH}} export LD_LIBRARY_PATH=/usr/local/cuda-12.8/lib64\ ${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
-
Install a writable copy of the samples from https://github.com/nvidia/cuda-samples, then build and run the nbody sample using the Linux instructions in https://github.com/NVIDIA/cuda-samples/tree/master/Samples/5_Domain_Specific/nbody.
Note
Run samples by navigating to the executable’s location, otherwise it will fail to locate dependent resources.
3.1.2. Fedora
When installing CUDA on Fedora, you can choose between the Runfile Installer and the RPM Installer. The Runfile Installer is only available as a Local Installer. The RPM Installer is available as both a Local Installer and a Network Installer. The Network Installer allows you to download only the files you need. The Local Installer is a stand-alone installer with a large initial download. In the case of the RPM installers, the instructions for the Local and Network variants are the same. For more details, refer to the Linux Installation Guide.
3.1.2.1. RPM Installer
Perform the following steps to install CUDA and verify the installation.
-
Install the RPMFusion free repository to satisfy the Akmods dependency:
su -c 'dnf install --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm'
-
Install the repository meta-data, clean the dnf cache, and install CUDA:
sudo rpm --install cuda-repo-<distro>-<version>.<architecture>.rpm sudo rpm --erase gpg-pubkey-7fa2af80* sudo dnf clean expire-cache sudo dnf install cuda
-
Reboot the system to load the NVIDIA drivers:
-
Set up the development environment by modifying the PATH and LD_LIBRARY_PATH variables:
export PATH=/usr/local/cuda-12.8/bin${PATH:+:${PATH}} export LD_LIBRARY_PATH=/usr/local/cuda-12.8/lib64\ ${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
-
Install a writable copy of the samples from https://github.com/nvidia/cuda-samples, then build and run the nbody sample using the Linux instructions in https://github.com/NVIDIA/cuda-samples/tree/master/Samples/5_Domain_Specific/nbody.
Note
Run samples by navigating to the executable’s location, otherwise it will fail to locate dependent resources.
3.1.2.2. Runfile Installer
Perform the following steps to install CUDA and verify the installation.
-
Disable the Nouveau drivers:
-
Create a file at
/usr/lib/modprobe.d/blacklist-nouveau.conf
with the following contents:blacklist nouveau options nouveau modeset=0
-
Regenerate the kernel initramfs:
-
Run the below command:
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
-
Reboot the system:
-
-
Reboot into runlevel 3 by temporarily adding the number “3” and the word “nomodeset” to the end of the system’s kernel boot parameters.
-
Run the installer silently to install with the default selections (implies acceptance of the EULA):
sudo sh cuda_<version>_linux.run --silent
-
Create an xorg.conf file to use the NVIDIA GPU for display:
-
Reboot the system to load the graphical interface.
-
Set up the development environment by modifying the PATH and LD_LIBRARY_PATH variables:
export PATH=/usr/local/cuda-12.8/bin${PATH:+:${PATH}} export LD_LIBRARY_PATH=/usr/local/cuda-12.8/lib64\ ${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
-
Install a writable copy of the samples from https://github.com/nvidia/cuda-samples, then build and run the nbody sample using the Linux instructions in https://github.com/NVIDIA/cuda-samples/tree/master/Samples/5_Domain_Specific/nbody.
Note
Run samples by navigating to the executable’s location, otherwise it will fail to locate dependent resources.
3.1.3. SUSE Linux Enterprise Server
When installing CUDA on SUSE Linux Enterprise Server, you can choose between the Runfile Installer and the RPM Installer. The Runfile Installer is only available as a Local Installer. The RPM Installer is available as both a Local Installer and a Network Installer. The Network Installer allows you to download only the files you need. The Local Installer is a stand-alone installer with a large initial download. In the case of the RPM installers, the instructions for the Local and Network variants are the same. For more details, refer to the Linux Installation Guide.
3.1.3.1. RPM Installer
Perform the following steps to install CUDA and verify the installation.
-
Install the repository meta-data, refresh the Zypper cache, update the GPG key, and install CUDA:
sudo rpm --install cuda-repo-<distro>-<version>.<architecture>.rpm sudo SUSEConnect --product PackageHub/15/x86_64 sudo zypper refresh sudo rpm --erase gpg-pubkey-7fa2af80* sudo dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/$distro/$arch/cuda-$distro.repo sudo zypper install cuda
-
Add the user to the video group:
sudo usermod -a -G video <username>
-
Reboot the system to load the NVIDIA drivers:
-
Set up the development environment by modifying the PATH and LD_LIBRARY_PATH variables:
export PATH=/usr/local/cuda-12.8/bin${PATH:+:${PATH}} export LD_LIBRARY_PATH=/usr/local/cuda-12.8/lib64\ ${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
-
Install a writable copy of the samples from https://github.com/nvidia/cuda-samples, then build and run the vectorAdd sample using the Linux instructions in https://github.com/NVIDIA/cuda-samples/tree/master/Samples/0_Introduction/vectorAdd.
Note
Run samples by navigating to the executable’s location, otherwise it will fail to locate dependent resources.
3.1.3.2. Runfile Installer
Perform the following steps to install CUDA and verify the installation.
-
Reboot into runlevel 3 by temporarily adding the number “3” and the word “nomodeset” to the end of the system’s kernel boot parameters.
-
Run the installer silently to install with the default selections (implies acceptance of the EULA):
sudo sh cuda_<version>_linux.run --silent
-
Create an xorg.conf file to use the NVIDIA GPU for display:
-
Reboot the system to load the graphical interface:
-
Set up the development environment by modifying the PATH and LD_LIBRARY_PATH variables:
export PATH=/usr/local/cuda-12.8/bin${PATH:+:${PATH}} export LD_LIBRARY_PATH=/usr/local/cuda-12.8/lib64\ ${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
-
Install a writable copy of the samples from https://github.com/nvidia/cuda-samples, then build and run the vectorAdd sample using the Linux instructions in https://github.com/NVIDIA/cuda-samples/tree/master/Samples/0_Introduction/vectorAdd.
Note
Run samples by navigating to the executable’s location, otherwise it will fail to locate dependent resources.
3.1.4. OpenSUSE
When installing CUDA on OpenSUSE, you can choose between the Runfile Installer and the RPM Installer. The Runfile Installer is only available as a Local Installer. The RPM Installer is available as both a Local Installer and a Network Installer. The Network Installer allows you to download only the files you need. The Local Installer is a stand-alone installer with a large initial download. In the case of the RPM installers, the instructions for the Local and Network variants are the same. For more details, refer to the Linux Installation Guide.
3.1.4.1. RPM Installer
Perform the following steps to install CUDA and verify the installation.
-
Install the repository meta-data, refresh the Zypper cache, and install CUDA:
sudo rpm --install cuda-repo-<distro>-<version>.<architecture>.rpm sudo rpm --erase gpg-pubkey-7fa2af80* sudo zypper refresh sudo zypper install cuda
-
Add the user to the video group:
sudo usermod -a -G video <username>
-
Reboot the system to load the NVIDIA drivers:
-
Set up the development environment by modifying the PATH and LD_LIBRARY_PATH variables:
export PATH=/usr/local/cuda-12.8/bin${PATH:+:${PATH}} export LD_LIBRARY_PATH=/usr/local/cuda-12.8/lib64\ ${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
-
Install a writable copy of the samples from https://github.com/nvidia/cuda-samples, then build and run the nbody sample using the Linux instructions in https://github.com/NVIDIA/cuda-samples/tree/master/Samples/5_Domain_Specific/nbody.
Note
Run samples by navigating to the executable’s location, otherwise it will fail to locate dependent resources.
3.1.4.2. Runfile Installer
Perform the following steps to install CUDA and verify the installation.
-
Disable the Nouveau drivers:
-
Create a file at
/etc/modprobe.d/blacklist-nouveau.conf
with the following contents:blacklist nouveau options nouveau modeset=0
-
Regenerate the kernel initrd:
-
-
Reboot into runlevel 3 by temporarily adding the number “3” and the word “nomodeset” to the end of the system’s kernel boot parameters.
-
Run the installer silently to install with the default selections (implies acceptance of the EULA):
sudo sh cuda_<version>_linux.run --silent
-
Create an xorg.conf file to use the NVIDIA GPU for display:
-
Reboot the system to load the graphical interface:
-
Set up the development environment by modifying the PATH and LD_LIBRARY_PATH variables:
export PATH=/usr/local/cuda-12.8/bin${PATH:+:${PATH}} export LD_LIBRARY_PATH=/usr/local/cuda-12.8/lib64\ ${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
-
Install a writable copy of the samples from https://github.com/nvidia/cuda-samples, then build and run the nbody sample using the Linux instructions in https://github.com/NVIDIA/cuda-samples/tree/master/Samples/5_Domain_Specific/nbody.
Note
Run samples by navigating to the executable’s location, otherwise it will fail to locate dependent resources.
3.1.5. Amazon Linux 2023
3.1.5.1. Prepare Amazon Linux 2023
-
Perform the pre-installation actions.
-
The kernel headers and development packages for the currently running kernel can be installed with:
sudo dnf install kernel-devel-$(uname -r) kernel-headers-$(uname -r) kernel-modules-extra-$(uname -r)
-
Choose an installation method: local repo or network repo.
3.1.5.2. Local Repo Installation for Amazon Linux
-
Install local repository on file system:
sudo rpm --install cuda-repo-amzn2023-X-Y-local-<version>*.x86_64.rpm
3.1.5.3. Network Repo Installation for Amazon Linux
-
Enable the network repository and clean the DN cache:
sudo dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/amzn2023/x86_64/cuda-amzn2023.repo sudo dnf clean expire-cache
3.1.5.4. Common Installation Instructions for Amazon Linux
These instructions apply to both local and network installation for Amazon Linux.
-
Install CUDA SDK:
sudo dnf module install nvidia-driver:latest-dkms sudo dnf install cuda-toolkit
-
Install GPUDirect Filesystem:
sudo dnf install nvidia-gds
-
Add libcuda.so symbolic link, if necessary:
The
libcuda.so
library is installed in the/usr/lib{,64}/nvidia
directory. For pre-existing projects which uselibcuda.so
, it may be useful to add a symbolic link fromlibcuda.so
in the/usr/lib{,64}
directory. -
Reboot the system:
-
Perform the post-installation actions.
3.1.6. Pip Wheels — Linux
NVIDIA provides Python Wheels for installing CUDA through pip, primarily for using CUDA with Python. These packages are intended for runtime use and do not currently include developer tools (these can be installed separately).
Please note that with this installation method, CUDA installation environment is managed via pip and additional care must be taken to set up your host environment to use CUDA outside the pip environment.
Prerequisites
To install Wheels, you must first install the nvidia-pyindex
package, which is required in order to set up your pip installation to fetch additional Python modules from the NVIDIA NGC PyPI repo. If your pip and setuptools Python modules are not up-to-date, then use the following command to upgrade these Python modules. If these Python modules are out-of-date then the commands which follow later in this section may fail.
python3 -m pip install --upgrade setuptools pip wheel
You should now be able to install the nvidia-pyindex
module.
python3 -m pip install nvidia-pyindex
If your project is using a requirements.txt
file, then you can add the following line to your requirements.txt
file as an alternative to installing the nvidia-pyindex
package:
--extra-index-url https://pypi.ngc.nvidia.com
Procedure
Install the CUDA runtime package:
python3 -m pip install nvidia-cuda-runtime-cu12
Optionally, install additional packages as listed below using the following command:
python3 -m pip install nvidia-<library>
Metapackages
The following metapackages will install the latest version of the named component on Linux for the indicated CUDA version. “cu12” should be read as “cuda12”.
-
nvidia-cuda-runtime-cu12
-
nvidia-cuda-cupti-cu12
-
nvidia-cuda-nvcc-cu12
-
nvidia-nvml-dev-cu12
-
nvidia-cuda-nvrtc-cu12
-
nvidia-nvtx-cu12
-
nvidia-cuda-sanitizer-api-cu12
-
nvidia-cublas-cu12
-
nvidia-cufft-cu12
-
nvidia-curand-cu12
-
nvidia-cusolver-cu12
-
nvidia-cusparse-cu12
-
nvidia-npp-cu12
-
nvidia-nvjpeg-cu12
-
nvidia-opencl-cu12
-
nvidia-nvjitlink-cu12
These metapackages install the following packages:
-
nvidia-nvml-dev-cu127
-
nvidia-cuda-nvcc-cu127
-
nvidia-cuda-runtime-cu127
-
nvidia-cuda-cupti-cu127
-
nvidia-cublas-cu127
-
nvidia-cuda-sanitizer-api-cu127
-
nvidia-nvtx-cu127
-
nvidia-cuda-nvrtc-cu127
-
nvidia-npp-cu127
-
nvidia-cusparse-cu127
-
nvidia-cusolver-cu127
-
nvidia-curand-cu127
-
nvidia-cufft-cu127
-
nvidia-nvjpeg-cu127
-
nvidia-opencl-cu127
-
nvidia-nvjitlink-cu127
3.1.7. Conda
The Conda packages are available at https://anaconda.org/nvidia.
Installation
To perform a basic install of all CUDA Toolkit components using Conda, run the following command:
conda install cuda -c nvidia
Uninstallation
To uninstall the CUDA Toolkit using Conda, run the following command:
3.1.8. WSL
These instructions must be used if you are installing in a WSL environment. Do not use the Ubuntu instructions in this case.
-
Install repository meta-data
sudo dpkg -i cuda-repo-<distro>_<version>_<architecture>.deb
-
Update the CUDA public GPG key
sudo apt-key del 7fa2af80
When installing using the local repo:
sudo cp /var/cuda-repo-ubuntu2004-12-0-local/cuda-*-keyring.gpg /usr/share/keyrings/
When installing using the network repo:
wget https://developer.download.nvidia.com/compute/cuda/repos/<distro>/<arch>/cuda-keyring_1.1-1_all.deb sudo dpkg -i cuda-keyring_1.1-1_all.deb
Pin file to prioritize CUDA repository:
wget https://developer.download.nvidia.com/compute/cuda/repos/<distro>/<architecture>/cuda-<distro>.pin sudo mv cuda-<distro>.pin /etc/apt/preferences.d/cuda-repository-pin-600
-
Update the Apt repository cache and install CUDA
sudo apt-get update sudo apt-get install cuda
3.1.9. Ubuntu
When installing CUDA on Ubuntu, you can choose between the Runfile Installer and the Debian Installer. The Runfile Installer is only available as a Local Installer. The Debian Installer is available as both a Local Installer and a Network Installer. The Network Installer allows you to download only the files you need. The Local Installer is a stand-alone installer with a large initial download. In the case of the Debian installers, the instructions for the Local and Network variants are the same. For more details, refer to the Linux Installation Guide.
3.1.9.1. Debian Installer
Perform the following steps to install CUDA and verify the installation.
-
Install the repository meta-data, update the GPG key, update the apt-get cache, and install CUDA:
sudo dpkg --install cuda-repo-<distro>-<version>.<architecture>.deb sudo apt-key del 7fa2af80 wget https://developer.download.nvidia.com/compute/cuda/repos/<distro>/<arch>/cuda-keyring_1.1-1_all.deb sudo dpkg -i cuda-keyring_1.1-1_all.deb sudo add-apt-repository contrib sudo apt-get update sudo apt-get -y install cuda
-
Reboot the system to load the NVIDIA drivers:
-
Set up the development environment by modifying the PATH and LD_LIBRARY_PATH variables:
export PATH=/usr/local/cuda-12.8/bin${PATH:+:${PATH}} export LD_LIBRARY_PATH=/usr/local/cuda-12.8/lib64\ ${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
-
Install a writable copy of the samples from https://github.com/nvidia/cuda-samples, then build and run the nbody sample using the Linux instructions in https://github.com/NVIDIA/cuda-samples/tree/master/Samples/5_Domain_Specific/nbody.
Note
Run samples by navigating to the executable’s location, otherwise it will fail to locate dependent resources.
3.1.9.2. Runfile Installer
Perform the following steps to install CUDA and verify the installation.
-
Disable the Nouveau drivers:
-
Create a file at
/etc/modprobe.d/blacklist-nouveau.conf
with the following contents:blacklist nouveau options nouveau modeset=0
-
Regenerate the kernel initramfs:
-
-
Reboot into runlevel 3 by temporarily adding the number “3” and the word “nomodeset” to the end of the system’s kernel boot parameters.
-
Run the installer silently to install with the default selections (implies acceptance of the EULA):
sudo sh cuda_<version>_linux.run --silent
-
Create an
xorg.conf
file to use the NVIDIA GPU for display: -
Reboot the system to load the graphical interface:
-
Set up the development environment by modifying the PATH and LD_LIBRARY_PATH variables:
export PATH=/usr/local/cuda-12.8/bin${PATH:+:${PATH}} export LD_LIBRARY_PATH=/usr/local/cuda-12.8/lib64\ ${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
-
Install a writable copy of the samples from https://github.com/nvidia/cuda-samples, then build and run the nbody sample using the Linux instructions in https://github.com/NVIDIA/cuda-samples/tree/master/Samples/5_Domain_Specific/nbody.
Note
Run samples by navigating to the executable’s location, otherwise it will fail to locate dependent resources.
3.1.10. Debian
When installing CUDA on Debian 10, you can choose between the Runfile Installer and the Debian Installer. The Runfile Installer is only available as a Local Installer. The Debian Installer is available as both a Local Installer and a Network Installer. The Network Installer allows you to download only the files you need. The Local Installer is a stand-alone installer with a large initial download. For more details, refer to the Linux Installation Guide.
3.1.10.1. Debian Installer
Perform the following steps to install CUDA and verify the installation.
-
Install the repository meta-data, remove old GPG key, install GPG key, update the apt-get cache, and install CUDA:
sudo dpkg -i cuda-repo-<distro>_<version>_<architecture>.deb sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/debian10/x86_64/7fa2af80.pub sudo apt-key del 7fa2af80 wget https://developer.download.nvidia.com/compute/cuda/repos/<distro>/<arch>/cuda-keyring_1.1-1_all.deb sudo dpkg -i cuda-keyring_1.1-1_all.deb sudo add-apt-repository contrib sudo apt-get update sudo apt-get -y install cuda
-
Reboot the system to load the NVIDIA drivers:
-
Set up the development environment by modifying the PATH and LD_LIBRARY_PATH variables:
export PATH=/usr/local/cuda-12.8/bin${PATH:+:${PATH}} export LD_LIBRARY_PATH=/usr/local/cuda-12.8/lib64\ ${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
-
Install a writable copy of the samples from https://github.com/nvidia/cuda-samples, then build and run the nbody sample using the Linux instructions in https://github.com/NVIDIA/cuda-samples/tree/master/Samples/5_Domain_Specific/nbody.
Note
Run samples by navigating to the executable’s location, otherwise it will fail to locate dependent resources.
3.1.10.2. Runfile Installer
Perform the following steps to install CUDA and verify the installation.
-
Disable the Nouveau drivers:
-
Create a file at
/etc/modprobe.d/blacklist-nouveau.conf
with the following contents:blacklist nouveau options nouveau modeset=0
-
Regenerate the kernel initramfs:
-
-
Reboot into runlevel 3 by temporarily adding the number “3” and the word “nomodeset” to the end of the system’s kernel boot parameters.
-
Run the installer silently to install with the default selections (implies acceptance of the EULA):
sudo sh cuda_<version>_linux.run --silent
-
Create an xorg.conf file to use the NVIDIA GPU for display:
-
Reboot the system to load the graphical interface:
-
Set up the development environment by modifying the PATH and LD_LIBRARY_PATH variables:
export PATH=/usr/local/cuda-12.8/bin${PATH:+:${PATH}} export LD_LIBRARY_PATH=/usr/local/cuda-12.8/lib64\ ${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
-
Install a writable copy of the samples from https://github.com/nvidia/cuda-samples, then build and run the nbody sample using the Linux instructions in https://github.com/NVIDIA/cuda-samples/tree/master/Samples/5_Domain_Specific/nbody.
Note
Run samples by navigating to the executable’s location, otherwise it will fail to locate dependent resources.
4. Notices
4.1. Notice
This document is provided for information purposes only and shall not be regarded as a warranty of a certain functionality, condition, or quality of a product. NVIDIA Corporation (“NVIDIA”) makes no representations or warranties, expressed or implied, as to the accuracy or completeness of the information contained in this document and assumes no responsibility for any errors contained herein. NVIDIA shall have no liability for the consequences or use of such information or for any infringement of patents or other rights of third parties that may result from its use. This document is not a commitment to develop, release, or deliver any Material (defined below), code, or functionality.
NVIDIA reserves the right to make corrections, modifications, enhancements, improvements, and any other changes to this document, at any time without notice.
Customer should obtain the latest relevant information before placing orders and should verify that such information is current and complete.
NVIDIA products are sold subject to the NVIDIA standard terms and conditions of sale supplied at the time of order acknowledgement, unless otherwise agreed in an individual sales agreement signed by authorized representatives of NVIDIA and customer (“Terms of Sale”). NVIDIA hereby expressly objects to applying any customer general terms and conditions with regards to the purchase of the NVIDIA product referenced in this document. No contractual obligations are formed either directly or indirectly by this document.
NVIDIA products are not designed, authorized, or warranted to be suitable for use in medical, military, aircraft, space, or life support equipment, nor in applications where failure or malfunction of the NVIDIA product can reasonably be expected to result in personal injury, death, or property or environmental damage. NVIDIA accepts no liability for inclusion and/or use of NVIDIA products in such equipment or applications and therefore such inclusion and/or use is at customer’s own risk.
NVIDIA makes no representation or warranty that products based on this document will be suitable for any specified use. Testing of all parameters of each product is not necessarily performed by NVIDIA. It is customer’s sole responsibility to evaluate and determine the applicability of any information contained in this document, ensure the product is suitable and fit for the application planned by customer, and perform the necessary testing for the application in order to avoid a default of the application or the product. Weaknesses in customer’s product designs may affect the quality and reliability of the NVIDIA product and may result in additional or different conditions and/or requirements beyond those contained in this document. NVIDIA accepts no liability related to any default, damage, costs, or problem which may be based on or attributable to: (i) the use of the NVIDIA product in any manner that is contrary to this document or (ii) customer product designs.
No license, either expressed or implied, is granted under any NVIDIA patent right, copyright, or other NVIDIA intellectual property right under this document. Information published by NVIDIA regarding third-party products or services does not constitute a license from NVIDIA to use such products or services or a warranty or endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectual property rights of the third party, or a license from NVIDIA under the patents or other intellectual property rights of NVIDIA.
Reproduction of information in this document is permissible only if approved in advance by NVIDIA in writing, reproduced without alteration and in full compliance with all applicable export laws and regulations, and accompanied by all associated conditions, limitations, and notices.
THIS DOCUMENT AND ALL NVIDIA DESIGN SPECIFICATIONS, REFERENCE BOARDS, FILES, DRAWINGS, DIAGNOSTICS, LISTS, AND OTHER DOCUMENTS (TOGETHER AND SEPARATELY, “MATERIALS”) ARE BEING PROVIDED “AS IS.” NVIDIA MAKES NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL NVIDIA BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, PUNITIVE, OR CONSEQUENTIAL DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF ANY USE OF THIS DOCUMENT, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Notwithstanding any damages that customer might incur for any reason whatsoever, NVIDIA’s aggregate and cumulative liability towards customer for the products described herein shall be limited in accordance with the Terms of Sale for the product.
4.2. OpenCL
OpenCL is a trademark of Apple Inc. used under license to the Khronos Group Inc.
4.3. Trademarks
NVIDIA and the NVIDIA logo are trademarks or registered trademarks of NVIDIA Corporation in the U.S. and other countries. Other company and product names may be trademarks of the respective companies with which they are associated.
How to Install CUDA on Windows 11
CUDA (Compute Unified Device Architecture) is a parallel computing platform and application programming interface (API) model created by NVIDIA. It allows developers to utilize the power of NVIDIA GPUs for general-purpose processing—often referred to as GPGPU (General-Purpose computation on Graphics Processing Units). CUDA streams are widely used in machine learning, scientific computing, and graphics rendering. If you’re looking to harness the capability of your NVIDIA GPU on Windows 11, this guide will help you through the installation process step-by-step.
1. System Requirements
Before beginning the installation process, ensure that your Windows 11 system meets the following requirements:
- Supported NVIDIA GPU: Visit the official NVIDIA CUDA GPUs list to check if your graphics card is compatible.
- NVIDIA Drivers: You must have the latest NVIDIA drivers installed. This can typically be done through the GeForce Experience application or by downloading the latest drivers directly from the NVIDIA website.
- Windows 10 or 11: CUDA installation is supported on the latest versions of Windows.
- Visual Studio: If you plan to develop CUDA applications, installing Visual Studio (Community, Professional, or Enterprise) is highly recommended as it provides robust development tools.
2. Preparing for Installation
Before installing CUDA, you should prepare your system and download the necessary software.
- Update Windows: Ensure that Windows 11 is fully updated through Windows Update.
- Install the Latest NVIDIA Driver:
- Go to the NVIDIA Driver Download page.
- Select your graphics card model and download the latest driver.
- Once downloaded, run the installer and follow the on-screen instructions.
- Download CUDA Toolkit:
- Visit the CUDA Toolkit Download page.
- Choose «Windows» as your operating system and select «x86_64» for your architecture.
- Select the installer type (typically, the local installer is recommended).
- Click «Download» to save the installer to your computer.
3. Installing CUDA Toolkit
Once you have everything prepared, you can begin the installation of the CUDA Toolkit.
-
Run the CUDA Installer:
- Navigate to the directory where you downloaded the CUDA Toolkit.
- Double-click the installer executable (e.g.,
cuda_11.6.0_511.79_win.exe
).
-
Select Installation Options:
- When prompted, choose the installation options. You can opt for «Express» (recommended for most users) or «Custom» (if you need specific versions or components).
- If you select «Custom», be sure to select the components you require, such as:
- CUDA Toolkit
- CUDA Samples
- NVIDIA Driver (if you haven’t installed it earlier)
-
Complete Installation:
- Follow through the prompts. You may need to accept the End User License Agreement (EULA).
- Once the installation is complete, you might be prompted to reboot your system. It’s a good idea to do so to ensure all changes take effect.
4. Verifying CUDA Installation
After installation, it’s important to verify that CUDA has been installed correctly.
-
Open Command Prompt:
- Press
Windows + R
, typecmd
, and hitEnter
.
- Press
-
Check CUDA Version:
- In the Command Prompt, type the following command and press
Enter
:nvcc --version
- This command checks the version of the NVIDIA CUDA compiler driver. You should see output with the version number of CUDA installed.
- In the Command Prompt, type the following command and press
-
Run Sample Programs:
- If you opted to install the CUDA Samples, navigate to the installation directory (commonly
C:Program FilesNVIDIA GPU Computing ToolkitCUDAv11.6samples
). - Open the Command Prompt again and navigate to the samples folder:
cd "C:Program FilesNVIDIA GPU Computing ToolkitCUDAv11.6samples"
- Use the following commands to build and run the CUDA samples:
cd 0_Simple mkdir build cd build cmake .. cmake --build .
- After the build completes successfully, run the sample executable (e.g.,
simpleQuadd
orvectorAdd
), and check the output.
- If you opted to install the CUDA Samples, navigate to the installation directory (commonly
5. Setting Environment Variables
For CUDA to work correctly with your applications, you need to set the environment variables.
-
Open Environment Variables:
- Right-click on the Start button and select «System.»
- Click on «Advanced system settings» from the left pane.
- In the System Properties window, click on the «Environment Variables» button.
-
Add CUDA to PATH:
- In the «System variables» section, find the
Path
variable and click «Edit.» - Click «New» and add the following paths (adjust according to your specific version):
C:Program FilesNVIDIA GPU Computing ToolkitCUDAv11.6bin C:Program FilesNVIDIA GPU Computing ToolkitCUDAv11.6libnvvp
- Click «OK» to close all windows.
- In the «System variables» section, find the
-
Set CUDA_HOME Variable (optional but recommended):
- In the Environment Variables window, under «System variables,» click «New.»
- In the «Variable name» field, enter
CUDA_HOME
. - In the «Variable value» field, enter:
C:Program FilesNVIDIA GPU Computing ToolkitCUDAv11.6
- Click «OK» to save the variable.
6. Installing cuDNN (optional)
For many deep learning applications, you’ll also need the cuDNN library, which provides optimized implementations of standard routines such as convolution, pooling, normalization, and activation layers.
-
Create a NVIDIA Developer Account:
- Go to the NVIDIA Developer website and create an account if you don’t have one.
-
Download cuDNN:
- Once logged in, navigate to the cuDNN download section and choose the version that matches your installed CUDA Toolkit.
- Download the cuDNN library for Windows.
-
Install cuDNN:
- After extracting the downloaded cuDNN files, copy the contents from the
bin
,include
, andlib
folders to their corresponding paths in the CUDA Toolkit directory:bin
→C:Program FilesNVIDIA GPU Computing ToolkitCUDAv11.6bin
include
→C:Program FilesNVIDIA GPU Computing ToolkitCUDAv11.6include
lib
→C:Program FilesNVIDIA GPU Computing ToolkitCUDAv11.6libx64
- After extracting the downloaded cuDNN files, copy the contents from the
-
Verify cuDNN Installation:
- You can confirm that cuDNN is working by looking for
cudnn.h
inC:Program FilesNVIDIA GPU Computing ToolkitCUDAv11.6include
andcudnn.lib
inC:Program FilesNVIDIA GPU Computing ToolkitCUDAv11.6libx64
.
- You can confirm that cuDNN is working by looking for
7. Developing Your First CUDA Application
To create and run a simple CUDA application, you may follow these steps:
-
Open Visual Studio:
- Start Visual Studio and create a new C++ project.
-
Set CUDA Project Settings:
- Right-click on the project, go to «Properties.»
- Under Configuration Properties, ensure that:
- C/C++ → General → Additional Include Directories includes the CUDA include path:
C:Program FilesNVIDIA GPU Computing ToolkitCUDAv11.6include
- Linker → General → Additional Library Directories includes:
C:Program FilesNVIDIA GPU Computing ToolkitCUDAv11.6libx64
- C/C++ → General → Additional Include Directories includes the CUDA include path:
-
Add CUDA Code:
-
In your project, add a new
.cu
file (CUDA C++ file) and write a simple CUDA kernel:#include __global__ void vectorAdd(const float* A, const float* B, float* C, int N) { int i = threadIdx.x + blockIdx.x * blockDim.x; if (i < N) { C[i] = A[i] + B[i]; } } int main() { const int N = 1 << 20; // 1 Million elements size_t size = N * sizeof(float); float *A, *B, *C; cudaMallocManaged(&A, size); cudaMallocManaged(&B, size); cudaMallocManaged(&C, size); // Initialize A and B for (int i = 0; i < N; i++) { A[i] = static_cast(i); B[i] = static_cast(i); } // Launch kernel vectorAdd<<>>(A, B, C, N); // Wait for GPU to finish before accessing on host cudaDeviceSynchronize(); // Check for errors for (int i = 0; i < N; i++) { if (C[i] != A[i] + B[i]) { std::cout << "Error: " << C[i] << " != " << A[i] + B[i] << std::endl; return 1; } } std::cout << "Success!" << std::endl; // Free memory cudaFree(A); cudaFree(B); cudaFree(C); return 0; }
-
-
Build and Run the Application:
- Build the project, and if successful, run it. You should see
Success!
printed if everything is set up correctly.
- Build the project, and if successful, run it. You should see
8. Troubleshooting Common Issues
While installing CUDA can be relatively straightforward, you may encounter some issues:
-
Installation Failures: If the installation fails, ensure that:
- All previous versions of the NVIDIA driver and CUDA are completely uninstalled.
- You have sufficient permissions (administrator rights) for the installation process.
-
Compatibility Problems: Always ensure that your GPU supports the version of CUDA you’re trying to install by cross-referencing with official NVIDIA documentation.
-
Environment Variable Issues: If
nvcc --version
does not work, double-check that your environment variables are set correctly and that you’ve restarted your command prompt after making changes. -
Driver Issues: If your CUDA code does not run as expected, ensure that your drivers are up-to-date. If you’ve installed new drivers, restart your PC.
-
Running GPU Programs: Occasionally, programs may fail to detect or utilize the GPU. Make sure that the CUDA application/device is compatible with your graphics card.
Conclusion
Congratulations! You have successfully installed CUDA on your Windows 11 system. You can now leverage the power of your NVIDIA GPU for parallel computing tasks in machine learning and high-performance computing domains. As you experiment and develop CUDA applications, you’ll unlock greater computational capabilities and efficiencies. Always keep your drivers, CUDA Toolkit, and cuDNN updated to take full advantage of the latest features and improvements.
Download CUDA® installer
You can download the CUDA® toolkit for your operating system from the NVIDIA® Developers Portal. We recommend using the local installer type, as it can be faster. The installer is quite large, with a size of about 3 GB. However, each LeaderGPU server has a very fast internet connection, so it doesn’t take a lot of time:
Open downloads in Chrome by pressing the Ctrl + J keyboard shortcut and double-clicking on the downloaded CUDA® toolkit installer:
Run CUDA® installer
Most NVIDIA® packages are self-extracted archives with installers inside. You can select a specific folder or leave the default path, then click OK:
Wait a minute while the archive is being extracted:
The installer will begin. In the first stage, the installer checks your hardware compatibility with the system requirements:
To proceed, you must agree with EULA by clicking AGREE AND CONTINUE button:
Select Express to install all available components and click NEXT:
Some tools integrate with the Visual Studio IDE. If it isn’t installed on the server, the installer will issue a warning. Check the box and click NEXT:
Installation may take a few minutes, which is enough time to pour yourself some coffee:
After installation, you can read the summary and click NEXT:
Finally, you can uncheck boxes (creating shortcut and launch utility) or leave them as they are. Exit the installer by clicking on the CLOSE button:
See also:
- Install NVIDIA® drivers in Windows
- Check NVLink® in Windows
- PyTorch for Windows
The NVIDIA CUDA Toolkit is an essential software platform for anyone looking to unlock the immense parallel processing power of NVIDIA GPUs.
Whether you are a researcher leveraging GPU-acceleration for cutting-edge deep learning or a developer harnessing GPU computing for simulations, 3D rendering, and other computational workloads, installing the CUDA Toolkit is the first step to supercharge your work.
In this comprehensive guide, we will cover everything you need to know to properly install the latest version of the NVIDIA CUDA Toolkit on Linux, Windows and macOS systems.
What is NVIDIA CUDA Toolkit?
The NVIDIA CUDA Toolkit provides a development environment for creating high performance GPU-accelerated applications. It allows developers to harness the parallel processing capabilities of NVIDIA GPUs for significant performance improvements compared to CPU-only workflows.
Here are some of the key components included in the CUDA Toolkit:
- CUDA Driver API and Runtime: This enables direct access to the GPU’s virtual instruction set and parallel computational elements.
- Compilers: NVCC compiler for CUDA C/C++ programming. OpenACC, OpenMP, and MPI support.
- Math Libraries: BLAS, FFT, RNG, and other GPU-accelerated math libraries.
- Development Tools: NVIDIA Nsight IDE, debugger, profiler and more.
- Code Samples and Documentation: Everything you need to start CUDA development.
By providing essential GPU acceleration enablers like the CUDA parallel computing platform and programming model, the CUDA Toolkit empowers developers to solve complex computational challenges faster and more efficiently.
Key Benefits of the CUDA Toolkit
- Achieve massive performance improvements with parallel processing on GPUs.
- Write CUDA C/C++ code for GPU acceleration without specialized skills.
- Port existing C/C++ code to run on GPUs.
- Analyze and optimize CUDA applications for maximal efficiency.
- Develop, debug and profile seamlessly in familiar environments.
Who Should Install the CUDA Toolkit?
The CUDA Toolkit is designed for software developers, researchers and data scientists who want to leverage NVIDIA GPUs for high performance computing and deep learning applications.
Whether you are accelerating a computational fluid dynamics simulation, training neural networks, running molecular dynamics simulations or deploying any other GPU-accelerated workload, installing the CUDA Toolkit is the first step to harness advanced parallel computing capabilities.
Now that you understand the immense value that the CUDA Toolkit delivers, let’s get into the specific steps you need to follow to properly install it on your system.
How to Install NVIDIA CUDA Toolkit?
The CUDA Toolkit is supported on most modern Linux distributions, Windows 7 or later and macOS 10.13 or later. I will cover the detailed instructions for installation on these operating systems.
Linux Installation
Most Linux distributions include CUDA in their package manager repositories. This makes installing the CUDA Toolkit very straightforward.
Here are the steps to install the latest version of the CUDA Toolkit on Linux:
Step 1: Verify System Requirements
- A desktop or workstation with NVIDIA GPU with CUDA compute capability 3.0 or higher.
- 64-bit Linux distribution with a glibc version later than 2.17. Consult the CUDA Installation Guide for specific version requirements.
- gcc compiler and toolchain.
- Up-to-date NVIDIA graphics drivers.
Step 2: Download the CUDA Toolkit
- Go to the CUDA Toolkit download page: https://developer.nvidia.com/cuda-downloads
- Choose the right package for your Linux distribution. For example, Ubuntu 18.04 would require:
cuda-repo-ubuntu1804-10-2-local-10.2.89-440.33.01_1.0-1_amd64.deb
- Download the installer to your machine.
Step 3: Install the CUDA Toolkit
- Open a terminal and navigate to the download directory.
- Install the downloaded package with
sudo dpkg -i [package name]
. - Follow the on-screen prompts. Accept EULA and install the CUDA Toolkit components.
- The installation process will automatically attempt to install the NVIDIA graphics driver if a CUDA compatible version is not already present.
Step 4: Verify the Installation
- To verify that CUDA is installed and working correctly, compile and run a CUDA sample program:
cd /usr/local/cuda/samples/1_Utilities/deviceQuery
make
./deviceQuery
- This runs a small CUDA program to verify CUDA capabilites. If installed correctly, it will show detected NVIDIA GPUs and capabilities.
The CUDA Toolkit is now installed and ready to use! You can start writing your own CUDA programs or porting existing computational workloads to run on NVIDIA GPUs.
Windows Installation
On Windows platforms, the most straightforward method to install the CUDA Toolkit is by using the standalone Windows installer from NVIDIA.
Follow these steps for smooth installation on Windows:
Step 1: Verify System Requirements
- A desktop or notebook PC with NVIDIA GPU with CUDA compute capability 3.0 or higher.
- 64-bit version of Windows 7 or later. Windows 10/11 recommended.
- Visual Studio IDE installed. Visual Studio 2019 recommended.
- Latest NVIDIA graphics driver compatible with CUDA.
Step 2: Download the CUDA Toolkit
- Get the Windows CUDA Toolkit installer from:
https://developer.nvidia.com/cuda-downloads - Choose the
exe
network installer for Windows x86_64. - Download the installer to your machine.
Step 3: Install the CUDA Toolkit
- Double click the downloaded
exe
installer file. - Click through the NVIDIA license agreement. Select accept and continue.
- Select the components to install:
- CUDA Toolkit
- CUDA Samples
- Visual Studio Integration (optional but recommended)
- NVIDIA Display Driver (if compatible version not already installed)
- Click Install to begin the installation process.
Step 4: Verify the Installation
- Launch Visual Studio and create a new CUDA C/C++ project.
- Try compiling and running one of the CUDA samples.
- For example, the
deviceQuery
sample prints information about the CUDA-enabled GPUs on the system.
With the CUDA Toolkit properly installed, you can commence CUDA application development on the Windows platform.
macOS Installation
On macOS, the CUDA Toolkit is provided as a DMG installer image containing the toolkit, samples and necessary drivers.
Follow these instructions to install the CUDA Toolkit on macOS:
Step 1: Verify System Requirements
- Mac with NVIDIA GPU based on:
- Maxwell or newer GPU architecture.
- CUDA compute capability 5.0 and higher.
- macOS High Sierra 10.13 or later.
- Latest matching NVIDIA macOS graphics driver.
Step 2: Download the CUDA Toolkit
- Get the macOS CUDA Toolkit DMG installer from:
https://developer.nvidia.com/cuda-downloads - Choose the macOS installer DMG package.
- Download the installer image.
Step 3: Install the CUDA Toolkit
- Double click the DMG installer package to mount it.
- Double click the mounted volume icon to open it.
- Double click the
CUDA-Install-macOS.pkg
file to launch the installer. - Click continue and accept the license agreement.
- Follow the prompts to install the CUDA Toolkit, Samples and Driver components.
Step 4: Verify the Installation
- Open a terminal and compile and run a CUDA sample like
deviceQuery
:
cd /Developer/NVIDIA/CUDA-X.Y/samples/1_Utilities/deviceQuery
make
./deviceQuery
- This will confirm CUDA is correctly set up if the system’s NVIDIA GPU is detected.
With the CUDA Toolkit installed, your macOS system is now ready for serious GPU computing!
Additional Notes on CUDA Toolkit Installation
Here are some additional pointers to ensure smooth installation and operation of the CUDA Toolkit:
- When installing CUDA on a workstation or server running Linux, it is generally recommended to use the *.run package installer instead of distro-specific packages.
- On Linux/Windows, install the cuDNN libraries after CUDA for GPU acceleration of deep neural networks.
- Setup the PATH and LD_LIBRARY_PATH environment variables to point to the CUDA Toolkit install location.
- For developing CUDA applications, installing a compatible version of the NVIDIA Nsight IDE or Visual Studio IDE is highly recommended.
- When deploying CUDA applications on cloud platforms like AWS EC2 or Azure NV-series VMs, follow NVIDIA’s guides to install CUDA.
- Refer to NVIDIA’s documentation for troubleshooting guidance, advanced installation options, and other details specific to your system configuration.
Learn More and Get Started with CUDA Programming
With the CUDA Toolkit properly installed, an exciting world of GPU-accelerated computing is now open to you.
Some helpful next steps:
- Try out the CUDA Sample programs included in the Toolkit installation.
- Walk through the CUDA Programming Guide for a comprehensive tutorial.
- Refer to the official CUDA Documentation for API references and expert guides.
- Join the CUDA Developer Forums to engage with the CUDA community.
- Stay updated on the NVIDIA Developer Blog covering cutting-edge GPU computing applications.
I hope this detailed guide helped demystify the process for installing the NVIDIA CUDA Toolkit on your system. The remarkable acceleration and performance benefits unlocked by CUDA are now at your fingertips. Happy coding!
FAQ’s
Where is Nvidia CUDA toolkit installed?
The Nvidia CUDA toolkit is typically installed in the /usr/local/cuda directory on Linux, under C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA on Windows, and in /Developer/NVIDIA/CUDA-X.Y on macOS.
Does Nvidia Cuda Toolkit install drivers?
Yes, the Nvidia CUDA toolkit installer can optionally install Nvidia graphics drivers if a compatible version is not already present on the system. It is recommended to install the latest drivers matched with your CUDA version.
How to install CUDA toolkit without Sudo?
To install the CUDA toolkit without Sudo access on Linux, download the runfile installer and execute it with the –tmpdir option pointing to a writable local directory. This will install CUDA toolkit components in your user folder.
Is CUDA and CUDA toolkit the same?
CUDA refers to Nvidia’s parallel computing platform and API. The CUDA toolkit is the software development package from Nvidia that provides libraries, compiler, tools and samples to build CUDA applications.
How do I enable CUDA?
To enable CUDA, install a compatible Nvidia graphics driver, install the CUDA toolkit, configure the PATH and LD_LIBRARY_PATH to include the CUDA install directories, and verify by running CUDA sample programs.
Is CUDA a CPU or GPU?
CUDA is Nvidia’s API and platform to utilize the parallel processing capabilities of Nvidia GPUs. It allows compute intensive tasks to be offloaded from the CPU to the GPU.
Do all GPUs have CUDA?
No, only Nvidia GPUs designed for general purpose GPU computing support the CUDA platform. AMD and Intel GPUs do not support CUDA.
Can CUDA run on AMD graphics?
No, CUDA only runs on Nvidia GPUs. For AMD GPUs, OpenCL is the alternative to CUDA for GPGPU computing