随笔 - 836  文章 - 1 评论 - 40 阅读 - 102万
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

 

NVIDIA® CUDA®工具包为创建高性能 GPU 加速应用提供了发展环境。使用 CUDA 工具包,您可以在 GPU 加速嵌入式系统、桌面工作站、企业数据中心、基于云的平台和 HPC 超级计算机上开发、优化和部署您的应用程序。工具包包括 GPU 加速库、调试和优化工具、C/C++编译器以及一个运行时库,以便在包括 x86、Arm 和 POWER 在内的主要架构上构建和部署您的应用程序。科学家和研究人员可以利用内置功能在多 GPU 配置中分配计算,开发从单个 GPU 工作站到拥有数千个 GPU 的云安装的应用程序。

 

进入官网 cuda-toolkit,根据显卡的cuda版本号,选择对应版本的toolkit下载,然后按照提示进行安装即可,安装目录可自定义。

 

显卡cuda版本号可通过 nvidia-smi 命令查看。

 然后选择对应版本的cuda-toolkit。

下载

最新版本:https://developer.nvidia.com/cuda-downloads
历史版本:https://developer.nvidia.com/cuda-toolkit-archive

 

 

安装cudnn

找到了cuda官网 https://developer.nvidia.com/cuda-toolkit-archive 下载了11.6,

然后又到cudnn下载地址 https://developer.nvidia.com/rdp/cudnn-archive 下载了与cuda11.6对应的cudann了.

解压到:C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/ 下

添加环境变量到path (已更新到v12.3   2024-01-25)

C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/cudnn-windows-x86_64-8.9.6.50_cuda12-archive/bin
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/cudnn-windows-x86_64-8.9.6.50_cuda12-archive/include
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/cudnn-windows-x86_64-8.9.6.50_cuda12-archive/lib

 

 

 另外python 也可以手动指定环境变量:

 eg:

 

import paddle
import os
path_to_add = "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/cudnn-windows-x86_64-8.9.6.50_cuda12-archive/bin;C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/cudnn-windows-x86_64-8.9.6.50_cuda12-archive/include;C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/cudnn-windows-x86_64-8.9.6.50_cuda12-archive/lib"
current_path = os.environ['PATH'] # 获取当前的PATH值
print(current_path)
updated_path = current_path + ';' + path_to_add # 更新后的PATH值
os.environ['PATH'] = updated_path # 设置更新后的PATH值
print(os.environ['PATH']) # 打印验证结果

 

 

 

 

  pyTorch 正确安装 (https://pytorch.org/get-started/locally/#no-cuda-1)

 

pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124

检测:

import torch
print(torch.__version__)
print(torch.version.cuda)
has_cuda = torch.cuda.is_available()
print(has_cuda)

 

 

 
posted on   lshan  阅读(524)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?
历史上的今天:
2020-06-19 Ribbon 的负载均衡策略 springCloud
2020-06-19 Feign (配合Hystrix) +文件传输
2020-06-19 springCloud eureka (HA && docker)
2019-06-19 mongoDB 笔记 https://www.runoob.com/mongodb/mongodb-query.html
点击右上角即可分享
微信分享提示