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.
72 stars 9 forks source link

Stuck on boot screen after set-intel #19

Closed MohamedElidrissi closed 4 years ago

MohamedElidrissi commented 4 years ago

First of all I wanna say thank you for your work.

I have an HP Pavilion Gaming Laptop with a GTX 1050, I installed optimus-switch following all the instructions as mentioned in the README and after running set-nvidia and rebooting everything works great, I verified that the nvidia card is actually running by running a game (ETS2) and it was smooth. However after running set-intel and rebooting the HP logo flashes for a few times and then it stays on and never boots, I do have access to the tty but I have no idea what to do. Also, I tried running the gpu check script and I do see some line with "works" if that helps?

rfestag commented 4 years ago

I'm not sure if it is the same problem, but I'm having a similar issue. In my case, I just get a blank screen, and I cannot switch to a tty. I end up needing to chroot into my environment from a live usb to switch back.

I tried installing vulkan-intel, and I've tried updating my mkinitcpio.conf to build the intel modules in directly, neither of which helped (although installing vulkan-intel did get my MSI logo to flash instead of just a blank screen).

RebelLion420 commented 4 years ago

Same problem as OP here, however the gpu_switch_check.sh sent me straight to a black screen and I had to force a reboot. I just installed this Manjaro today and fully updated before trying nvidia-prime and prime-switch, but I couldnt get it to work and restored with Timeshift before trying optimus-switch. Here's an inxi -Fxxxza --no-host for reference: System: Kernel: 5.4.14-2-MANJARO x86_64 bits: 64 compiler: gcc v: 9.2.0 parameters: BOOT_IMAGE=/boot/vmlinuz-5.4-x86_64 root=UUID=db916ba8-0e3f-410a-89d6-a59795160261 rw quiet apparmor=1 security=apparmor resume=UUID=3d5c5028-b062-4abb-8335-dd9c13b04429 udev.log_priority=3 Desktop: Xfce 4.14.2 tk: Gtk 3.24.13 info: xfce4-panel wm: xfwm4 dm: LightDM 1.30.0 Distro: Manjaro Linux Machine: Type: Laptop System: Dell product: Latitude E6530 v: 01 serial: <filter> Chassis: type: 9 serial: <filter> Mobo: Dell model: 058JJW v: A00 serial: <filter> UEFI: Dell v: A22 date: 11/30/2018 Battery: ID-1: BAT0 charge: 70.3 Wh condition: 70.3/87.0 Wh (81%) volts: 12.7/11.1 model: SMP DELL XV2VV12 type: Li-ion serial: <filter> status: Full CPU: Topology: Quad Core model: Intel Core i7-3740QM bits: 64 type: MT MCP arch: Ivy Bridge family: 6 model-id: 3A (58) stepping: 9 microcode: 21 L2 cache: 6144 KiB flags: avx lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 43074 Speed: 1196 MHz min/max: 1200/3700 MHz Core speeds (MHz): 1: 1196 2: 1196 3: 1196 4: 1196 5: 1196 6: 1196 7: 1196 8: 1196 Vulnerabilities: Type: itlb_multihit status: KVM: Split huge pages Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable Type: mds mitigation: Clear CPU buffers; SMT vulnerable Type: meltdown mitigation: PTI Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl and seccomp Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization Type: spectre_v2 mitigation: Full generic retpoline, IBPB: conditional, IBRS_FW, STIBP: conditional, RSB filling Type: tsx_async_abort status: Not affected Graphics: Device-1: NVIDIA GF108GLM [NVS 5200M] vendor: Dell driver: nvidia v: 390.132 bus ID: 01:00.0 chip ID: 10de:0dfc Display: x11 server: X.Org 1.20.7 driver: nvidia unloaded: modesetting resolution: 1600x900~60Hz OpenGL: renderer: NVS 5200M/PCIe/SSE2 v: 4.6.0 NVIDIA 390.132 direct render: Yes Audio: Device-1: Intel 7 Series/C216 Family High Definition Audio vendor: Dell driver: snd_hda_intel v: kernel bus ID: 00:1b.0 chip ID: 8086:1e20 Device-2: NVIDIA GF108 High Definition Audio vendor: Dell driver: snd_hda_intel v: kernel bus ID: 01:00.1 chip ID: 10de:0bea Sound Server: ALSA v: k5.4.14-2-MANJARO Network: Device-1: Intel 82579LM Gigabit Network vendor: Dell driver: e1000e v: 3.2.6-k port: f040 bus ID: 00:19.0 chip ID: 8086:1502 IF: eno1 state: down mac: <filter> Device-2: Broadcom and subsidiaries BCM4313 802.11bgn Wireless Network Adapter vendor: Dell driver: wl v: kernel port: e000 bus ID: 03:00.0 chip ID: 14e4:4727 IF: wlp3s0 state: up mac: <filter> Drives: Local Storage: total: 698.64 GiB used: 89.09 GiB (12.8%) ID-1: /dev/sda vendor: Seagate model: ST750LM022 HN-M750MBB size: 698.64 GiB block size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s rotation: 5400 rpm serial: <filter> rev: 0001 scheme: MBR RAID: Hardware-1: Intel 82801 Mobile SATA Controller [RAID mode] driver: ahci v: 3.0 port: f020 bus ID: 00:1f.2 chip ID: 8086.282a rev: 04 Partition: ID-1: / raw size: 30.00 GiB size: 29.40 GiB (98.01%) used: 10.76 GiB (36.6%) fs: ext4 dev: /dev/sda2 ID-2: /home raw size: 660.00 GiB size: 648.64 GiB (98.28%) used: 78.33 GiB (12.1%) fs: ext4 dev: /dev/sda3 ID-3: swap-1 size: 8.14 GiB used: 0 KiB (0.0%) fs: swap swappiness: 60 (default) cache pressure: 100 (default) dev: /dev/sda4 Sensors: System Temperatures: cpu: 60.0 C mobo: 40.0 C sodimm: 39.0 C gpu: nvidia temp: 50 C Fan Speeds (RPM): cpu: 2814 Info: Processes: 240 Uptime: 15m Memory: 7.72 GiB used: 1.39 GiB (18.0%) Init: systemd v: 242 Compilers: gcc: 9.2.0 clang: 9.0.1 Shell: bash v: 5.0.11 running in: terminator inxi: 3.0.37

