1、验证显卡驱动和CUDA支持版本号:
C:\Users\username>nvidia-smi
Wed Apr 2 19:19:54 2025
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 572.83 Driver Version: 572.83 CUDA Version: 12.8 |
|-----------------------------------------+------------------------+----------------------+
| GPU Name Driver-Model | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+========================+======================|
| 0 NVIDIA GeForce RTX 5090 WDDM | 00000000:01:00.0 On | N/A |
| 0% 49C P8 21W / 600W | 1645MiB / 32607MiB | 1% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+
+-----------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=========================================================================================|
| 0 N/A N/A 2600 C+G ....0.3124.93\msedgewebview2.exe N/A |
| 0 N/A N/A 9884 C+G C:\Windows\explorer.exe N/A |
| 0 N/A N/A 9900 C+G ...indows\System32\ShellHost.exe N/A |
| 0 N/A N/A 11548 C+G ...mba6cd70vzyy\ArmouryCrate.exe N/A |
| 0 N/A N/A 12156 C+G ..._cw5n1h2txyewy\SearchHost.exe N/A |
| 0 N/A N/A 12180 C+G ...y\StartMenuExperienceHost.exe N/A |
| 0 N/A N/A 13124 C+G ...ntrolPanel\SystemSettings.exe N/A |
| 0 N/A N/A 14572 C+G ...Chrome\Application\chrome.exe N/A |
| 0 N/A N/A 15244 C+G ...App_cw5n1h2txyewy\LockApp.exe N/A |
| 0 N/A N/A 15396 C+G ...em32\ApplicationFrameHost.exe N/A |
| 0 N/A N/A 18260 C+G ...yb3d8bbwe\WindowsTerminal.exe N/A |
| 0 N/A N/A 19196 C+G ...8bbwe\PhoneExperienceHost.exe N/A |
| 0 N/A N/A 19792 C+G ...5n1h2txyewy\TextInputHost.exe N/A |
| 0 N/A N/A 22548 C+G ...t\Edge\Application\msedge.exe N/A |
| 0 N/A N/A 22740 C+G ...SnippingTool\SnippingTool.exe N/A |
| 0 N/A N/A 24820 C+G ...crosoft OneDrive\OneDrive.exe N/A |
| 0 N/A N/A 25872 C+G ...xyewy\ShellExperienceHost.exe N/A |
+-----------------------------------------------------------------------------------------+
2、由于安装CUDA 12.8需要Visual Studio 2022 所以要先安装它 安装:Visual Studio 2022 网址:visualstudio.microsoft.com/zh-hans/dow… 安装时勾选 C++桌面开发
3、重启后安装CUDA
developer.nvidia.com/cuda-toolki… CUDA developer.nvidia.com/cuda-downlo…
安装结果: Installed: - Nsight for Visual Studio 2022 - Nsight Monitor Not Installed: - Nsight for Visual Studio 2019 Reason: VS2019 was not found - Integrated Graphics Frame Debugger and Profiler Reason: see developer.nvidia.com/nsight-vsto… - Integrated CUDA Profilers Reason: see developer.nvidia.com/nsight-vsto…
验证工作 C:\Users\username>nvcc -V nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2025 NVIDIA Corporation Built on Fri_Feb_21_20:42:46_Pacific_Standard_Time_2025 Cuda compilation tools, release 12.8, V12.8.93 Build cuda_12.8.r12.8/compiler.35583870_0
4、安装cuDDN 网址:developer.nvidia.com/rdp/cudnn-a… 下载对应的版本
获取你的CUDA路径: C:\Users\username>set cuda CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8 CUDA_PATH_V12_8=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8
解压后复制到以上路径,过程需要授权 验证cuDDN 用管理员身份运行CMD 运行命令.\extras\demo_suite\bandwidthTest.exe 运行命令.\extras\demo_suite\deviceQuery.exe 看到Result = PASS 就大功告成了
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8\extras\demo_suite>bandwidthTest.exe
[CUDA Bandwidth Test] - Starting...
Running on...
Device 0: NVIDIA GeForce RTX 5090
Quick Mode
Host to Device Bandwidth, 1 Device(s)
PINNED Memory Transfers
Transfer Size (Bytes) Bandwidth(MB/s)
33554432 23896.2
Device to Host Bandwidth, 1 Device(s)
PINNED Memory Transfers
Transfer Size (Bytes) Bandwidth(MB/s)
33554432 27960.2
Device to Device Bandwidth, 1 Device(s)
PINNED Memory Transfers
Transfer Size (Bytes) Bandwidth(MB/s)
33554432 3005576.8
Result = PASS
NOTE: The CUDA Samples are not meant for performance measurements. Results may vary when GPU Boost is enabled.
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8\extras\demo_suite>deviceQuery.exe
deviceQuery.exe Starting...
CUDA Device Query (Runtime API)
Detected 1 CUDA Capable device(s)
Device 0: "NVIDIA GeForce RTX 5090"
CUDA Driver Version / Runtime Version 12.8 / 12.8
CUDA Capability Major/Minor version number: 12.0
Total amount of global memory: 32607 MBytes (34190458880 bytes)
MapSMtoCores for SM 12.0 is undefined. Default to use 128 Cores/SM
MapSMtoCores for SM 12.0 is undefined. Default to use 128 Cores/SM
(170) Multiprocessors, (128) CUDA Cores/MP: 21760 CUDA Cores
GPU Max Clock rate: 2580 MHz (2.58 GHz)
Memory Clock rate: 14001 Mhz
Memory Bus Width: 512-bit
L2 Cache Size: 100663296 bytes
Maximum Texture Dimension Size (x,y,z) 1D=(131072), 2D=(131072, 65536), 3D=(16384, 16384, 16384)
Maximum Layered 1D Texture Size, (num) layers 1D=(32768), 2048 layers
Maximum Layered 2D Texture Size, (num) layers 2D=(32768, 32768), 2048 layers
Total amount of constant memory: zu bytes
Total amount of shared memory per block: zu bytes
Total number of registers available per block: 65536
Warp size: 32
Maximum number of threads per multiprocessor: 1536
Maximum number of threads per block: 1024
Max dimension size of a thread block (x,y,z): (1024, 1024, 64)
Max dimension size of a grid size (x,y,z): (2147483647, 65535, 65535)
Maximum memory pitch: zu bytes
Texture alignment: zu bytes
Concurrent copy and kernel execution: Yes with 1 copy engine(s)
Run time limit on kernels: Yes
Integrated GPU sharing Host Memory: No
Support host page-locked memory mapping: Yes
Alignment requirement for Surfaces: Yes
Device has ECC support: Disabled
CUDA Device Driver Mode (TCC or WDDM): WDDM (Windows Display Driver Model)
Device supports Unified Addressing (UVA): Yes
Device supports Compute Preemption: Yes
Supports Cooperative Kernel Launch: Yes
Supports MultiDevice Co-op Kernel Launch: No
Device PCI Domain ID / Bus ID / location ID: 0 / 1 / 0
Compute Mode:
< Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >
deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 12.8, CUDA Runtime Version = 12.8, NumDevs = 1, Device0 = NVIDIA GeForce RTX 5090
Result = PASS