Plex - Dell Tiny PCs - Intel Coffeelake GPU - card0/card1

systemwizard

New Member
Jun 1, 2024
10
4
3
I used ttech's scripts to install plex on one of my proxmox machine. That script also creates card1/0 and passes it through to the plex lxc. In my not so smart brain.. I used that script to create plex lxcs on my other proxmox servers as well and then delete them all except one. The problem now is that 2 proxmox servers have it as card0 and other 2 have it as card1.

  • pmox04 - card1
  • pmox05 - card1
  • pmox06 - card0
  • pmox07 - card0
Is there was way I can rename the card0 to card1 ? Plex is the only lxc using it and I would love to have all machines on card1 if possible so that when I migrate or use HA, it would move over without any issues. Can I create a symlink or point card1 to card0 ? any ideas suggestions as welcome.
 
Maybe ask ttech, as they are their scripts?

EDIT: There are many threads from people running into problems by running third-party scripts without understanding why and what they do. I do hope you find someone that knows those scripts and understands your problem.
 
Last edited:
  • Like
Reactions: cheiss
@systemwizard Where you're saying "card0" "card1" and so on, that bit isn't clear. Are you meaning it created virtual network devices ("vmbrX"?) inside your Proxmox install, and that's what you're wanting to change?

If so, their definition is in the text file at /etc/network/interfaces, and you can edit that file with a text editor to rename things (carefully!).

That being said, it sounds like you're not super experienced with this stuff and it could go badly.

Um, maybe provide some screenshots of the problem to give us a better idea what's wrong, so we can figure out better way to fix things? :)
 
Last edited:
Sure @justinclift , Thank you. Here are more details.

This script from tteck ( https://github.com/tteck/Proxmox/raw/main/ct/plex.sh ) , creates a plex lxc and also passes the intel quick sync gpu to it so that it can do transcoding as well. This creates the following and passes it to the lxc

root@pmox04:~# cd /dev/dri
root@pmox04:/dev/dri# ls -ltr
total 0
crw-rw---- 1 root render 226, 128 May 29 13:44 renderD128
crw-rw---- 1 root video 226, 1 May 29 13:44 card1
drwxr-xr-x 2 root root 80 May 29 13:44 by-path
root@pmox04:/dev/dri#

Now on two of the proxmox nodes it is card1 and on the other two is is card0

root@pmox06:~# cd /dev/dri
root@pmox06:/dev/dri# ls -ltr
total 0
crw-rw---- 1 root render 226, 128 May 29 19:18 renderD128
crw-rw---- 1 root video 226, 0 May 29 19:18 card0
drwxr-xr-x 2 root root 80 May 29 19:18 by-path


is there a way I can make it all the same i.e. card0 or card1 ? currently I have Plex HA between node4 and node 5 because they both have it as card1. Any guidance is appreciated. Below is lxc config for plex.

root@pmox05:/etc/pve/lxc# cat 116.conf | grep -v "#"
arch: amd64
cores: 4
dev0: /dev/dri/card1,gid=44
dev1: /dev/dri/renderD128,gid=104
features: keyctl=1,nesting=1
hostname: plex3
memory: 2048
mp0: /mnt/pve/Media/,mp=/media/NAS/Media,,shared=1
net0: name=eth0,bridge=vmbr0,hwaddr=BC:24:11:9E:4A:75,ip=dhcp,type=veth
onboot: 1
ostype: ubuntu
rootfs: Syno102Prox1:116/vm-116-disk-0.raw,size=50G
startup: order=5,up=20,down=60
swap: 512
tags: ha;proxmox-helper-scripts
unprivileged: 1
 
Oh, interesting. I haven't personally done any passing through of cards, so I'm not able to tell you the exact details of how to fix it.

That said, I have some ideas. :D

With Proxmox, the vast majority of its running configuration gets stored as text files under the /etc/pve directory, and if you update those text files you can change the runtime configuration. So, that's one part of things.

The other part of things is the name of the device under the /dev/ structure.

I think you'll be able to change those cards to use whatever name you want by using udev rules. At least, that's what most "lets do something with the /dev devices" stuff uses.

It's not an area I personally touch much, so my suggestion is to look for info online for renaming an intel card using udev rules.
Probably also worth checking if the tteck repository has existing scripts or info in it for using udev. There might be another script in there which can be modified to work without too much effort. :)

Oh, there's also a large amount of udev rules (they're also just text files) on Proxmox systems under /usr/lib/udev/rules.d. Could be a useful source of info to draw from. :)
 
Last edited:
Found something interesting. There's an existing /usr/lib/udev/rules.d/60-drm.rules files that seems to be involved with the setup of your card names.

Bash:
# cat /usr/lib/udev/rules.d/60-drm.rules
# do not edit this file, it will be overwritten on update

ACTION!="remove", SUBSYSTEM=="drm", SUBSYSTEMS=="pci|usb|platform", IMPORT{builtin}="path_id"

# by-path
ENV{ID_PATH}=="?*", KERNEL=="card*", SYMLINK+="dri/by-path/$env{ID_PATH}-card"
ENV{ID_PATH}=="?*", KERNEL=="controlD*", SYMLINK+="dri/by-path/$env{ID_PATH}-control"
ENV{ID_PATH}=="?*", KERNEL=="renderD*", SYMLINK+="dri/by-path/$env{ID_PATH}-render"

(after making a backup!) you might be able to change it to do what you want.

The warning at the top about "do not edit this file, it will be overwritten on update" probably means you can store an override for this file in some other directory too and not have it overwritten. But that's just me guessing. :)
 
@justinclift , Thank you. A hacky solution ( before I get into udev rules ) , was to create a symlink from card0 to card1. This allowed Plex to migrate over without any issues or complaints. Yes, it does not survive reboot but that is an easy fix. Onto UDEV for a more permanent solution.

root@pmox07:/dev/dri# ls -ltr
total 0
crw-rw---- 1 root render 226, 128 May 29 19:19 renderD128
crwxrwxrwx 1 root video 226, 0 May 29 19:19 card0
drwxr-xr-x 2 root root 80 May 29 19:19 by-path
lrwxrwxrwx 1 root root 14 May 29 19:22 card1 -> /dev/dri/card0
 
  • Like
Reactions: justinclift
Good thinking, the symlink approach to get it going was a smart workaround.

If the udev thing doesn't work out, then you can probably create a script to automatically do the symlink creation at boot time.

Hmmm, I wonder if just outright renaming the device under /dev would work too (ie "mv /dev/card1 /dev/card0")?

If so, that could be another option. :)
 
Last edited:
I have recently noticed some unexpected changes to device nodes.
A USB bus now gets assigned to /dev/bus/usb/002 where as it had been 001 previously. The intel gpu node /dev/dri/card0 has become card1 (now there's no card0). This seems to have occurred since kernel 6.8.
The USB numbering, I thought, may have changed due to the order of probing hardware in the newer kernel. But I haven't found the reason for the absence of /dev/dri/card0 (or why numbering now starts at 1).
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!