dglt1 commented 4 years ago

rebellion420, optimus-switch is for optimus laptops, same for prime-switch, optimus-manager, prime.

if your laptop has both integrated intel graphics and nvidia dedicated graphics it looks like you have the intel gpu disabled in bios. your inxi output only shows the nvidia gpu so you should only need the correct nvidia drivers installed via MHWD (video-nvidia-? ) and everything should work.

ranjithshegde commented 4 years ago

I'm not sure if it is the same problem, but I'm having a similar issue. In my case, I just get a blank screen, and I cannot switch to a tty. I end up needing to chroot into my environment from a live usb to switch back.

I tried installing vulkan-intel, and I've tried updating my mkinitcpio.conf to build the intel modules in directly, neither of which helped (although installing vulkan-intel did get my MSI logo to flash instead of just a blank screen).

I have the same issue, and just to add, same issue regardless of method i.e optimus-switch, optimus-manager, and no boot on bumblebeed.service enabled as it uses intel

luxusmind commented 4 years ago

Well i am having the same issue and it always stucks on Acer's bootlogo. Just to let you know i had a setup with Xfce and had no issue one year ago when i firstly tried optimus-switch. Installed Xfce some days ago and had to restore it with Usb because it will always stuck on bootlogo after i set-intel.sh. I installed Manjaro Gnome, and KDE just to see if the mistake was on Xfce but had no issue at all Optimus-Switch worked flawlessly fine and had no issue with set-intel or nvidia. I used the same nvidia-drivers for Gnome, Xfce, KDE and followed all the instructions with huge care but i am still failing.

