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

lightdm fails in Intel mode—Nvidia GPU already disabled? #6

Closed gadanidis closed 4 years ago

gadanidis commented 4 years ago

Thanks a lot for your work on this project!

I followed all the instructions in the README about deleting .conf files, making sure optimus-manager, bbswitch, etc., are all uninstalled before installing optimus-switch. When booting after running set-nvidia.sh, everything worked as expected. However, when booting after running set-intel.sh, lightdm failed to load.

I was able to swap to a TTY, and when attempting to start lightdm from the TTY, I got the following error message:

xrandr: Output HDMI1 is not disconnected but has no modes
/usr/local/bin/optimus.sh: line 12: /sys/bus/pci/devices/0000:01:00.0/power/control: No such file or directory

If I'm understanding correctly how the script works, it seems like the NVIDIA GPU had already been disabled somehow when optimus.sh ran. I was able to work around the issue by simply commenting out line 12 of /etc/switch/intel/no-optimus.sh, and my everything now works as expected in Intel mode; lspci | grep -E "VGA|3D returns only my Intel GPU.

In other words, it's all working fine for me now, but I thought I'd let you know about this in case it's useful (to you or anyone else with the same problem).

Thanks again!

dglt1 commented 4 years ago

glad to hear you got it working, can you try uncommenting 12, and commenting lines 26 and 27 and set intel mode again to apply the changes.

depending on your hardware, your nvidia gpu might not be turning off with line 12 being commented out. after commenting out 26 and 27 and rebooting you can use a tool like powertop to see if the nvidia card is at 0% (off) or 100% (on).

a lot of cards will power themselves down without acpi_call commands as long as no nvidia modules are loaded and the power management is set to "auto" which is what line 12 does.

gadanidis commented 4 years ago

That's actually how I was running the script originally—lines 26 and 27 commented, and 12 uncommented—that resulted in lightdm failing to start. I tried it again just now and the same behaviour as in my original issue returns. I ran powertop from the TTY and no nvidia device appears in the output at all (this is also true in Intel mode with lines 12, 26 and 27 all commented). The nvidia device does appear in Nvidia mode as expected.

dglt1 commented 4 years ago

I ran powertop from the TTY and no nvidia device appears in the output at all (this is also true in Intel mode with lines 12, 26 and 27 all commented). The nvidia device does appear in Nvidia mode as expected.

so in intel mode, even with the lines for removing the nvidia gpu from sysfs commented out, the nvidia card does not show in powertop? inxi -Gxxz? lspci?

if yes, then the nvidia gpu is being powered down and removed on it's own which is odd to say the least. to power down when no nvidia drivers are loaded is common but to not show at all is odd.

i dont suppose this is an HP laptop by any chance?

anyway, try this first.

sudo nano /etc/mkinitcpio.conf edit this line to match MODULES="i915" save/exit and sudo mkinitcpio -P

then try setting intel mode and see if it starts as it should, if not try commenting out every line in /etc/switch/intel/no-optimus.sh , then set intel mode again and see if that works.

and if not, some more system info is needed. if you have a manjaro forum account it would probably be easier for troubleshooting the issue. just create a thread and include "@dglt" anywhere in the post and i'll be alerted to it, and make sure to include these terminal outputs. (or post them to a pastebin and link them here), your choice.

inxi -Fxxxza --no-host
mhwd -li
ls -laR /etc/X11 ; cat /etc/X11/xorg.conf.d/*.conf
ls -la /etc/modprobe.d ; cat /etc/modprobe.d/*.conf
ls -la /etc/modules-load.d ; cat /etc/modules-load.d/*.conf
cat /etc/lightdm/lightdm.conf
pacman -Qs | grep -Ei 'xrandr|nvidia|acpi_call|xf86-video|bumble|bbswitch|primus|optimus'
dglt1 commented 4 years ago

closed for now, if you want to post the requested outputs we can reopen it.