2026-10-25 04:48 UTC
Ok, code I started before the gaming, was to make the terminal query KMS to find out the active GPU. Find a GPU with connectors attached to it (means its plugged into a monitor). Use that GPU.
Sounds simple enough. And sure enough, it works. Works really well. There were some wrinkles tho.
Officially, according to kernel.org, applications open `/dev/gpu/card0` if they are going to do KMS things. Setting modes. Compositors do this. Apps not doing compositing should open `/dev/gpu/render0`, and do their buffer things there.
Thing is, kernel.org is full of shit. Maybe that was true in the past, but nowadays, you can just use the primary node `/dev/gpu/card0` in either case. In fact trying to get the render nodes behaving has been a major pain point.
Replies (1)
-
@sophia81@icosahedron.website 2026-10-25 04:51
Now, if you try to open a CRTC (one of the latter steps of setting a video mode) on a X11/Wayland session, it will correctly say "permission denied". From a linux terminal, it will let you open one. No special permissions needed. So yeah, now I try to initialise KMS even if I expect to use a compositor, just to find out which GPU I should use. So "running without X11/Wayland" is a feature my programs have that can't be turned off anymore. 😅