本地docker运行
$ docker run --rm --gpus all nvidia/cuda:11.8.0-base-ubuntu22.04 nvidia-smi
遇到这种报错
Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error running hook #0: error running hook: exit status 1, stdout: , stderr: Auto-detected mode as 'legacy'
nvidia-container-cli: initialization error: load library failed: libnvidia-ml.so.1: cannot open shared object file: no such file or directory: unknown
可以试着重装docker,我试了其他方法都不行,重装docke就成功了
【参考】
https://github.com/AbdBarho/stable-diffusion-webui-docker/issues/406
https://github.com/NVIDIA/nvidia-docker/issues/1648#issuecomment-1785033393