私の備忘録がないわね...私の...

画像処理とかプログラミングのお話。

CUDA と PyTorch 公式 Docker Image の相性が悪いとき

PyTorch で GPU を扱うとき, PyTorch 公式 Docker Image を使用しているかもしれません.

FROM pytorch/pytorch:1.9.1-cuda11.1-cudnn8-devel

ほとんどの場合, 大丈夫なのですが, 稀に以下のエラーに遭遇することがあります.

docker: Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: Running hook #0:: error running hook: exit status 1, stdout: , stderr: nvidia-container-cli: requirement error: unsatisfied condition: cuda>=11.1, please update your driver to a newer version, or use an earlier cuda container: unknown.

これは PyTorch 公式 Image ではなく, NVIDIA 公式 Image を使うと直るかもしれません.

FROM nvcr.io/nvidia/pytorch:21.06-py3