Open makkimaki opened 2 years ago
reboot, exitなども効果なし
から実施し直した。(途中、ドライババージョンコンフリクトなどのメッセージが出るため指示に対応しながら適宜アンインストールなど実施)
3番まで実施したが$nvidi-smi
は動作せず。
2番によれば$ DRIVER_VERSION=450.80.02
としているから、対応するCUDAバージョンなども整合取る必要はある。参考:https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html#cuda-major-component-versions__table-cuda-toolkit-driver-versions
まずバージョン情報の確認から。
これに沿って新しくやり直すべき? https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=18.04&target_type=deb_network
sudo apt-get --purge remove nvidia-*
sudo apt-get --purge remove cuda-*
ubuntu-drivers devices
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update
sudo apt install nvidia-driver-460
sudo reboot
nvidia-smi
$ nvidia-smi
Thu Jul 21 01:42:12 2022
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.106.00 Driver Version: 460.106.00 CUDA Version: 11.2 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 Tesla K80 On | 00000000:00:1E.0 Off | 0 |
| N/A 29C P0 69W / 149W | 0MiB / 11441MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| No running processes found |
+-----------------------------------------------------------------------------+
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin
sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub
sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /"
sudo apt-get update
sudo apt-get -y install cuda
URL:https://github.com/NVIDIA/nvidia-container-toolkit
$ nvidia-smi
が実行できたかどうかの確認
docker run --rm --gpus all nvidia/cuda:11.0.3-base-ubuntu18.04 nvidia-smi
ホスト側のprivate keyをexp_docker_env/.ssh
にコピーして、適宜Dockerfile, docker-compose.ymlの固有名を書き換えた。その後docker-compose build, docker-compose up -d で無事終了(エラーなし!)
しかしコンテナに繋がらない。ポート解放を別にしないといけないかもしれない??コンテナ内には入れている。
参考:
$ docker exec -it 99bc039ca556 bash
Agent pid 1900
/root/.ssh/makkimaki-gcp2: No such file or directory
あ、このエラーのせいか...?
関係ないわ。多分authorized_keys
の有無か。
コンテナ側に接続する方式は、
だからコンテナ側にauthorized_keysでローカルPCにある公開鍵をコピペしないといけない
ローカルPCのitermからコンテナに接続したらVScodeからも行けるようになった。ちょっとまとめ直す。
以下に注意すればコンテナにつながる
~/.ssh/authorized_keys
配置(中身はローカルPCの公開鍵)
⇒ローカル(~/.ssh/id_ed25519
)とコンテナ(~/.ssh/authorized_keys
)を対応させよう。.ssh
フォルダ必要要件authorized_keys
に書き込み
ドキュメント:https://docs.nvidia.com/datacenter/tesla/tesla-installation-notes/index.html#ubuntu-lts
更新日時:NVIDIA Driver Installation Quickstart Guide (PDF) - Last updated June 7, 2022 -
実行手順
$ nvidia-smi
を実行したが以下のエラーメッセージ現状
AWS p2.xlarge使用
Ubuntu 18.04 LTS
CUDAドライバのパッケージ管理状況