安裝 docker 環境
sudo snap install docker
sudo snap install docker
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 -y nvidia-container-runtime
# tensorflow docker pull tensorflow/tensorflow # tensorflow-gpu docker pull tensorflow/tensorflow:nightly-devel-gpu
# tensorflow docker run -it --rm tensorflow/tensorflow \ python -c "import tensorflow as tf; tf.enable_eager_execution(); print(tf.reduce_sum(tf.random_normal([1000, 1000])))" # tensorflow-gpu docker run -it --rm tensorflow/tensorflow:nightly-devel-gpu \ python -c "import tensorflow as tf; tf.enable_eager_execution(); print(tf.reduce_sum(tf.random_normal([1000, 1000])))"