dglt1 commented 4 years ago

your seeing the acer boot logo because of grub quiet, you can hit the escape key and it should show the boot process.

also im unclear on how your using it, you said it's always worked in the past, are you setting this up on a clean manjaro install or did you remove other desktop environments and replace with others?

the reason i ask is that which optimus-switch version you use depends entirely on what DM is being used. (lightdm, sddm, gdm).

luxusmind commented 4 years ago

your seeing the acer boot logo because of grub quiet, you can hit the escape key and it should show the boot process.

also im unclear on how your using it, you said it's always worked in the past, are you setting this up on a clean manjaro install or did you remove other desktop environments and replace with others?

the reason i ask is that which optimus-switch version you use depends entirely on what DM is being used. (lightdm, sddm, gdm).

Thank you for your fast reply @dglt1. I am using it on a clean install after i faled with Xfce i did do a clean install of KDE and installed optimus-switch following your guide without a single issue, both nvidia and intel worked, after that i did an install clean of the Manjaro gnome and installed optimus-switch again and had not a single issue. Then i installed Manjaro Xfce and no matter how much i try it always stucks on bootlogo after set-intel.sh. Just to clarify everything i own an Acer Nitro AN-515-51 with Intel Core i7-7700HQ, Intel HD 630 and Nvidia 1050 i have no option to disable none of the graphics in BIOS so that's why i always used optimus-switch which was working perfectly fine earlier. I had to reinstall Manjaro because of a update which screwed everything and after that never had success with optimus-switch on it. You quoted that pressing escape key would show the boot process and i tried but had no success, none of the tty modes seem to work and they just blink.

P.S i have never replaced desktop environments and use LightDM which is default with Xfce Manjaro.

I posted this question because i am tired of Debian and wanted to install Manjaro Xfce again together with optimus-switch.

I did a clean install of latest Manjaro Xfce, updated system and everything then proceeded with the installation of optimus-switch as described for LightDM. Again as i said early setting to intel graphics makes the laptop bootlop, had to manjaro-chroot to get back to nvidia.

Here's an inxi -Fxxxza --no-host for reference:

