NVIDIA:“RuntimeError:没有可用的 CUDA GPU”

NVIDIA:“RuntimeError:没有可用的 CUDA GPU”

我正在 Ubuntu 上使用 PyTorch 实现一个简单的算法。我的 NVIDIA 驱动程序已经两次以某种方式损坏,以至于运行算法会产生以下回溯:

Traceback (most recent call last):
 File "module.py", line 212, in <module>
    inputs_tensor = torch.tensor(inputs_train).to(device)
  File "/home/user/.venv/lib/python3.8/site-packages/torch/cuda/__init__.py", line 172, in _lazy_init
    torch._C._cuda_init()
RuntimeError: No CUDA GPUs are available

我重新安装了驱动程序两次,但几次重启后它们又被损坏了。

$ nvidia-smi
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. 
Make sure that the latest NVIDIA driver is installed and running.

$ grep "X Driver" /var/log/Xorg.0.log
[    43.342] (II) NVIDIA dlloader X Driver  440.100  Fri May 29 08:21:27 UTC 202

相关内容