20211130のTensorFlowに関する記事は2件です。

日記:docker run --gpus all でエラーになった

環境 ubuntu 20.04 GPU GeForce GTX 1060 ローカルのGPU設定 NVIDIA-SMI 460.39 Driver Version: 460.39 CUDA Version: 11.2 ことの経緯 tensorflow公式からGPUサポートのtensorflowイメージをpull run --gpus all ERRO[0000] error waiting for container: context canceled 確認 1. tensorflow公式からGPUサポートのtensorflowイメージをpull 公式に従ってタグlatest-gpuのイメージをプル docker pull tensorflow/tensorflow:latest-gpu 2. run sudo docker run --gpus all -it -v マウントしたいローカルのディレクトリ:コンテナ内のマウント先 --shm-size 8G --name コンテナの名前 tensorflow/tensorflow:latest-gpu 3. ERRO[0000] error waiting for container: context canceled docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]]. ERRO[0000] error waiting for container: context canceled うーーん、この 対策 nvidia-container-runtimeなどを入れる。 sudo apt-get install nvidia-container-runtime curl -s -L https://nvidia.github.io/nvidia-container-runtime/gpgkey | \ sudo apt-key add - distribution=$(. /etc/os-release;echo $ID$VERSION_ID) curl -s -L https://nvidia.github.io/nvidia-container-runtime/$distribution/nvidia-container-runtime.list | \ sudo tee /etc/apt/sources.list.d/nvidia-container-runtime.list sudo apt-get update sudo apt-get install nvidia-container-runtime service docker restart 気を取り直して sudo docker run --gpus all -it -v マウントしたいローカルのディレクトリ:コンテナ内のマウント先 --shm-size 8G --name コンテナの名前 tensorflow/tensorflow:latest-gpu 4. 確認 (コンテナ内で) nvidia-smi よし +-----------------------------------------------------------------------------+ | NVIDIA-SMI 460.39 Driver Version: 460.39 CUDA Version: 11.2 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |===============================+======================+======================| | 0 GeForce GTX 106... Off | 00000000:1D:00.0 On | N/A | | 27% 34C P8 9W / 120W | 242MiB / 6077MiB | 0% Default | | | | N/A | +-------------------------------+----------------------+----------------------+ +-----------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=============================================================================| +-----------------------------------------------------------------------------+
  • このエントリーをはてなブックマークに追加
  • Qiitaで続きを読む

日記:dockerでtensorflowを使おうとしたけど中々GPUを認識してくれなかったというお話

環境 ubuntu 20.04 GPU GeForce GTX 1060 ローカルのGPU設定 NVIDIA-SMI 460.39 Driver Version: 460.39 CUDA Version: 11.2 ことの経緯 tensorflow公式からGPUサポートのtensorflowイメージをpull run --gpus all ERRO[0000] error waiting for container: context canceled 確認 1. tensorflow公式からGPUサポートのtensorflowイメージをpull 公式に従ってタグlatest-gpuのイメージをプル docker pull tensorflow/tensorflow:latest-gpu 2. run sudo docker run --gpus all -it -v マウントしたいローカルのディレクトリ:コンテナ内のマウント先 --shm-size 8G --name コンテナの名前 tensorflow/tensorflow:latest-gpu 3. ERRO[0000] error waiting for container: context canceled docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]]. ERRO[0000] error waiting for container: context canceled うーーん、この 対策 nvidia-container-runtimeなどを入れる。 sudo apt-get install nvidia-container-runtime curl -s -L https://nvidia.github.io/nvidia-container-runtime/gpgkey | \ sudo apt-key add - distribution=$(. /etc/os-release;echo $ID$VERSION_ID) curl -s -L https://nvidia.github.io/nvidia-container-runtime/$distribution/nvidia-container-runtime.list | \ sudo tee /etc/apt/sources.list.d/nvidia-container-runtime.list sudo apt-get update sudo apt-get install nvidia-container-runtime service docker restart 気を取り直して sudo docker run --gpus all -it -v マウントしたいローカルのディレクトリ:コンテナ内のマウント先 --shm-size 8G --name コンテナの名前 tensorflow/tensorflow:latest-gpu 4. 確認 (コンテナ内で) nvidia-smi よし +-----------------------------------------------------------------------------+ | NVIDIA-SMI 460.39 Driver Version: 460.39 CUDA Version: 11.2 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |===============================+======================+======================| | 0 GeForce GTX 106... Off | 00000000:1D:00.0 On | N/A | | 27% 34C P8 9W / 120W | 242MiB / 6077MiB | 0% Default | | | | N/A | +-------------------------------+----------------------+----------------------+ +-----------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=============================================================================| +-----------------------------------------------------------------------------+
  • このエントリーをはてなブックマークに追加
  • Qiitaで続きを読む