Last active
October 16, 2017 05:21
-
-
Save khfeng/1a7fbb75f3baa0eabafb to your computer and use it in GitHub Desktop.
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 | |
host:~$ lxc config device add cuda-trusty nvidia-uvm unix-char path=/dev/nvidia-uvm | |
# Now your container should have CUDA capability. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment