CPU | Core i5 (8Gen) 6Core 3GHz |
MEM | 32GB |
SSD | 512GB |
HDD | 1TB |
GPU | RTX2070 8GB |
SSD | /boot/efi | efi | 537MB | 537MBの根拠は http://www.rodsbooks.com/efi-bootloaders/principles.html |
SSD | / | ext4 | 512GB | |
HDD | swap | 128GB | hibernateのため、最低必要量(メモリ容量の2倍)の2倍を確保 | |
HDD | /home | ext4 | 256GB | まぁ余裕見て |
HDD | /opt | ext4 | 547GB | kubernates/dockerのイメージとか、Dataとか |
$ sudo apt install pm-utils $ sudo apt install molly-guard $ sudo apt install uswsusp
- HIBERNATE_MODE=shutdown + HIBERNATE_MODE=platform
$ sudo pm-hibernate
/var/crash$ sudo cat susres.2020-03-30_22\:34\:41.394025.crash ProblemType: KernelOops Annotation: This occurred during a previous hibernation, and prevented the system from resuming properly. Architecture: amd64 ... Package: linux-image-5.3.0-42-generic 5.3.0-42.34~18.04.1 ...
$ LANG=C xdg-user-dirs-gtk-update
$ cat /etc/os-release NAME="Ubuntu" VERSION="18.04.4 LTS (Bionic Beaver)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 18.04.4 LTS" VERSION_ID="18.04" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=bionic UBUNTU_CODENAME=bionic $ uname -a Linux GPU1 5.3.0-42-generic #34~18.04.1-Ubuntu SMP Fri Feb 28 13:42:26 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
適用可否 | ドライバ | Linux Kernel 5 | 備考 |
○ | https://github.com/cilynx/rtl88x2bu | 対応 | |
☓ | https://github.com/RinCat/RTL88x2BU-Linux-Driver.git | 対応 | kernelエラー |
☓ | https://github.com/jeremyb31/rtl8822bu | 未対応 |
$ sudo apt install git make gcc dkmsあとは配布元の指示に従って make する
$ iw dev phy#0 Interface wlx503eaadaff7a ifindex 4 wdev 0x1 addr **:**:**:**:**:** ssid ap********** type managed txpower 12.00 dBm
# Let NetworkManager manage all devices on this system network: version: 2 renderer: NetworkManager wifis: wlx503eaadaff7a: addresses: [] dhcp4: true optional: true access-points: ap********: password: **********
$ sudo netplan apply
$ sudo apt install openssh-server openssh-client
これでサービス起動の設定までされちゃう。
鍵ペアを作って
$ ssh-keygen -t rsa $ cd .ssh/ $ ls id_rsa id_rsa.pub $ cat id_rsa.pub >> authorized_keys
秘密鍵を USB メモリでノートパソコン (Chromebook の Linux VM *1) に持っていけば、計算機にモニタをつないでの作業は終わり
/.ssh/config に登録する
$ nvidia-smi Tue Mar 31 16:47:36 2020 +-----------------------------------------------------------------------------+ | 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 RTX 2070 Off | 00000000:01:00.0 Off | N/A | | 20% 43C P8 19W / 175W | 167MiB / 7982MiB | 4% Default | +-------------------------------+----------------------+----------------------+ +-----------------------------------------------------------------------------+ | Processes: GPU Memory | | GPU PID Type Process name Usage | |=============================================================================| | 0 1456 G /usr/lib/xorg/Xorg 96MiB | | 0 1627 G /usr/bin/gnome-shell 69MiB | +-----------------------------------------------------------------------------+
$ sudo apt-get remove docker docker-engine docker.io containerd runc $ sudo apt-get update $ sudo apt-get 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 add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable" $ apt-get update $ sudo apt-get install docker-ce docker-ce-cli containerd.io $ sudo docker run hello-world Hello from Docker! This message shows that your installation appears to be working correctly. $ docker --version Docker version 19.03.8, build afacb8b7f0
$ 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-get update && sudo apt-get install -y nvidia-container-toolkit $ sudo systemctl restart docker
$ sudo docker run --gpus all --rm nvidia/cuda nvidia-smi Tue Mar 31 09:29:18 2020 +-----------------------------------------------------------------------------+ | 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 RTX 2070 Off | 00000000:01:00.0 Off | N/A | | 18% 30C P8 17W / 175W | 195MiB / 7982MiB | 1% Default | +-------------------------------+----------------------+----------------------+ +-----------------------------------------------------------------------------+ | Processes: GPU Memory | | GPU PID Type Process name Usage | |=============================================================================| +-----------------------------------------------------------------------------+こいつ動くぞ
--gpus all | 全部使う |
--gpus 1 | 1基使う |
--gpus '"device=0,1"' | 0番目と1番目を使う |
$ sudo groupadd docker $ sudo gpasswd -a $USER docker $ sudo systemctl restart docker
$ sudo snap install microk8s --classic --channel=1.18/stable
$ sudo microk8s status --wait-ready microk8s is running addons: cilium: disabled dashboard: disabled dns: disabled fluentd: disabled gpu: disabled helm: disabled helm3: disabled ingress: disabled istio: disabled jaeger: disabled knative: disabled kubeflow: disabled linkerd: disabled metallb: disabled metrics-server: disabled prometheus: disabled rbac: disabled registry: disabled storage: disabledほーほー、一通り揃ってますね。全部 disabled だけど
$ sudo microk8s enable dns dashboard registry
$ sudo usermod -a -G microk8s $USER
/.bash_aliases
alias kubectl='microk8s kubectl'kubectl は microk8s コマンドのオプションで実装されているけど、alias で普通の kubectl のように使える
$ kubectl get nodes NAME STATUS ROLES AGE VERSION gpu1 Ready <none> 40m v1.18.0
$ microk8s start $ microk8s stopOS起動時に自動起動される
$ sudo microk8s.enable gpu Enabling NVIDIA GPU NVIDIA kernel module detected dns is already enabled Applying manifest daemonset.apps/nvidia-device-plugin-daemonset created NVIDIA is enabled
apiVersion: v1 kind: Pod metadata: name: hello-gpu spec: containers: - name: cuda image: nvidia/cuda:latest tty: true
$ kubectl create -f hello-gpu.yml $ kubectl exec -it hello-gpu -- nvidia-smi Tue Mar 31 12:58:59 2020 +-----------------------------------------------------------------------------+ | 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 RTX 2070 Off | 00000000:01:00.0 Off | N/A | | 18% 28C P8 17W / 175W | 0MiB / 7982MiB | 0% Default | +-------------------------------+----------------------+----------------------+ +-----------------------------------------------------------------------------+ | Processes: GPU Memory | | GPU PID Type Process name Usage | |=============================================================================| | No running processes found | +-----------------------------------------------------------------------------+ふー。ひとまず構築は完了
$ sudo add-apt-repository ppa:graphics-drivers/ppa $ sudo apt update $ ubuntu-drivers devices == /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 == modalias : pci:v000010DEd00001F02sv00001462sd00003731bc03sc00i00 vendor : NVIDIA Corporation model : TU106 [GeForce RTX 2070] driver : nvidia-driver-450 - distro non-free recommended driver : nvidia-driver-450-server - distro non-free driver : nvidia-driver-440-server - distro non-free driver : nvidia-driver-418-server - distro non-free driver : nvidia-driver-435 - distro non-free driver : xserver-xorg-video-nouveau - distro free builtin $ sudo ubuntu-drivers autoinstall ※または、$ sudo apt install nvidia-driver-450 $ nvidia-smi