dglt1 / optimus-switch

*installer finished* installs nvidia prime and makes switching to intel only and back again easy as one command. intel mode fully disables the nvidia gpu to extend battery life.
71 stars 9 forks source link

set-nvidia.sh sometimes works, sometimes doesn't...here is the FIX!! #29

Open SCCOBN opened 3 years ago

SCCOBN commented 3 years ago

The trick that did it for me was to add all the lines that worked in gpu check to no-optimus.sh, like this:

` if [ -d "/sys/bus/pci/devices/0000:01:00.0" ]
then
echo '_SB.PCI0.P0P2.VGA._OFF' > /proc/acpi/call
echo '_SB.PCI0.POP2.VGA.PX02' > /proc/acpi/call
echo '_SB.PCI0.GFX0._DSM' > /proc/acpi/call

echo -n 1 > '/sys/bus/pci/devices/0000:01:00.0/remove'

fi `

Now it seems to work.