inxi -Fxxxza --no-host System: Kernel: 5.4.28-1-MANJARO x86_64 bits: 64 compiler: gcc v: 9.3.0 parameters: BOOT_IMAGE=/boot/vmlinuz-5.4-x86_64 root=UUID=7f295b44-13fa-4fb0-98d4-4f497a42de27 rw quiet apparmor=1 security=apparmor resume=UUID=ea5b0676-a48e-4960-95c7-301b26053df1 udev.log_priority=3 Desktop: Xfce 4.14.2 tk: Gtk 3.24.13 info: xfce4-panel wm: xfwm4 dm: LightDM 1.30.0 Distro: Manjaro Linux Machine: Type: Laptop System: Acer product: Nitro AN515-51 v: V1.21 serial: <filter> Mobo: KBL model: Freed_KLS v: V1.21 serial: <filter> UEFI: Insyde v: 1.21 date: 11/02/2018 Battery: ID-1: BAT1 charge: 40.2 Wh condition: 40.2/48.9 Wh (82%) volts: 16.8/15.2 model: LG 004B384234314341 type: Li-ion serial: <filter> status: Full CPU: Topology: Quad Core model: Intel Core i7-7700HQ bits: 64 type: MT MCP arch: Kaby Lake family: 6 model-id: 9E (158) stepping: 9 microcode: CA L2 cache: 6144 KiB flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 44817 Speed: 801 MHz min/max: 800/3800 MHz Core speeds (MHz): 1: 800 2: 800 3: 800 4: 800 5: 800 6: 800 7: 800 8: 801 Vulnerabilities: Type: itlb_multihit status: KVM: Split huge pages Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable Type: mds mitigation: Clear CPU buffers; SMT vulnerable Type: meltdown mitigation: PTI Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl and seccomp Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization Type: spectre_v2 mitigation: Full generic retpoline, IBPB: conditional, IBRS_FW, STIBP: conditional, RSB filling Type: tsx_async_abort status: Not affected Graphics: Device-1: Intel HD Graphics 630 vendor: Acer Incorporated ALI driver: i915 v: kernel bus ID: 00:02.0 chip ID: 8086:591b Device-2: NVIDIA GP107M [GeForce GTX 1050 Mobile] vendor: Acer Incorporated ALI driver: nvidia v: 440.64 bus ID: 01:00.0 chip ID: 10de:1c8d Display: x11 server: X.Org 1.20.8 driver: modesetting,nvidia resolution: 1920x1080~60Hz OpenGL: renderer: GeForce GTX 1050/PCIe/SSE2 v: 4.6.0 NVIDIA 440.64 direct render: Yes Audio: Device-1: Intel CM238 HD Audio vendor: Acer Incorporated ALI driver: snd_hda_intel v: kernel bus ID: 00:1f.3 chip ID: 8086:a171 Device-2: NVIDIA GP107GL High Definition Audio vendor: Acer Incorporated ALI driver: snd_hda_intel v: kernel bus ID: 01:00.1 chip ID: 10de:0fb9 Sound Server: ALSA v: k5.4.28-1-MANJARO Network: Device-1: Qualcomm Atheros QCA6174 802.11ac Wireless Network Adapter vendor: Lite-On driver: ath10k_pci v: kernel port: 4000 bus ID: 02:00.0 chip ID: 168c:003e IF: wlp2s0 state: up mac: <filter> Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Acer Incorporated ALI driver: r8169 v: kernel port: 3000 bus ID: 03:00.1 chip ID: 10ec:8168 IF: enp3s0f1 state: down mac: <filter> Drives: Local Storage: total: 238.47 GiB used: 15.07 GiB (6.3%) ID-1: /dev/nvme0n1 vendor: Intel model: SSDPEKKW256G7 size: 238.47 GiB block size: physical: 512 B logical: 512 B speed: 31.6 Gb/s lanes: 4 serial: <filter> rev: PSF109C scheme: GPT Partition: ID-1: / raw size: 229.37 GiB size: 224.77 GiB (97.99%) used: 15.07 GiB (6.7%) fs: ext4 dev: /dev/nvme0n1p2 ID-2: swap-1 size: 8.80 GiB used: 0 KiB (0.0%) fs: swap swappiness: 60 (default) cache pressure: 100 (default) dev: /dev/nvme0n1p3 Sensors: System Temperatures: cpu: 55.0 C mobo: 29.8 C gpu: nvidia temp: 52 C Fan Speeds (RPM): N/A Info: Processes: 232 Uptime: 1m Memory: 7.66 GiB used: 959.1 MiB (12.2%) Init: systemd v: 244 Compilers: gcc: 9.3.0 Shell: bash v: 5.0.16 running in: xfce4-terminal inxi: 3.0.37

dglt1 commented 4 years ago

if you already edited /etc/switch/no-optimus.sh and uncommented those 2 lines, i suggest you to comment them out again to rule that out as a possible cause. (you would set intel mode again after edit to apply the changes).

if you did not edit that yet you can leave it alone for now, and just to clarify you are using a fresh install from the manjaro xfce iso that uses lightdm (default on xfce iso) ? also make sure you have xf86-video-intel installed as optimus-switch requires it to function with it's default setup. if you want to see if maybe the modesetting driver works better for you then you can test the included modesetting configuration on a temporary basis by running these commands.

sudo set-intel.sh sudo rm /etc/X11/xorg.conf.d/99-intel.conf sudo cp /etc/switch/intel/modeset-xorg.conf /etc/X11/xorg.conf.d/99-intel.conf then reboot and see if xorg is able to start with modesetting driver, if it does you can edit 1 line in /usr/local/bin/set-intel.sh to tell it to use the modesetting instead of intel driver. first test it temporary as shown above. On Apr 3 2020, at 1:57 pm, luxusmind notifications@github.com wrote:

