当前位置: 首页 > news >正文

win11+4060安装cuda,cuda toolkit,cudnn

目录

一、查看驱动版本

二、安装cuda toolkit

三、安装CUDNN

四、配置环境变量


一、查看驱动版本

       首先搞清楚cuda驱动,cuda toolkit,cudnn是什么东西,有什么关系!

       一般电脑的独显能正常使用,0说明已经安装好了显卡驱动,这是可以在命令窗口查看驱动版本信息,并通过版本信息,得到能安装的cuda toolkit的版本

C:\Users\fuhang>nvidia-smi
Wed Oct  8 17:14:01 2025
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 566.24                 Driver Version: 566.24         CUDA Version: 12.7     |
|-----------------------------------------+------------------------+----------------------+
| 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 4060 ...  WDDM  |   00000000:01:00.0 Off |                  N/A |
| N/A   43C    P0             11W /   80W |       0MiB /   8188MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------++-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|  No running processes found                                                             |
+-----------------------------------------------------------------------------------------+

二、安装cuda toolkit

       CUDA 12.7说明支持的cuda toolkit的最高版本,参考这个信息选择安装cuda toolkit的版本,安装好以后查看版本信息如下

C:\Users\fuhang>nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2024 NVIDIA Corporation
Built on Wed_Oct_30_01:18:48_Pacific_Daylight_Time_2024
Cuda compilation tools, release 12.6, V12.6.85
Build cuda_12.6.r12.6/compiler.35059454_0

Cuda compilation tools, release 12.6, V12.6.85指的是cuda toolkit的版本

三、安装CUDNN

下载地址:CUDNN

CUDNN的版本信息也指明了适配哪种CUDA版本,按照版本下载即可

解压下载文件

① 把cuDNN的bin目录下的文件复制到CUDA安装目录 bin目录下:
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\bin
② 把cuDNN的include下的所有文件,复制到CUDA安装目录的include下:
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\include
③ 把cuDNN的lib\x64下的所有文件,拷贝到CUDA安装目录的lib\x64下:
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\lib\x64

四、配置环境变量

需要手动添加以下环境变量到系统变量里:
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\bin
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\libnvvp
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\extras\CUPTI\lib64
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\include

在cmd下执行如下2条命令,可查看CUDA驱动版本、CUDA Runtime版本以及GPU显卡的型号等信息
cd C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\extras\demo_suite
.\deviceQuery.exe

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\extras\demo_suite>.\deviceQuery.exe
.\deviceQuery.exe Starting...CUDA Device Query (Runtime API) version (CUDART static linking)Detected 1 CUDA Capable device(s)Device 0: "NVIDIA GeForce RTX 4060 Laptop GPU"CUDA Driver Version / Runtime Version          12.7 / 12.6CUDA Capability Major/Minor version number:    8.9Total amount of global memory:                 8188 MBytes (8585216000 bytes)
MapSMtoCores for SM 8.9 is undefined.  Default to use 128 Cores/SM
MapSMtoCores for SM 8.9 is undefined.  Default to use 128 Cores/SM(24) Multiprocessors, (128) CUDA Cores/MP:     3072 CUDA CoresGPU Max Clock rate:                            1890 MHz (1.89 GHz)Memory Clock rate:                             8001 MhzMemory Bus Width:                              128-bitL2 Cache Size:                                 33554432 bytesMaximum 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 layersMaximum Layered 2D Texture Size, (num) layers  2D=(32768, 32768), 2048 layersTotal amount of constant memory:               zu bytesTotal amount of shared memory per block:       zu bytesTotal number of registers available per block: 65536Warp size:                                     32Maximum number of threads per multiprocessor:  1536Maximum number of threads per block:           1024Max 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 bytesTexture alignment:                             zu bytesConcurrent copy and kernel execution:          Yes with 1 copy engine(s)Run time limit on kernels:                     YesIntegrated GPU sharing Host Memory:            NoSupport host page-locked memory mapping:       YesAlignment requirement for Surfaces:            YesDevice has ECC support:                        DisabledCUDA Device Driver Mode (TCC or WDDM):         WDDM (Windows Display Driver Model)Device supports Unified Addressing (UVA):      YesDevice supports Compute Preemption:            YesSupports Cooperative Kernel Launch:            YesSupports MultiDevice Co-op Kernel Launch:      NoDevice PCI Domain ID / Bus ID / location ID:   0 / 1 / 0Compute Mode:< Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 12.7, CUDA Runtime Version = 12.6, NumDevs = 1, Device0 = NVIDIA GeForce RTX 4060 Laptop GPU
Result = PASSC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\extras\demo_suite>

CUDA Driver = CUDART,

CUDA Driver Version = 12.7,

CUDA Runtime Version = 12.6,

NumDevs = 1,

Device0 = NVIDIA GeForce RTX 4060 Laptop GPU
Result = PASS

说明安装成功

http://www.dtcms.com/a/456611.html

相关文章:

  • Python小说图片PDF生成器开发详解
  • 一款小巧的绿色内存自动清理软件
  • 开源 C++ QT QML 开发(十一)通讯--TCP服务器端
  • 计算机毕业设计java共享茶室预约微信小程序 微信小程序中的共享茶室预订平台 茶室共享预约小程序的设计与开发
  • 《投资-104》价值投资者的认知升级与交易规则重构 - 如何从投资的角度选择创业的方向?
  • 网站底部素材临沂市平邑县建设局网站
  • 光通信|OAM-波长可控交叉连接
  • Redshift中锁定表的查询与处理
  • 利用AI+大数据的方式分析恶意样本(四十六)
  • 解码Linux环境搭建
  • 第8章:定时任务与触发器——让 Bot 主动服务
  • Javaweb--Vue
  • 大数据模糊计算
  • 2021年408真题易错知识点整理
  • 【金仓数据库】ksql 指南(二) —— 创建与管理本地数据库
  • 凡科网站是骗子跨境网站开发公司
  • vite性能优化
  • git添加远程仓库报错To add an exception for this directory解决方案-优雅草卓伊凡
  • 手机AIDE使用OpenCV
  • AI智能体(Agent)大模型入门【9】--如何在pycharm等其他编译软件调用ocr工具【只写后端代码不演示】
  • 浅析SpringBoot框架常见未授权访问漏洞
  • 有什么可以做翻译的网站点的排版设计网站
  • 第五十三章 ESP32S3 TCPClient 实验
  • 中国突破柔性电池技术瓶颈:可弯折20000次引领能源存储革命
  • 网站制作公司的宣传海报品牌免费网站建设
  • 基于模板缓冲的矢量贴地显示
  • flink keyby使用与总结 基础片段梳理
  • flink UTDF函数
  • 乐陵网站开发贾汪区建设局网站
  • VS安装EEPlus库及解决[弃用的]CS0618问题