This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Suppose we already have LXD, and already add the default image repo as images: | |
# 1. Start a new Trusty LXC container | |
host:~$ lxc launch images:ubuntu/trusty/amd64 cuda-trusty | |
# 2. Download and install CUDA on *both* host & LXC container, from https://developer.nvidia.com/cuda-downloads | |
# Note that host and container have to have *exactly* the same driver version | |
# 3. Add necessary Nvidia devices to LXC container | |
host:~$ lxc config device add cuda-trusty nvidia0 unix-char path=/dev/nvidia0 | |
host:~$ lxc config device add cuda-trusty nvidiactl unix-char path=/dev/nvidiactl |