重新開機後無法使用gpu - jenhaoyang/ml_blog GitHub Wiki

主因是因為裝了兩個docker 一個用apt 一個用snap
In my case, I had docker installed twice, via snap and apt package manager:

After reboot I had:

$ docker images
REPOSITORY              TAG                  IMAGE ID            CREATED             SIZE
ubuntu                  latest               4e2eef94cd6b        3 weeks ago         73.9MB
tensorflow/tensorflow   latest-gpu-jupyter   f0b0261fec71        6 weeks ago         3.3GB
nvidia/cuda             10.0-base            841d44dd4b3c        9 months ago        110MB

If I restart docker service:

$ sudo service docker restart

I have other set of images:

$ docker images
REPOSITORY              TAG                  IMAGE ID            CREATED             SIZE
jupyter/r-notebook      latest               14611e3d9838        2 weeks ago         2.59GB
ubuntu                  latest               4e2eef94cd6b        3 weeks ago         73.9MB
tensorflow/tensorflow   latest-gpu-jupyter   f0b0261fec71        6 weeks ago         3.3GB

$ dpkg -l | grep docker
ii  docker-ce                                  5:19.03.12~3-0~ubuntu-focal           amd64        Docker: the open-source application container engine
ii  docker-ce-cli                              5:19.03.12~3-0~ubuntu-focal           amd64        Docker CLI: the open-source application container engine

$ snap list | grep docker
docker     19.03.11     471    latest/stable  canonical*          -    

I restared OS:

$ sudo init 6

and I removed all images created through snap docker:

$ docker rmi $(docker images -q)

After it I removed snap docker:

$ sudo snap remove docker
$ sudo init 6

參考:
https://askubuntu.com/a/1274311