Skip to content

Instantly share code, notes, and snippets.

@chexov
Last active August 29, 2017 01:02
Show Gist options
  • Save chexov/563f999305549ae8a4f6c44026d45c35 to your computer and use it in GitHub Desktop.
Save chexov/563f999305549ae8a4f6c44026d45c35 to your computer and use it in GitHub Desktop.
lxc 2 passthrough nvidia cuda

GPU as profile

lxc profile create gpu
lxc profile device add gpu /dev/nvidia0 unix-char path=/dev/nvidia0
lxc profile device add gpu /dev/nvidia1 unix-char path=/dev/nvidia1
lxc profile device add gpu /dev/nvidiactl unix-char path=/dev/nvidiactl
lxc profile device add gpu /dev/nvidia-uvm unix-char path=/dev/nvidia-uvm
lxc profile device add gpu  /dev/nvidia-uvm-tools unix-char path=/dev/nvidia-uvm-tools

lxc profile assign modelAgency default,gpu

GPU as device

lxc config device add anton-dev  /dev/nvidia0 unix-char path=/dev/nvidia0
lxc config device add anton-dev  /dev/nvidia1 unix-char path=/dev/nvidia1
lxc config device add anton-dev  /dev/nvidiactl unix-char path=/dev/nvidiactl
lxc config device add anton-dev  /dev/nvidia-uvm unix-char path=/dev/nvidia-uvm
lxc config device add anton-dev  /dev/nvidia-uvm-tools unix-char path=/dev/nvidia-uvm-tools
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment