docker run --name ppocr--gpus all -e NVIDIA_DRIVER_CAPABILITIES=compute,utility -e NVIDIA_VISIBLE_DEVICES=all -it nvidia/cuda:11.2.2-cudnn8-runtime-ubuntu20.04 /bin/bash
- –gpus all继承宿主机的cuda驱动
- -e NVIDIA_DRIVER_CAPABILITIES=compute,utility -e NVIDIA_VISIBLE_DEVICES=all 能够使用cuda
- bin/bash代表一个守护进程,防止docker容器退出
–gpus=“device=6” 代表使用固定卡号的gpu