LoginSignup
0
0

More than 3 years have passed since last update.

vagrant gpuパススルーをやってみた

Last updated at Posted at 2021-03-07

サルでもできるGPUパススルーを試してみた

参考サイト

サルでも~で記載された内容で つまった個所(vagrant-libvirt)のみを追記 読み返していたら詰まった箇所ありませんでした。
WindowsをゲストOSにする際にvagrantが最新でないと起動できないboxを利用していたので、つまったと勘違い。。

動作環境

Ubuntu18.04.05
手順実施前にOSインストールをしたきれいな状態で実施。

$ cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.5 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.5 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  4.15.0-136-generic #140-Ubuntu SMP Thu Jan 28 05:20:47 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

実施手順

サルでものサイトの実際にパススルーしてみるの前まで、手順通り実施
Vagrantインストールを参考に最新のdebファイルをダウンロードしてインストール
※最新にこだわらない場合はsudo apt install vagrantでOK

$ wget https://releases.hashicorp.com/vagrant/2.2.14/vagrant_2.2.14_x86_64.deb
$ sudo apt install ./vagrant_2.2.14_x86_64.de
$ vagrant -v
Vagrant 2.2.14

vagrant-libvirtインストールvagrant plugin install vagrant-libvirtまで実施
サルでものサイトの実際にパススルーしてみる以降の手順を実施
vagrant-libvirtのバージョンは0.3.0が入りました。

vagrant up⇒nvidiaドライバーをインストール⇒vm 再起動⇒nvidia-smiができることを確認

$ vagrant ssh
$ sudo apt update
$ sudo apt install nvidia-driver-460
$ exit
$ vagrant reload
$ vagrant ssh
$ nvidia-smi
nvidia-smi
Sun Mar  7 08:25:02 2021
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.39       Driver Version: 460.39       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  GeForce GTX 1080    Off  | 00000000:00:04.0 Off |                  N/A |
| 26%   37C    P0    35W / 180W |      0MiB /  8119MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

過去に同様の記事を見つけて試してみては、インストール中のどこかしらで失敗していたので、サルでもできるようにしていただき感謝

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0