0
3

環境をUbuntu22からWSL2+Ubuntu22に移行した

Last updated at Posted at 2024-04-28

忘れないように、メモ。
Windows用のGPUドライバとPythonインタプリタはインストール済である前提。

必要なバージョンの確認

Tensorflow、Python、cuDNN、CUDAのバージョン対応表
https://www.tensorflow.org/install/source#gpu

この対応表の組み合わせでインストールすれば、GPUが有効になる。
例えばPython3.11(3.9-3.12)の場合、tensorflow-2.16.1、cuDNN8.9、CUDA(Toolkit)12.3で良い。

CUDA

CUDA Toolkit 12.3 Downloads
https://developer.nvidia.com/cuda-12-3-0-download-archive?target_os=Linux&target_arch=x86_64&Distribution=WSL-Ubuntu&target_version=2.0&target_type=deb_local

こまかな手順はリンク先に掲載されている。

cuDNN

cuDNNは通常のリポジトリから入れる
sudo apt install libcudnn8*

Tensorflow

pip install tensorflow==2.16.1 で入れる。

動作確認

import tensorflow as tf
tf.test.is_gpu_available()

Trueが返れば成功

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