python - CUDA 初始化:来自 cudaGetDeviceCount() 的意外错误
问题描述
我在我的 Linux 服务器上运行一个深度学习程序,我突然收到了这个错误。
UserWarning: CUDA initialization: Unexpected error from cudaGetDeviceCount(). Did you run some cuda functions before calling NumCudaDevices() that might have already set an error? Error 804: forward compatibility was attempted on non supported HW (Triggered internally at /opt/conda/conda-bld/pytorch_1603729096996/work/c10/cuda/CUDAFunctions.cpp:100.)
早些时候,当我刚刚创建这个 conda 环境时,torch.cuda.is_available()
返回true
并且我可以使用 CUDA 和 GPU。但是突然之间我无法使用 CUDA 并torch.cuda.is_available()
返回了false
。我应该怎么办?
附言。我使用 GeForce RTX 3080 和 cuda 11.0 + pytorch 1.7.0。它以前有效,但现在无效。
解决方案
我刚刚尝试重新启动。问题解决了。原来这是由 NVIDIA NVML 驱动程序/库版本不匹配引起的。
推荐阅读
- reactjs - 使用 Wrokbox 时如何在 swSrc 中导入文件
- c++ - 在 C++ 中编写正则表达式的正确方法是什么?
- python - 从非 nan 值的列中获取数据
- python - 调用“make install -j8 -l8”失败
- vim - 如何在 VIM 中快速显示/隐藏当前光标中的垂直线?
- git - 处理只改变空格的帅哥
- c# - C#从锯齿状数组中删除重复项
- google-chrome - 谷歌浏览器字体不可读
- php - PHP Code Igniter:会话不在 www.example.com 中工作,但在 www.example.com/beta 中工作
- python - Django 休息框架将项目发布到数据库