NVIDIA:“運行時錯誤:沒有可用的 CUDA GPU”

NVIDIA:“運行時錯誤:沒有可用的 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

相關內容