your seeing the acer boot logo because of grub quiet, you can hit the escape key and it should show the boot process. also im unclear on how your using it, you said it's always worked in the past, are you setting this up on a clean manjaro install or did you remove other desktop environments and replace with others? the reason i ask is that which optimus-switch version you use depends entirely on what DM is being used. (lightdm, sddm, gdm). Thank you for your fast reply dglt1. I am using it on a clean install after i faled with Xfce i did do a clean install of KDE and installed optimus-switch following your guide without a single issue, both nvidia and intel worked, after that i did an install clean of the Manjaro gnome and installed optimus-switch again and had not a single issue. Then i installed Manjaro Xfce and no matter how much i do it always stucks on bootlogo after set-intel.sh. Just to clarify everything i own an Acer Nitro AN-515-51 with Intel Core i7-7700HQ, Intel HD 630 and Nvidia 1050 i have no option to disable none of the graphics in BIOS so that's why i always used optimus-switch which was working perfectly fine earlier. I had to reinstall Manjaro because of a update which screwed everything and after that never had success with optimus-switch on it. You quoted that pressing escape key would show the boot process and i tried but had no success, none of the tty modes seem to work and they just blink.

I posted this question because i am tired of Debian and wanted to install Manjaro Xfce again together with optimus-switch. — You are receiving this because you commented. Reply to this email directly, view it on GitHub (https://link.getmailspring.com/link/5E1876F1-E3B7-4290-86D1-5FB4D998BBED@getmailspring.com/0?redirect=https%3A%2F%2Fgithub.com%2Fdglt1%2Foptimus-switch%2Fissues%2F19%23issuecomment-608579647&recipient=cmVwbHkrQUxMSkJCRk1SRzZGTkVIWlRWN05ENFY0U05OQVZFVkJOSEhDQlRLR1RRQHJlcGx5LmdpdGh1Yi5jb20%3D), or unsubscribe (https://link.getmailspring.com/link/5E1876F1-E3B7-4290-86D1-5FB4D998BBED@getmailspring.com/1?redirect=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FALLJBBBV6QB7X7X4KEQSQXLRKYPQVANCNFSM4KHHDYEQ&recipient=cmVwbHkrQUxMSkJCRk1SRzZGTkVIWlRWN05ENFY0U05OQVZFVkJOSEhDQlRLR1RRQHJlcGx5LmdpdGh1Yi5jb20%3D).

luxusmind commented 4 years ago

UPDATE: I moved back to KDE and everything's working fine here, i'll try Xfce with optimus-switch later on when i got time. Thank you!

if you already edited /etc/switch/no-optimus.sh and uncommented those 2 lines, i suggest you to comment them out again to rule that out as a possible cause. (you would set intel mode again after edit to apply the changes). if you did not edit that yet you can leave it alone for now, and just to clarify you are using a fresh install from the manjaro xfce iso that uses lightdm (default on xfce iso) ? also make sure you have xf86-video-intel installed as optimus-switch requires it to function with it's default setup. if you want to see if maybe the modesetting driver works better for you then you can test the included modesetting configuration on a temporary basis by running these commands. sudo set-intel.sh sudo rm /etc/X11/xorg.conf.d/99-intel.conf sudo cp /etc/switch/intel/modeset-xorg.conf /etc/X11/xorg.conf.d/99-intel.conf then reboot and see if xorg is able to start with modesetting driver, if it does you can edit 1 line in /usr/local/bin/set-intel.sh to tell it to use the modesetting instead of intel driver. first test it temporary as shown above. On Apr 3 2020, at 1:57 pm, luxusmind @.> wrote: > your seeing the acer boot logo because of grub quiet, you can hit the escape key and it should show the boot process. > also im unclear on how your using it, you said it's always worked in the past, are you setting this up on a clean manjaro install or did you remove other desktop environments and replace with others? > the reason i ask is that which optimus-switch version you use depends entirely on what DM is being used. (lightdm, sddm, gdm). Thank you for your fast reply dglt1. I am using it on a clean install after i faled with Xfce i did do a clean install of KDE and installed optimus-switch following your guide without a single issue, both nvidia and intel worked, after that i did an install clean of the Manjaro gnome and installed optimus-switch again and had not a single issue. Then i installed Manjaro Xfce and no matter how much i do it always stucks on bootlogo after set-intel.sh. Just to clarify everything i own an Acer Nitro AN-515-51 with Intel Core i7-7700HQ, Intel HD 630 and Nvidia 1050 i have no option to disable none of the graphics in BIOS so that's why i always used optimus-switch which was working perfectly fine earlier. I had to reinstall Manjaro because of a update which screwed everything and after that never had success with optimus-switch on it. You quoted that pressing escape key would show the boot process and i tried but had no success, none of the tty modes seem to work and they just blink. I posted this question because i am tired of Debian and wanted to install Manjaro Xfce again together with optimus-switch. — You are receiving this because you commented. Reply to this email directly, view it on GitHub @./0?redirect=https%3A%2F%2Fgithub.com%2Fdglt1%2Foptimus-switch%2Fissues%2F19%23issuecomment-608579647&recipient=cmVwbHkrQUxMSkJCRk1SRzZGTkVIWlRWN05ENFY0U05OQVZFVkJOSEhDQlRLR1RRQHJlcGx5LmdpdGh1Yi5jb20%3D), or unsubscribe @.***/1?redirect=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FALLJBBBV6QB7X7X4KEQSQXLRKYPQVANCNFSM4KHHDYEQ&recipient=cmVwbHkrQUxMSkJCRk1SRzZGTkVIWlRWN05ENFY0U05OQVZFVkJOSEhDQlRLR1RRQHJlcGx5LmdpdGh1Yi5jb20%3D).

Thanks you for your explanation @dglt1. I did a clean install of Manjaro Xfce again. Followed the guide and finished all the steps without any issue. And yes xf86-video-intel is installed. I didn't edit any of the files and there isn't a no-optimus.sh file inside /etc/switch if you're talking about /etc/switch/intel/no-optimus.sh then yes but i haven't edited it at all. I tried your suggestion of setting modesetting driver as default but indeed that didn't worked and the results were the same a boot loop without a functional TTY mode. I chrooted again using the Live USB and set-nvidia.sh to make it boot.

It is tough that i have followed the guide hundred times just to make sure that i didn't do something wrong but it is nonsense because i did the setup of more than 5 laptops with your optimus-switch scripts for friends in Manjaro Xfce and never encountered a single issue, without forgetting that i had no issues months ago. Everything started after doing a clean install of latest Manjaro Xfce.

Please accept my apologies for taking your precious time.

andreiboyanov commented 4 years ago

I was having the same (or similar) issue. My laptop is MSI GS659SE with the following video cards:

My desktop environment is LightDM with i3 window manager. I managed to have the LightDM logins screen in Intel mode (after set-intel.sh). But after login the system was freezing.

After quit a debugging I found that the thing that was freezing the system was the ACPI call. Commenting out the following lines in /etc/switch/intel/no-optimus.sh made it possible to login:

#if [ -d "/sys/bus/pci/devices/0000:01:00.0" ]
#then
#  #echo '\_SB.PCI0.PEG0.PEGP._OFF' > /proc/acpi/call
#  #echo -n 1 > '/sys/bus/pci/devices/0000:01:00.0/remove'
#
#fi

I tried everything I could think about including to figure out which kernel modules may be still dependent on the NVidia but apparently I was still missing something - I couldn't find a working solutions. The following commands on the command line (even without starting Xorg) is perfectly freezing the system:

# echo '\_SB.PCI0.PEG0.PEGP._OFF' > /proc/acpi/call
# lspci

The solution I found and I would recommend it as replacement of the direct acpi_call is to use the bbswitch module. It's doing somehow the thing is the right way with those acpi calls and is working very well for me. I just modified the set-intel.sh and set-nvidia.sh in the following way:

To /usr/local/bin/set-intel.sh I added the following line:

echo options bbswitch load_state=0 unload_state=1 > /etc/modprobe.d/bbswitch.conf

And to /usr/local/bin/set-nvidia.sh:

echo options bbswitch load_state=1 unload_state=1 > /etc/modprobe.d/bbswitch.conf

Of course, I first installed bbswitch and added it to /etc/modules-load.d/modules.conf

SCCOBN commented 4 years ago

Man! Quit with your bbswitches and panic that set-intel.sh causes black screen on login, or stuck at login. It's not true. This is what happens when you not following install instructions, which to be fair are not clear.

Let me make it clear for you all.

Before you can execute set-intel.sh you must edit /etc/switch/intel/no-optimus.sh Execute /etc/switch/gpu_switch_check.sh find a working thingy and stick it into no-optimus.sh and uncomment two lines, as per instructions in README.

Then you will be able to set-intel.sh successfully, otherwise, executing set-intel.sh results in black screen.

Instructions from the author are simply not clear enough.

dglt1 commented 4 years ago

I was having the same (or similar) issue. My laptop is MSI GS659SE with the following video cards:

  • Device-1: Intel UHD Graphics 630
  • Device-2: NVIDIA TU106M [GeForce RTX 2060 Mobile]

My desktop environment is LightDM with i3 window manager. I managed to have the LightDM logins screen in Intel mode (after set-intel.sh). But after login the system was freezing.

After quit a debugging I found that the thing that was freezing the system was the ACPI call. Commenting out the following lines in /etc/switch/intel/no-optimus.sh made it possible to login:

#if [ -d "/sys/bus/pci/devices/0000:01:00.0" ]
#then
#  #echo '\_SB.PCI0.PEG0.PEGP._OFF' > /proc/acpi/call
#  #echo -n 1 > '/sys/bus/pci/devices/0000:01:00.0/remove'
#
#fi

I tried everything I could think about including to figure out which kernel modules may be still dependent on the NVidia but apparently I was still missing something - I couldn't find a working solutions. The following commands on the command line (even without starting Xorg) is perfectly freezing the system:

# echo '\_SB.PCI0.PEG0.PEGP._OFF' > /proc/acpi/call
# lspci

The solution I found and I would recommend it as replacement of the direct acpi_call is to use the bbswitch module. It's doing somehow the thing is the right way with those acpi calls and is working very well for me. I just modified the set-intel.sh and set-nvidia.sh in the following way:

To /usr/local/bin/set-intel.sh I added the following line:

echo options bbswitch load_state=0 unload_state=1 > /etc/modprobe.d/bbswitch.conf

And to /usr/local/bin/set-nvidia.sh:

echo options bbswitch load_state=1 unload_state=1 > /etc/modprobe.d/bbswitch.conf

Of course, I first installed bbswitch and added it to /etc/modules-load.d/modules.conf

sorry for the late response, i dont get on here as much lately. glad to hear you figured a workaround with bbswitch. im gonna close this but if you have any other questions it can be re-opened.

Man! Quit with your bbswitches and panic that set-intel.sh causes black screen on login, or stuck at login. It's not true. This is what happens when you not following install instructions, which to be fair are not clear.

Let me make it clear for you all.

no need to get hostile with other people asking for help.

Instructions from the author are simply not clear enough. aside from my terrible overuse of bulleted style layout i used to have in the readme. when i wrote the directions i did so with new users in mind and tried to anticipate points of possible failure but adding anything more to the directions will only confuse people more than it would help them.