Permanently disable nvidia dGPU on laptop?

Hello,

I have a laptop with a 5800u and a 3050ti. I have found trying to get optimus to work is generally more pain than its worth, especially considering battery life (it just never seems to sleep properly). Therefor, I would like to only use my AMD apu in linux and if i really need to use the nvidia card i’ll just boot into windows.

I am able to disable the card by running:

echo 1 > /sys/devices/pci0000:00/0000:00:01.1/0000:01:00.0/remove

Which works fine, total package power goes from 24w to < 10w at idle. But it just re-enables every time I boot. I know I can add a udev rule to do this automatically but I was wondering 1) why does it keep re-enabling? and 2) is there a way to permanently disable whatever is re-enabling the nvidia gpu? Or is it just part of the kernel(?) and all I can do is create the udev rule?

1 Like

Because you’re writing to a non-persistent runtime value.

Rip out the hardware?

Or, just create a tmpfiles.d entry and have it run on boot.

Also keep in mind that you may need the dGPU to make secondary display outputs functional because of the way they are wired to either the iGPU or dGPU.

Thanks!

Secondary question: if I set the udev rule to disable it on boot. is there a way to re-enable it without deleting the rule?

Welcome to the purple space!!
:enos_flag: :rocketa_purple: