LoginSignup
8
10

More than 3 years have passed since last update.

tensorflow-gpuが動いたCUDA, cuDNNのバージョンのメモ

Last updated at Posted at 2020-08-05

PyPIに置かれているtensorflow-gpuビルドが対応している
CUDA, cuDNNバージョンをメモするだけの記事です。

新しいバージョンで動作を確認したらこの記事に追記していきます。

対応CUDA, cuDNN一覧

このページは個人が自分用メモとして作っていますので
tensorflow公式に記載がない場合のみ参考までにご覧ください。

tensorflow公式
https://www.tensorflow.org/install/source#tested_build_configurations

Windwows10

tensorflow CUDA cuDNN 備考
2.3.0 10.1 7.6 手元環境で動作を確認
2.2.0 10.1 7.6 手元環境で動作を確認
2.1.0 10.1 7.6 Release Noteに記載あり
2.0.0 10.0 7.4 公式サイトに記載あり

Ubuntu 18.04

tensorflow CUDA cuDNN 備考
2.3.0 10.1
2.2.0 10.1 7.6 手元環境で動作を確認
2.1.0 10.1 7.6 Release Noteに記載あり
2.0.0 10.0 7.4 公式サイトに記載あり

バージョンについて

pip installでインストールされるtensorflow-gpuビルドは特定のバージョンのCUDAを参照するようになっているので、バージョンが違うCUDAを入れると動きません。

どのバージョンのtensorflow-gpuがどのバージョンのCUDAを使うようにビルドされているかは古いバージョンについてはこちらに一覧されているので問題ないんですが、2020年8月現在tensorflow 2.3.0までリリースされているのに一覧表には2.1.0までしか載ってません。
https://www.tensorflow.org/install/source#tested_build_configurations

じゃあRelease Notesに載ってるかというとtensorflow 2.1.0には対応CUDAバージョンが書かれているのにtensorflow 2.2以降のRelease Notesには載ってません。
https://github.com/tensorflow/tensorflow/releases

これだと困るので新しいバージョンがちゃんと動いたらそのときのバージョンをメモしておこうというのがこの記事です。新しいバージョンについても新しい記事を書くんじゃなくてここに追記していきます。

自分で確認する方法

CUDAが入っていないかバージョンが適切でない場合、importした際に以下のようにエラーメッセージが出ます。その際に表示されるdllのファイル名でバージョンが分かります。以下ではcudart64_101.dllを読もうとしているのでおそらくCUDA10.1が必要なんだろうという感じです。

python
>>> import tensorflow as tf

2020-08-05 00:33:55.037723: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found
2020-08-05 00:33:55.037919: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.

確認に使っている手元環境

Windows10
Anaconda3
Ryzen7-1700X
GTX-1080Ti

Ubuntu18.04
Anaconda3
core i9-9900K
TitanV

8
10
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
8
10