Runtime error 999 when trying to use cuda with pytorch(尝试在 pytorch 中使用 cuda 时出现运行时错误 999)
问题描述
我为 Geforce 2080 ti 安装了 Cuda 10.1 和最新的 Nvidia 驱动程序.我尝试运行一个基本脚本来测试 pytorch 是否正常工作,但出现以下错误:
I installed Cuda 10.1 and the latest Nvidia Driver for my Geforce 2080 ti. I try to run a basic script to test if pytorch is working and I get the following error:
RuntimeError: cuda runtime error (999) : ..atensrcTHCTHCGeneral.cpp:50 处的未知错误
下面是我试图运行的代码:
Below is the code im trying to run:
import torch
torch.cuda.current_device()
torch.cuda.is_available()
torch.cuda.get_device_name(0)
推荐答案
重新启动计算机为我解决了这个问题.
Restarting my computer fixed this for me.
但是对于侵入性较小的修复,您也可以尝试此解决方案(来自 张量流问题线程):
But for a less invasive fix, you can also try this solution (from a tensorflow issue thread):
sudo rmmod nvidia_uvm
sudo rmmod nvidia
sudo modprobe nvidia
sudo modprobe nvidia_uvm
这篇关于尝试在 pytorch 中使用 cuda 时出现运行时错误 999的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:尝试在 pytorch 中使用 cuda 时出现运行时错误 999
基础教程推荐
- pyserial - 可以从线程 a 写入串行端口,是否阻塞从线程 b 读取? 2022-01-01
- 尝试制作WhatsApp机器人 2022-01-01
- 用 Python 编写 Fortran 无格式文件 2022-01-01
- 在 Celery 工作人员中捕获 Heroku SIGTERM 以优雅地关 2022-01-01
- numpy float:比算术运算中内置的慢 10 倍? 2022-01-01
- 使用生成器和迭代器时 Python 多循环失败 2022-01-01
- 与常规 dict 相比,Python manager.dict() 非常慢 2022-01-01
- 由Python将MP3转换为MIDI(类型错误:无法加载插件:mtg-Melodia:Melodia) 2022-01-01
- Discord.py 缺少必需的参数 2022-01-01
- 将 x 轴刻度更改为自定义字符串 2022-01-01
