0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

nvidia-smiでcommunicate with the NVIDIA driverなどtroubleshooting

Posted at

ドライバの入れ直しでトラブル

  • 上記記事でドライバを更新、画面表示はできるようになったのですが、以下のような状態になってしまいました。
terminal

7C94:~$ 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.


  • でもnvcc -V は表示されるという・・・
terminal

C94:~$ nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Sun_Jul_28_19:07:16_PDT_2019
Cuda compilation tools, release 10.1, V10.1.243

参考資料

インフォメーション
有用な解決策を探して、早く仕事をさせたい

インフォメーション
もとはといえば、Ubuntu20.04にCUDA11.8適用で起こったトラブルなので

  • ドライバ再インストールの前段として状態をみてみる
  • 特段異常はなさそう
  • 結局こちらのフォーラム内のやり取り流用では解決に至らず
terminal
uname -m && cat /etc/*release
gcc --version
sudo apt-get install linux-headers-$(uname -r) --verbose-versions

インフォメーション
こちらの記事はかなり役に立ちました

  • この段階で隠れているゴミを削除できました。
  • でも、結局こちらの手順では解決に至らず

インフォメーション
上げてだめなら、バージョン下げてみようということで遭遇した類似現象で参照

terminal

sudo apt-get install aptitude


  • aptitude でドライバがインストールに失敗するのは避けられることは判明
  • でも、結局こちらの手順では解決に至らず
  • CUDA12.3が〜〜と言われていることにようやく気づく

謎のCUDAのリポジトリの悪さを止める

terminal

apt-cache search "cuda" | grep "12.3"

結果的にリポジトリの設定が邪魔していると判明

terminal
cat /etc/apt/sources.list
ls /etc/apt/sources.list.d/
cat /etc/apt/sources.list.d/[ファイル名]
  • CUDAバージョンはお使いの状況に応じて適宜変更してください
  • sources.listに未使用のリポジトリがあったので、コメントアウト(削除でいいかも)

nvidia-smiの表示トラブル直らず、再度修復作業

Failed to initialize NVML: Driver/library version mismatchも発生していました

参考にした記事

インフォメーション
究極的にはZennの190ikpさんの記事のコマンドラインなのですが・・

  • drm使用中のため解決できず

  • 加えて@ell(e) さんの記事を参考にさせていただきました。
terminal

sudo modprobe -f nvidia_drm

  • -rをfにして強制的に止めます。
  • 次のコマンドラインは通常通りに参考記事の通りにエラーに応じてコマンドを売っていきます。
  • 結局gdm等のGUIは止めるので使用中の方はコマンドをメモします。
  • 2台使いでもいいかもしれません。

無事nvidia-smi動作・まとめ

  • 今回はエラーのもとが複数存在していたため、合わせ技で解決
  1. 余計なリポジトリを削除
  2. CUDA/ドライバの再インストール
  3. Nouveauモードで立ち上げておく
  4. CUIモードで回復コマンド実行
  5. 2番めで成功しなかったらここでドライバインストール(下の絵のメニュー)

この3(5)つが必要でした。ケースbyケースですね

En summary

Trouble symptom

  • communicate with the NVIDIA driver on nvidia-smi
  • Failed to initialize NVML: Driver/library version mismatch on nvidia-smi

# in my case, extra repository setting avoid to re-install driver properly.
apt-cache search "cuda" | grep "12.3"



#kill nvidia / cuda CLI mode 
sudo modprobe -r nvidia_drm
sudo modprobe -r nvidia_uvm
sudo rmmod nvidia_modeset
sudo rmmod nvidia

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?