https://www.tensorflow.org/install/docker
https://docs.docker.com/compose/gpu-support/
запуск:
docker build -t tf . docker run -p80:8888 -v /data/docker/tensorflow/tf:/tf -d --gpus all --name jupyter jupyter docker exec jupyter jupyter notebook list
Настроить с поддержкой Nvidia
Проверить GPU из контейнера:
docker run --rm -it --gpus all tensorflow/tensorflow:latest-gpu-jupyter python -c "import tensorflow as tf; print('TF version:', tf.__version__); print('GPU is', 'available' if tf.config.list_physical_devices('GPU') else 'NOT AVAILABLE')"
docker run --rm -it --gpus all tensorflow/tensorflow:latest-gpu-jupyter python -c "import tensorflow as tf; tf.test.gpu_device_name()"
docker run --rm -it --gpus all tensorflow/tensorflow:latest-gpu-jupyter python -c "import tensorflow as tf; print(tf.reduce_sum(tf.random.normal([1000, 1000])))"