NVIDIAのCUDA10とcuDNNをUbuntu18.04にインストール

### NVIDIAのパッケージレポジトリを追加
$ wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-repo-ubuntu1804_10.0.130-1_amd64.deb
$ sudo dpkg -i cuda-repo-ubuntu1804_10.0.130-1_amd64.deb
$ sudo apt-key adv –fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
$ sudo apt-get update
wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/nvidia-machine-learning-repo-ubuntu1804_1.0.0-1_amd64.deb
$ sudo apt install ./nvidia-machine-learning-repo-ubuntu1804_1.0.0-1_amd64.deb
$ sudo apt-get update

### NVIDIAのドライバーをインストールして再起動
$ apt install ubuntu-drivers-common
$ ubuntu-drivers devices
== /sys/devices/pci0000:00/0000:00:04.0 ==
modalias : pci:v000080EEd0000CAFEsv00000000sd00000000bc08sc80i00
vendor : InnoTek Systemberatung GmbH
model : VirtualBox Guest Service
manual_install: True
driver : virtualbox-guest-dkms – distro non-free
driver : virtualbox-guest-dkms-hwe – distro non-free

== /sys/devices/pci0000:00/0000:00:02.0 ==
modalias : pci:v000080EEd0000BEEFsv00000000sd00000000bc03sc00i00
vendor : InnoTek Systemberatung GmbH
model : VirtualBox Graphics Adapter
driver : virtualbox-guest-x11 – distro non-free

$ sudo ubuntu-drivers autoinstall
Reading package lists… Done
Building dependency tree
Reading state information… Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
virtualbox-guest-dkms-hwe : Conflicts: virtualbox-guest-dkms
E: Unable to correct problems, you have held broken packages.

なんでや、vagrant環境だからか??