首先安好 nvidia-docker 才能看到GPU
# root用户才可以分配GPU
sudo docker run -it --rm --name jupyter -p 0.0.0.0:8888:8888 --gpus all -v /home/ubuntu/jupyter-workspace:/home/jovyan -v/home/ubuntu/rqalpha-plus-workspace/bundle:/home/jovyan/rqdata:ro jupyter/datascience-notebook
# jupyter镜像默认不允许远程访问
sudo docker exec -it jupyter bash
echo "c.NotebookApp.ip = '*'" >> .jupyter/jupyter_notebook_config.py
# 安装pytorch with cuda11.6
conda install pytorch torchvision torchaudio cudatoolkit=11.6 -c pytorch -c conda-forge
# 显示TOKEN
sudo docker exec jupyter jupyter server list
# REMOTE IP
http://xxx.xxx.xxx.xxx:8888/
标签:docker,sudo,Jupyter,xxx,home,GPU,Docker,jupyter From: https://www.cnblogs.com/tugeler/p/16758781.html