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
基础教程推荐
- 修改列表中的数据帧不起作用 2022-01-01
- Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙? 2022-01-01
- 在同一图形上绘制Bokeh的烛台和音量条 2022-01-01
- 包装空间模型 2022-01-01
- PANDA VALUE_COUNTS包含GROUP BY之前的所有值 2022-01-01
- 使用大型矩阵时禁止 Pycharm 输出中的自动换行符 2022-01-01
- PermissionError: pip 从 8.1.1 升级到 8.1.2 2022-01-01
- 在Python中从Azure BLOB存储中读取文件 2022-01-01
- 求两个直方图的卷积 2022-01-01
- 无法导入 Pytorch [WinError 126] 找不到指定的模块 2022-01-01
