The guest gpu device can be figured out, so that it avoids having to pass two arguments.
$ ls -l /dev/dri/by-path
lrwxrwxrwx 1 root root 8 Aug 30 18:06 pci-0000:04:00.0-card -> ../card0
lrwxrwxrwx 1 root root 13 Aug 30 18:06 pci-0000:04:00.0-render -> ../renderD128
lrwxrwxrwx 1 root root 8 Aug 30 18:06 pci-0000:2d:00.0-card -> ../card1
lrwxrwxrwx 1 root root 13 Aug 30 18:06 pci-0000:2d:00.0-render -> ../renderD129
$ sudo lsof /dev/dri/card0
$ sudo lsof /dev/dri/renderD128
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
Xorg 3444 root 22u CHR 226,128 0t0 348 /dev/dri/renderD128
Xorg 3444 root 37u CHR 226,128 0t0 348 /dev/dri/renderD128
code 14353 saverio 23u CHR 226,128 0t0 348 /dev/dri/renderD128
code 14361 saverio 23u CHR 226,128 0t0 348 /dev/dri/renderD128
$ sudo lsof /dev/nvidia0
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
Xorg 3444 root mem CHR 195,0 648 /dev/nvidia0
Xorg 3444 root 17u CHR 195,0 0t0 648 /dev/nvidia0
Xorg 3444 root 18u CHR 195,0 0t0 648 /dev/nvidia0
Xorg 3444 root 19u CHR 195,0 0t0 648 /dev/nvidia0
Xorg 3444 root 24u CHR 195,0 0t0 648 /dev/nvidia0
Xorg 3444 root 25u CHR 195,0 0t0 648 /dev/nvidia0
Xorg 3444 root 28u CHR 195,0 0t0 648 /dev/nvidia0
Xorg 3444 root 29u CHR 195,0 0t0 648 /dev/nvidia0
Xorg 3444 root 30u CHR 195,0 0t0 648 /dev/nvidia0
Xorg 3444 root 34u CHR 195,0 0t0 648 /dev/nvidia0
Xorg 3444 root 35u CHR 195,0 0t0 648 /dev/nvidia0
$ sudo lsof /dev/dri/card1
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
Xorg 3444 root mem CHR 226,1 503 /dev/dri/card1
Xorg 3444 root 14u CHR 226,1 0t0 503 /dev/dri/card1
Xorg 3444 root 15u CHR 226,1 0t0 503 /dev/dri/card1
$ sudo lsof /dev/dri/renderD129
Heuristic: If the card is '/dev/dri/card1' and '/dev/nvidia1' exists, then it's it; in any other case, it's '/dev/nvidia0'.