900字范文,内容丰富有趣,生活中的好帮手!
900字范文 > RTX 3090运行报错:RuntimeError: CUDA error: no kernel image is available for execution on the device

RTX 3090运行报错:RuntimeError: CUDA error: no kernel image is available for execution on the device

时间:2019-12-05 18:56:21

相关推荐

RTX 3090运行报错:RuntimeError: CUDA error: no kernel image is available for execution on the device

RuntimeError: CUDA error: no kernel image is available for execution on the device

安装适用于GeForce RTX 3090显卡的pytorch

卸载当前版本的pytorch, 重新按照以下安装

pip uninstall torch# torch 1.7.0+cu110pip install torch==1.7.0+cu110 torchvision==0.8.1+cu110 torchaudio===0.7.0 -f /whl/torch_stable.html# 更新:现在可使用torch 1.8.2 啦!!conda install pytorch torchvision torchaudio cudatoolkit=11.1 -c pytorch-lts -c nvidia

如果安装失败可以尝试离线安装,具体参考我的另一篇博客

Pytorch安装太慢/安装不了怎么办?那就离线安装Pytorch_wisteri的博客-CSDN博客

另一个小问题

Pytorch错误:Torch not compiled with CUDA enabled

在用Pytorch炼丹的过程中,很意外地碰到了一个错误提示AssertionError: Torch not compiled with CUDA enabled。

代码本身可以确定是没有问题的,因为只是在往日已经跑过的代码上加入了小改动。最后发现问题出现在Pytorch和CUDA版本不兼容的问题上。问题的发现可以在终端中输入'python3'命令,运行python3后,输入

import torchprint(torch.__version__)print(torch.cuda.is_available())

如果输出的结果是False,那么说明当前的Pytorch版本无法使用显卡。

解决办法:

应该是你装的是cpu版本的Pytorch,卸载重装cuda版本的Pytorch。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。