H100显卡环境对应的cuda和torch版本

问题

新申请了几张H100的显卡,但运行程序会出现提示

NVIDIA H100 PCIe with CUDA capability sm_90 is not compatible with the current PyTorch installation.
The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_70 sm_75 sm_80 sm_86.
If you want to use the NVIDIA H100 PCIe GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/

原本的cuda版本是12.1,torch版本是2.0.1

解决

卸载掉之前安装的,重新安装11.8版本的cuda

pip install torch2.0.0+cu118 torchaudio2.0.0+cu118 torchvision==0.15.0+cu118 --extra-index-url https://download.pytorch.org/whl/cu118
conda install cudnn
conda install -c “nvidia/label/cuda-11.8.0” cuda-toolkit
conda install -c “nvidia/label/cuda-11.8.0” cuda-nvcc
conda install -c “nvidia/label/cuda-11.8.0” cuda-runtime

验证
import torch
print("PyTorch Version: ",torch.__version__) ; 
print("Is available: ", torch.cuda.is_available()) ; 
print("Current Device: ", torch.cuda.current_device()) ;
print("Number of GPUs: ",torch.cuda.device_count())

结果

import torch
print("PyTorch Version: ",torch.__version__) ; 
# PyTorch Version:  2.0.0+cu118
print("Is available: ", torch.cuda.is_available()) ; 
# Is available:  True
print("Current Device: ", torch.cuda.current_device()) ;
# Current Device:  0
print("Number of GPUs: ",torch.cuda.device_count())
# Number of GPUs:  8

补充
在这里插入图片描述

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值