検索条件
全1件
(1/1ページ)
ubuntu-drivers devicesとして使用可能なドライバを検索します。ここで、GTX-1060デスクトップの方は、
== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 == modalias : pci:v000010DEd00001C20sv00001458sd0000D005bc03sc00i00 vendor : NVIDIA Corporation model : GP106M [GeForce GTX 1060 Mobile] driver : nvidia-driver-430 - distro non-free driver : nvidia-driver-390 - distro non-free driver : nvidia-driver-435 - distro non-free recommended driver : xserver-xorg-video-nouveau - distro free builtinのように情報が表示されました (2019年12月)。GTX-1050ノートの方は何も見えなかった(2019年6月)ので、
sudo add-apt-repository ppa:graphics-drivers/ppa sudo apt updateのようにPPAの追加が必要でした。これが、ハードの違いによるものか、実行した時期の違いによるものかは検証していません。PPA追加後は、
== /sys/devices/pci0000:00/0000:00:1c.4/0000:03:00.0 == modalias : pci:v000010DEd00001C92sv00001462sd00001245bc03sc02i00 vendor : NVIDIA Corporation driver : nvidia-driver-418 - third-party free driver : nvidia-driver-415 - third-party free driver : nvidia-driver-430 - third-party free recommended driver : nvidia-driver-410 - third-party free driver : xserver-xorg-video-nouveau - distro free builtinのように表示されるようになりました。なお、現在(2019年12月)に ubuntu-drivers devices を実行すると
== /sys/devices/pci0000:00/0000:00:1c.4/0000:03:00.0 == modalias : pci:v000010DEd00001C92sv00001462sd00001245bc03sc02i00 vendor : NVIDIA Corporation driver : nvidia-driver-410 - third-party free driver : nvidia-driver-430 - third-party free driver : nvidia-driver-415 - third-party free driver : nvidia-driver-440 - third-party free recommended driver : nvidia-driver-435 - distro non-free driver : xserver-xorg-video-nouveau - distro free builtinとなったので、実行する時期によって内容は異なるようです。これらを見て、"recommended"なドライバをインストールしました。
sudo apt install nvidia-driver-430(GTX1060, 2019年12月)
sudo apt install nvidia-driver-435いったん再起動し、動作確認は、nvidia-smiを実行します。
Thu Dec 12 03:20:08 2019 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 435.21 Driver Version: 435.21 CUDA Version: 10.1 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | |===============================+======================+======================| | 0 GeForce GTX 1060 Off | 00000000:01:00.0 On | N/A | | N/A 47C P8 4W / N/A | 254MiB / 6075MiB | 0% Default | +-------------------------------+----------------------+----------------------+ +-----------------------------------------------------------------------------+ | Processes: GPU Memory | | GPU PID Type Process name Usage | |=============================================================================| | 0 1082 G /usr/lib/xorg/Xorg 18MiB | | 0 1132 G /usr/bin/gnome-shell 48MiB | | 0 1393 G /usr/lib/xorg/Xorg 114MiB | | 0 1527 G /usr/bin/gnome-shell 69MiB | +-----------------------------------------------------------------------------+のように表示されれば正常に動作しています。
sudo apt update sudo apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo apt-key fingerprint 0EBFCD88 sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" sudo apt update sudo apt install docker-ce docker-ce-cli containerd.io動作確認は、
sudo docker run hello-worldとして、
Unable to find image 'hello-world:latest' locally latest: Pulling from library/hello-world 1b930d010525: Pull complete Digest: sha256:4fe721ccc2e8dc7362278a29dc660d833570ec2682f4e4194f4ee23e415e1064 Status: Downloaded newer image for hello-world:latest Hello from Docker! This message shows that your installation appears to be working correctly. To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. (amd64) 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal. To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bash Share images, automate workflows, and more with a free Docker ID: https://hub.docker.com/ For more examples and ideas, visit: https://docs.docker.com/get-started/のようなメッセージが表示されれば成功です。
distribution=$(. /etc/os-release;echo $ID$VERSION_ID) curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list sudo apt update sudo apt install -y nvidia-container-toolkit sudo systemctl restart docker動作確認は、コンテナの中でnvidia-smiを実行してみましょう。
sudo docker run --gpus all --rm nvidia/cuda nvidia-smiとして、
Unable to find image 'nvidia/cuda:latest' locally latest: Pulling from nvidia/cuda 7ddbc47eeb70: Pull complete c1bbdc448b72: Pull complete 8c3b70e39044: Pull complete 45d437916d57: Pull complete d8f1569ddae6: Pull complete 85386706b020: Pull complete ee9b457b77d0: Pull complete be4f3343ecd3: Pull complete 30b4effda4fd: Pull complete Digest: sha256:31e2a1ca7b0e1f678fb1dd0c985b4223273f7c0f3dbde60053b371e2a1aee2cd Status: Downloaded newer image for nvidia/cuda:latest Wed Dec 11 18:34:37 2019 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 435.21 Driver Version: 435.21 CUDA Version: 10.1 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | |===============================+======================+======================| | 0 GeForce GTX 1060 Off | 00000000:01:00.0 On | N/A | | N/A 38C P8 4W / N/A | 253MiB / 6075MiB | 0% Default | +-------------------------------+----------------------+----------------------+ +-----------------------------------------------------------------------------+ | Processes: GPU Memory | | GPU PID Type Process name Usage | |=============================================================================| +-----------------------------------------------------------------------------+のようにcuda入りイメージのダウンロード後、コンテナの中でnvidia-smiが実行できたら成功です。なお、このように"--gpus all"を付ければnvidia-dockerとして、付けなければただのdockerとして振る舞うようです。
docker run -dit --gpus all --name katago nvidia/cuda:10.1-cudnn7-develのようにしてコンテナをバックグラウンドで立ち上げ、
docker exec -it katago bashとしてその中に入って作業を行いました。Dockerfileとかを使わない、ダメな使い方だと思いますが、これで十分役に立っています。