![NVIDIA: 「ランタイムエラー: 利用可能な CUDA GPU がありません」](https://rvso.com/image/1641901/NVIDIA%3A%20%E3%80%8C%E3%83%A9%E3%83%B3%E3%82%BF%E3%82%A4%E3%83%A0%E3%82%A8%E3%83%A9%E3%83%BC%3A%20%E5%88%A9%E7%94%A8%E5%8F%AF%E8%83%BD%E3%81%AA%20CUDA%20GPU%20%E3%81%8C%E3%81%82%E3%82%8A%E3%81%BE%E3%81%9B%E3%82%93%E3%80%8D.png)
私は Ubuntu 上で PyTorch を使用して簡単なアルゴリズムを実装しています。NVIDIA ドライバーが何らかの理由で破損したため、アルゴリズムを実行すると次のトレースバックが生成されることがすでに 2 回ありました。
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
ドライバーを 2 回再インストールしましたが、再起動を数回繰り返すと再び破損してしまいます。
$ 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