somebody prevents the kernel driver to unload
so I have a very special case her where I'm using two gfx cards and one is used for qemu in passthrough mode so I can use 3d in windows.
Problem is that my particular card defaults to having the fan on max until the driver sets is slower. (radeon 7970) So setup is as follows. on boot the vfio-pci driver get bound to the pci device so the linux radeon driver do not get loaded and fan is at max if I start qemu win10 loads a driver and the fan is slow again that is fine but constantly running qemu just to not hear the fan is kind of a resource hog. so quitting qemu the fan is at max again. but I can fix that by unbind the vfio-pci driver from the pci device, like echo "0000:05:00.0" >/sys/bus/pci/devices/0000:05:00.0/driver/unbind
then load the linux radeon kernel driver. modprobe radeon. now the fan is slow again.
so everything works but now there is a problem I can not rmmod the radeon driver now. its in use something has opened it. this is what I see in the log-
/usr/lib/gdm3/gdm-x-session: (II) systemd-logind: got fd for /dev/dri/card1 226:1 fd 68 paused 0
and then I see /usr/lib/gdm3/gdm-x-session: (II) modeset(G0): using drv /dev/dri/card1
hmmm !#¤!"#¤ I want it to release that card so I can unbind the radeon driver and bind vfio_pci so I can start qemu without having to reboot the computer. that was kind of the reason to use qemu in the fist place.
so do anybody know how to get gdm to release the card or not use it to start with ?