Since I have heard of Trunas Scale, I have been really enthusiastic about it.
I have good knowledge of kubernetes, and so I wanted to mess around with it.
I ended up installing it on my desktop, and now it's my NAS. (I know it's in beta..)
On version 20.10, I deployed plex as a Docker container. I passed through volumes, for media, and my intel gpu for hardware transcoding.
Now that version 20.12 is out, I switch the Plex deployment to the helm chart provided by IX.
It was easy to use the same volumes as for the Docker container. However, there is no mention for the intel gpu passthrough.
If you use an Nvidia GPU, it's easier because they already included the Nvidia device plugin.
Just deploy plex with the GUI, then go on the command line as root and run:
For intel, we first need to install the device plugin for k8s.
On the truenas terminal, as root, you first need to gain control of the k8s cluster with kubectl
Now you can run
To deploy the device plugin, you should only have to run :
However, it didn't work for me. I had to clone the git repo, and then apply the config
Wait a minute or two, and check if it has work:
You should see: "i915: 1"
Now, we need to pass the device to our Plex deployment. Unfortunately, we can't do it through the Helm chart, as the value we need to pass ({"values":{"gpuConfiguration": {"gpu.intel.com/i915": 1}}}) is not supported.
We therefore need to directly modify the k8s deployment
Now find the line ressources: {} in spec:{containers:{..}} and replace it by:
The pod will restart, and your plex instance should now use hardware decoding and reduce your CPU usage !
Don't forget that you need a Plex Pass for this feature, and you need to enable it in the settings.
The deployment configuration will most likely be overwritten by any new update. But this is just a temporary solution, as I'm sure the IXsystems team will include this feature in future version.
I have good knowledge of kubernetes, and so I wanted to mess around with it.
I ended up installing it on my desktop, and now it's my NAS. (I know it's in beta..)
On version 20.10, I deployed plex as a Docker container. I passed through volumes, for media, and my intel gpu for hardware transcoding.
Now that version 20.12 is out, I switch the Plex deployment to the helm chart provided by IX.
It was easy to use the same volumes as for the Docker container. However, there is no mention for the intel gpu passthrough.
If you use an Nvidia GPU, it's easier because they already included the Nvidia device plugin.
Just deploy plex with the GUI, then go on the command line as root and run:
midclt call -job chart.release.update 'plex' '{"values":"gpuConfiguration": {"nvidia.com/gpu": 1}}'
For intel, we first need to install the device plugin for k8s.
On the truenas terminal, as root, you first need to gain control of the k8s cluster with kubectl
Code:
alias kubectl="k3s kubectl" export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
Now you can run
kubectl get node
to see your node statusTo deploy the device plugin, you should only have to run :
Code:
kubectl apply -k https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/gpu_plugin?ref=v0.19.0
However, it didn't work for me. I had to clone the git repo, and then apply the config
Code:
git clone https://github.com/intel/intel-device-plugins-for-kubernetes.git cd intel-device-plugins-for-kubernetes git checkout v0.19.0 kubectl apply -n kube-system apply -k deployments/gpu_plugin
Wait a minute or two, and check if it has work:
kubectl get nodes -o=jsonpath="{range .items[*]}{.metadata.name}{'\n'}{' i915: '}{.status.allocatable.gpu\.intel\.com/i915}{'\n'}"
You should see: "i915: 1"
Now, we need to pass the device to our Plex deployment. Unfortunately, we can't do it through the Helm chart, as the value we need to pass ({"values":{"gpuConfiguration": {"gpu.intel.com/i915": 1}}}) is not supported.
We therefore need to directly modify the k8s deployment
kubectl -n ix-plex edit deployment plex
Now find the line ressources: {} in spec:{containers:{..}} and replace it by:
Code:
resources: limits: gpu.intel.com/i915: "1"
The pod will restart, and your plex instance should now use hardware decoding and reduce your CPU usage !
Don't forget that you need a Plex Pass for this feature, and you need to enable it in the settings.
The deployment configuration will most likely be overwritten by any new update. But this is just a temporary solution, as I'm sure the IXsystems team will include this feature in future version.