![NVIDIA:“運行時錯誤:沒有可用的 CUDA GPU”](https://rvso.com/image/1641901/NVIDIA%EF%BC%9A%E2%80%9C%E9%81%8B%E8%A1%8C%E6%99%82%E9%8C%AF%E8%AA%A4%EF%BC%9A%E6%B2%92%E6%9C%89%E5%8F%AF%E7%94%A8%E7%9A%84%20CUDA%20GPU%E2%80%9D.png)
我正在 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