nvidia-xrun icon indicating copy to clipboard operation
nvidia-xrun copied to clipboard

Systemd service file only works if GPU is plugged in at startup

Open WhyNotHugo opened this issue 6 years ago • 5 comments

Given that this only runs one and exits, the systemd service only turns of the GPU if it's plugged in during startup.

If I turn on my laptop, and plug in the GPU a minute later, then the service will have already exited, and has no effect.

I believe that is should actually linger in background, or somehow monitor new devices being plugged in to work properly.

WhyNotHugo avatar Jun 03 '19 13:06 WhyNotHugo

Why would you ever need to plug the card after turning the laptop?

michelesr avatar Jun 03 '19 14:06 michelesr

I'm using an eGPU, which stays on my desk, but go back and forth with my laptop.

WhyNotHugo avatar Jun 03 '19 14:06 WhyNotHugo

Oh yeah, eGPU. Didn't know you could do that in GNU/Linux too. I'd say that given that the PM logic on nvidia-xrun relies primarily on device add/remove, that daemon could clash with it quite easily if not implemented in the right way.

Meanwhile, isn't there a way to physically turn the card off (like a switch or simply unplugging maybe)? Because you can simply set ENABLE_PM=0 and turn off the card when it's not used.

michelesr avatar Jun 03 '19 14:06 michelesr

The case itself provides power to the laptop and the PCI-E data over the same cable, so turning it off means I'd start to run on battery (it's also a USB hub as well).

I'd actually like to turn off the video card because it's quite noisy when not being used too (as well as wasting power).

WhyNotHugo avatar Jun 03 '19 14:06 WhyNotHugo

I understand. Right now the only way is to restart the systemd service or run the command manually (as root user):

$ TURN_GPU_OFF_ONLY=1 /usr/bin/nvidia-xrun

Maybe you can hook this to a udev rule?

michelesr avatar Jun 03 '19 14:06 michelesr