albert revised this gist 2 years ago. Go to revision
1 file changed, 3 insertions, 1 deletion
tutorial.md
| @@ -78,4 +78,6 @@ lxc.mount.entry = /dev/nvram dev/nvram none bind,optional,create=file | |||
| 78 | 78 | - Reboot! | |
| 79 | 79 | - See if the driver is working | |
| 80 | 80 | `nvidia-smi` | |
| 81 | - | ## Now you can install Jellyfin and use your nVidia GPU for transcoding. | |
| 81 | + | ## Now you can install Jellyfin and use your nVidia GPU for transcoding. | |
| 82 | + | ||
| 83 | + | Video tutorial: https://www.youtube.com/watch?v=-Us8KPOhOCY | |
albert revised this gist 2 years ago. Go to revision
1 file changed, 81 insertions
tutorial.md(file created)
| @@ -0,0 +1,81 @@ | |||
| 1 | + | We will pass a GPU through to a proxmox container and utilize it for video transcoding. | |
| 2 | + | ||
| 3 | + | In PVE Host shell | |
| 4 | + | ||
| 5 | + | `uname -r` | |
| 6 | + | ||
| 7 | + | - Install headers | |
| 8 | + | `apt install pve-headers` | |
| 9 | + | - Blacklist nouveau | |
| 10 | + | `nano /etc/modprobe.d/blacklist.conf` | |
| 11 | + | - Add lines | |
| 12 | + | `blacklist nouveau` | |
| 13 | + | - Update Initramfs | |
| 14 | + | `update-initramfs -u` | |
| 15 | + | - Reboot! | |
| 16 | + | ||
| 17 | + | - Install dependencies | |
| 18 | + | `apt install build-essential` | |
| 19 | + | - Download driver (https://www.nvidia.com/Download/index.aspx?lang=en-us) | |
| 20 | + | `wget {YOUR-DRIVER-URL)` | |
| 21 | + | - Make the driver file executable | |
| 22 | + | `chmod +x {YOUR-DRIVER-FILE}` | |
| 23 | + | - Install the driver | |
| 24 | + | `./{YOUR-DRIVER-FILE}` | |
| 25 | + | - Make sure the driver loads when restarted | |
| 26 | + | `nano /etc/modules-load.d/modules.conf` | |
| 27 | + | - Add lines | |
| 28 | + | ``` | |
| 29 | + | nvidia | |
| 30 | + | nvidia-modeset | |
| 31 | + | nvidia_uvm | |
| 32 | + | ``` | |
| 33 | + | - Update Initramfs | |
| 34 | + | `update-initramfs -u` | |
| 35 | + | - Create udev rules | |
| 36 | + | `nano /etc/udev/rules.d/70-nvidia.rules` | |
| 37 | + | - Add lines | |
| 38 | + | ``` | |
| 39 | + | KERNEL=="nvidia", RUN+="/bin/bash -c '/usr/bin/nvidia-smi -L && /bin/chmod 666 /dev/nvidia*'" | |
| 40 | + | KERNEL=="nvidia_modeset", RUN+="/bin/bash -c '/usr/bin/nvidia-modprobe -c0 -m && /bin/chmod 666 /dev/nvidia-modeset*'" | |
| 41 | + | KERNEL=="nvidia_uvm", RUN+="/bin/bash -c '/usr/bin/nvidia-modprobe -c0 -u && /bin/chmod 666 /dev/nvidia-uvm*'" | |
| 42 | + | ``` | |
| 43 | + | - Reboot! | |
| 44 | + | ||
| 45 | + | - Check if the driver is running | |
| 46 | + | `nvidia-smi` | |
| 47 | + | - Edit the container conf you want to passthrough to | |
| 48 | + | `nano /etc/pve/lxc/{YOUR-LXC-ID}.conf` | |
| 49 | + | - Note the output of this | |
| 50 | + | `ls -l /dev/nv*` | |
| 51 | + | - Add these lines but make sure the path (numbers) are correct | |
| 52 | + | ``` | |
| 53 | + | #Allow cgroup access | |
| 54 | + | lxc.cgroup2.devices.allow = c 195:0 rw | |
| 55 | + | lxc.cgroup2.devices.allow = c 195:255 rw | |
| 56 | + | lxc.cgroup2.devices.allow = c 195:254 rw | |
| 57 | + | lxc.cgroup2.devices.allow = c 509:0 rw | |
| 58 | + | lxc.cgroup2.devices.allow = c 509:1 rw | |
| 59 | + | lxc.cgroup2.devices.allow = c 10:144 rw | |
| 60 | + | ||
| 61 | + | #Pass through device files | |
| 62 | + | lxc.mount.entry = /dev/nvidia0 dev/nvidia0 none bind,optional,create=file | |
| 63 | + | lxc.mount.entry = /dev/nvidiactl dev/nvidiactl none bind,optional,create=file | |
| 64 | + | lxc.mount.entry = /dev/nvidia-modeset dev/nvidia-modeset none bind,optional,create=file | |
| 65 | + | lxc.mount.entry = /dev/nvidia-uvm dev/nvidia-uvm none bind,optional,create=file | |
| 66 | + | lxc.mount.entry = /dev/nvidia-uvm-tools dev/nvidia-uvm-tools none bind,optional,create=file | |
| 67 | + | lxc.mount.entry = /dev/nvram dev/nvram none bind,optional,create=file | |
| 68 | + | ``` | |
| 69 | + | - Start the container | |
| 70 | + | - In LXC shell | |
| 71 | + | `apt update && apt upgrade -y` | |
| 72 | + | - Download driver (https://www.nvidia.com/Download/index.aspx?lang=en-us) | |
| 73 | + | `wget {YOUR-DRIVER-URL)` | |
| 74 | + | - Make the driver file executable | |
| 75 | + | `chmod +x {YOUR-DRIVER-FILE}` | |
| 76 | + | - Install the driver | |
| 77 | + | `./{YOUR-DRIVER-FILE} --no-kernel-module` | |
| 78 | + | - Reboot! | |
| 79 | + | - See if the driver is working | |
| 80 | + | `nvidia-smi` | |
| 81 | + | ## Now you can install Jellyfin and use your nVidia GPU for transcoding. | |