1
0

stable-diffusion-webui The NVIDIA driver on your system is too old 対策 windows

Posted at

stable-diffusion-webuiを更新したらNVIDIA driverのバージョンが違うので怒られた

windows環境。

RuntimeError: The NVIDIA driver on your system is too old (found version 11070). 
Please update your GPU driver by downloading and installing a new version from the URL:
http://www.nvidia.com/Download/index.aspx Alternatively,
go to: https://pytorch.org to install a PyTorch version that has been compiled with your version of the CUDA driver.

書いてあることはお前のNVIDIA driverバージョンはversion 11070だから古いぞ
NVIDIA driverのバージョンをあげるかpytorchのバージョンを合わせろってことです。

NVIDIAドライバーの更新はしたくないのでPyTorchのバージョンを揃えよう

まず自分が使ってるCUDAのバージョンを確認する
コマンドプロンプトで

nvidia-smi

を実行
いろいろ出てくるけど上の方にCUDA Versionが書いてあって
CUDA Version: 11.7だとわかりました。

pytorchのCUDA 11.7に適したやつを探す

公式サイト↓(https://pytorch.org )に行って

11.7で検索すると

pytorch==2.0.1 torchvision==0.15.2

https://download.pytorch.org/whl/cu117

から落とせって書いてある。

stable-diffusion-webuiでpytorchのバージョンを指定してあるところを編集する

TORCH_COMMANDでGrep検索すると
stable-diffusion-webui\modules\launch_utils.pyの318行目くらいに

torch_index_url = os.environ.get('TORCH_INDEX_URL', "https://download.pytorch.org/whl/cu121")
torch_command = os.environ.get('TORCH_COMMAND', f"pip install torch==2.1.2 torchvision==0.16.2 --extra-index-url {torch_index_url}")

があってここで torch==2.1.2を指定してあるぽいので

torch_index_url = os.environ.get('TORCH_INDEX_URL', "https://download.pytorch.org/whl/cu117")
torch_command = os.environ.get('TORCH_COMMAND', f"pip install torch==2.0.1+cu117 torchvision==0.15.2+cu117 --extra-index-url {torch_index_url}")

に書き換える。

stable-diffusion-webui直下のwebui-macos-env.shに

export TORCH_COMMAND="pip install torch==2.1.0 torchvision==0.16.0"

って書いてあってwindowsだからここ参照してなさそうだけど一応

export TORCH_COMMAND="pip install torch==2.0.1+cu117 torchvision==0.15.2+cu117 --extra-index-url https://download.pytorch.org/whl/cu117"

にしておく

webui実行ファイルの設定を変えてpytorchの再インストールをする

webui-user.bat

set COMMANDLINE_ARGS=--skip-torch-cuda-test --reinstall-torch 

を書き込む。もしかしてここでTORCH_COMMANDをSETしてもいいのかもしれない
これでwebui-user.batを実行するとpytorchの再インストールが始まって2.0.1にできた。

webuiもうまく動いてそうである。めでたしめでたし。

1
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
1
0