On the host…
Install Nvidia drivers
1
2
| sudo apt install nvidia-driver-535
sudo reboot
|
Check this website, but the deb network install seemed to work best.
Nvidia Cuda Install Instructions
As of 15/10/2023 These work for ubuntu 22.04 (deb(network) install)
1
2
3
4
5
| wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt-get update
sudo apt-get -y install cuda
sudo reboot
|
Launch LXD Container
1
| lxc launch ubuntu:22.04 jelly-belly -c nvidia.runtime=true
|
Add GPU to container
1
| lxc config device add jelly-belly gpu gpu
|
1
| lxc config edit jelly-belly
|
Include the top line alongside the runtime config.
1
2
| nvidia.driver.capabilities: all
nvidia.runtime: "true"
|