Optimus-Switch boots to black screen when using nvidia card

Hi all,
I have a hybrid Optimus card in my laptop:

$ lspci | grep -E 'VGA|3D'
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
01:00.0 VGA compatible controller: NVIDIA Corporation GF116M [GeForce GT 560M] (rev a1)

I installed Optimus-swtich following this guide Optimus Switch - Another Solution for Optimus Laptops but I’m having some problems when I switch to nvidia prime mode. When I run sudo set-nvidia.sh and reboot, X doesn’t want to start. I’m greeted with a black screen and blinking cursor…switching back to “intel only” mode everything works perfectly fine.

Going back over my installation, one thing I noticed was that I did not edit my ~/optimus-switch-sddm/switch/nvidia/nvidia-xorg.conf before installing, I actually went back afterwards and changed the format to what was suggested in the manual on the github page (I changed nvidia bus ID to 1:0:0 instead of 01:00.0 VGA). Oddly enough there was no BusID listed for the intel card in ~/optimus-switch-sddm/switch/intel/intel-xorg.conf so I didn’t change anything there.

I’ve tried using it with both the standard kernel and lts, but I have the same result. I suppose I can try un-installing optimus-switch using the uninstall script included and try again from scratch but though I’d ask here first to see if anyone had run into any similar issues.

Appreciate the help and let me know if I can provide any additional logs. Thanks!

By not editing the file BEFORE you ran the install, the conf file installed is not correct. You should not need to uninstall it. Your best option is to run the install script again. However, BEFORE you do that, you need to do the following:

  1. Open a terminal and run: lspci | grep -E 'VGA|3D' and take note of the nvidia Bus ID.

  2. After you have cloned the git repository to your home directory by typing: git clone https://github.com/dglt1/optimus-switch-sddm.git go to the following folder ~/optimus-switch-sddm/switch/nvidia and open the nvidia-xorg.conf and make sure the Bus ID matches what is listed for the nvidia card.

  3. Save the file.

  4. Now run the install script.

If you still get to a black screen when trying to run on your nvidia card, you may need to use a kernel parameter. I would suggest either acpi_osi='Windows 2012' or acpi_osi='Windows 2018' or acpi_osi=Linux

If you need help in how to apply kernel parameters, take a look at this post.

Without any further information about your system, I can’t give you any more advice. More information can be obtained by opening a terminal and typing inxi -fxxz and posting the results here. This will tell us what kind of cpu you have and what nvidia card is installed in your system.

3 Likes

Thanks @linesma so much for your help! I tried a number of things you’d suggested, starting with re-running the installation script AFTER editing nvidia-xorg.conf but unfortunately no luck with anything I’ve tried. Here’s a breakdown thus far:

I edited my ~/optimus-switch-sddm/switch/nvidia/nvidia-xorg.conf following the GitHub guide and here’s what it currently looks like:

etc/X11/xorg.conf.d/99-nvidia.conf
#adjust BusID to match your nvidia GPU
#uncomment and edit the DPI option as needed
#to fix scaling issues.


Section "Module"
    Load "modesetting"
EndSection

Section "Device"
    Identifier "nvidia"
    Driver  "nvidia"
    BusID   "PCI: 0.1.0"
    #Option  "DPI" "96 x 96"    #adjust this value as needed to fix scaling
    Option  "AllowEmptyInitialConfiguration"
EndSection

Section "Extensions"
    Option  "Composite" "Enable"
EndSection

I changed the BusID for the Nvidia to the format suggested in the GitHub guide. Compare that to the output of lspci | grep -E 'VGA|3D' in my original post for that particular card. I re-ran the installation script, issued sudo set-nvidia.sh, rebooted, and same black screen with a cursor.

Next I tried adding ACPI kernel parameters to grub as you advised - I actually started off with acpi_osi='Windows 2009' since my laptop originally came with Windows 7. Ran sudo grub-mkconfig -o /boot/grub/grub.cfg and rebooted (still in nvidia prime mode)…laptop hangs on TLP System startup/shutdown now. I tried this with the Windows 8 and Windows 10 parameters you’d suggested too and same issue. I even disabled TLP and tried again with the Windows 7 kernel parameter and still hangs on TLP system startup/shutdown. So for now I removed the Windows kernel parameter and re-enabled TLP and am back at square 1.

Here’s my output for inxi-fxxz:

$ inxi -fxxz
CPU:       Info: Quad Core model: Intel Core i7-2670QM bits: 64 type: MT MCP 
           arch: Sandy Bridge rev: 7 cache: L2: 6 MiB bogomips: 35135 
           Speed: 843 MHz min/max: 800/3100 MHz Core speeds (MHz): 1: 843 2: 798 3: 2288 
           4: 798 5: 798 6: 995 7: 798 8: 798 
           Flags: acpi aes aperfmperf apic arat arch_perfmon avx bts clflush cmov 
           constant_tsc cpuid cx16 cx8 de ds_cpl dtes64 dtherm dts epb ept est flexpriority 
           flush_l1d fpu fxsr ht ibpb ibrs ida lahf_lm lm mca mce md_clear mmx monitor msr 
           mtrr nonstop_tsc nopl nx pae pat pbe pcid pclmulqdq pdcm pebs pge pln pni popcnt 
           pse pse36 pti pts rdtscp rep_good sep ssbd sse sse2 sse4_1 sse4_2 ssse3 stibp 
           syscall tm tm2 tpr_shadow tsc tsc_deadline_timer vme vmx vnmi vpid x2apic xsave 
           xsaveopt xtopology xtpr 

Did you use the 390 series of Nvidia drivers?
The latest Nvidia driver seems to not support your card.

Actually…it looks like I’m using the Nouveau drivers. Now I feel really dumb :sweat_smile:!!

Output of sudo lspci -v | less

01:00.0 VGA compatible controller: NVIDIA Corporation GF116M [GeForce GT 560M] (rev a1) (prog-i
f 00 [VGA controller])
        Subsystem: Toshiba Corporation Device fc01
        Flags: bus master, fast devsel, latency 0, IRQ 11
        Memory at f4000000 (32-bit, non-prefetchable) [size=32M]
        Memory at d0000000 (64-bit, prefetchable) [size=256M]
        Memory at e0000000 (64-bit, prefetchable) [size=64M]
        I/O ports at e000 [disabled] [size=128]
        Expansion ROM at f6000000 [disabled] [size=512K]
        Capabilities: [60] Power Management version 3
        Capabilities: [68] MSI: Enable- Count=1/1 Maskable- 64bit+
        Capabilities: [78] Express Endpoint, MSI 00
        Capabilities: [b4] Vendor Specific Information: Len=14 <?>
        Capabilities: [100] Virtual Channel
        Capabilities: [128] Power Budgeting <?>
        Capabilities: [600] Vendor Specific Information: ID=0001 Rev=1 Len=024 <?>
        Kernel modules: nouveau

Based on the age of my card I’d guess I would need to use the AUR package nvidia-390xx-dkms instead, right?

1 Like

The more I’m reading the more I wonder if Bumblebee may be the better option for my system, especially because my laptop is older. I may try Bumblebee at some point later unless someone thinks it’s a terrible idea. Beyond that the only thing I can think of trying with optimus-switch is installing the legacy Nvidia drivers from AUR and trying to use them with switch…

Don’t feel too bad. It happens to the best of us.

Yes, that would be the case.

I would give it a try with the AUR driver. Since you already have everything installed, this should be they only thing you need to do. I would do this all in a TTY session while in Intel mode. Make sure to remove or disable the nouveau driver BEFORE you reboot.

You may still need the kernel parameter, even with the proper driver installed. With my 2019 vintage Asus FX504GD, I have to use a kernel parameter to have everything work properly. Give it a try with the proper driver first. If it does not work, then try the kernel parameters. You should not need to go back to Windows 2009. The newer ones SHOULD be compatible with older hardware.

I have never been able to get Bumblebee to work properly with any laptop that I have owned that had Optimus capabilities. However, it may work better for you. It really depends on what you want to do. If all you are using your laptop for is e-mail, web, etc… In other words, not gaming. You may be able to get by in just Intel mode.

1 Like

Thanks for the guidance! I’ll try this later tonight or tomorrow…it’s been a wild day at work today so might not get to it until later. I’ll be back with some updates!

1 Like

No worries. It is late here, 2:30am. Give it a shot and see what happens. Good Luck!

Hey all I’m back with an update…unfortuantely I’m still experiencing the issue :tired_face:. Here’s a rundown of what I’ve done so far:

Taking @linesma’s advice I installed nvidia 390xx drivers from AUR. Here’s what I’ve got as far as nvidia drivers go:

pacman -Q | grep nvidia
lib32-nvidia-utils 470.74-1
lib32-opencl-nvidia-340xx 340.108-1
nvidia-390xx 390.144-1
nvidia-390xx-dkms 390.144-2
nvidia-390xx-utils 390.144-2
nvidia-installer-db 2.4.25-1
nvidia-installer-dkms 3.3.9-1
opencl-nvidia-390xx 390.144-2

After installing those, I attempted to blacklist the Nouveau driver(s) by doing the following 2 things:

  1. Added blacklist nouveau to this file: /etc/modprobe.d/nouveau.conf

  2. Regenerated initramfs with mkinitcpio -p linux

  3. Added modprobe.blacklist=nouveau to my /etc/default/grub, and then updated with grub-mkconfig -o /boot/grub/grub.cfg

Here’s my current output for lspci -nnk | grep -i vga -A3 | grep 'in use'

` Kernel driver in use: i915
`

I then ran sudo set-nvidia.sh and rebooted, but it still hangs on the TLP System Startup/Shutdown. So I then tested each of the acpi kernel parameters for Windows (2009, 2012, and 2018) one by one. Still hangs on teh TLP message.I haven’t tried the Linux one just yet, but my laptop is a Toshiba so I didn’t think that one would apply. Not sure if it means anything, but the point that TLP message seems to hang is when Network Manager seems to be attempting to start…this is the same regardless of which acpi parameter I use.

Any more info I can provide I’ll be happy to share…I’m running out of ideas unfortunately :frowning:. As always thanks for everyone’s help!!

I honestly do not know what could be going wrong at this point. You might really want to give Bumblebee a try. I have not tested this setup with a card that old. You also might try a couple of things. I am assuming you can get to a TTY? Or you can still boot to Intel mode. I would do the following:

  1. Take a look at the following directories:
/etc/X11/
/etc/X11/xorg.conf.d/
/etc/modprobe.d/
/etc/modules-load.d/

I would delete anything that may even be graphics related. If you even THINK it is graphics related, delete it. Run the set-nvidia.sh command again and reboot.

  1. Uninstall Nouveau. Sometimes blacklisting does not work properly.

  2. Try the following kernel parameter: acpi_osi=! acpi_osi='Windows 2009' This will reset any vendor ACPI strings ans then apply a Windows 2009 ACPI table.

Nouveau is part of the mesa package, right? So I’d be looking at doing something like sudo pacman -Rs mesa. I’ll give that a try as well as the kernel parameter you suggested. All of those files in /etc are completely empty, so I didn’t need to clean anything out. They were actually empty before I installed Optimus Switch…

I suppose I’ll give this one more try then I’ll have to uninstall it and try Bumblebee instead. Crossing my fingers…

1 Like

At least you have nvidia packages from different series. There are stuff from 470 series, 390 series and 340 series.
You should have only 390 series stuff.

And if you have nvidia-390xx-dkms, then you don’t need nvidia-390xx.

Nouveau is either a kernel module or from xf86-video-nouveau package.

1 Like

Really appreciate everyone’s help with this…unfortunately I still can’t seem to get my nvidia card working properly with optimus-switch. I tried @linesma’s last suggestion and no luck…same issue. I’m pretty confident at this point that optimus-switch may just not be compatible with my system because of its age.

I actually uninstalled switch completely and am currently giving Bumblebee a go. So far it seems to be working perfectly, I just need to read up a bit more on how to configure it the way I want to and how to use it for stuff like Steam.

I suppose I’ll mark this as “Solved” only because I learned that my Optimus card is too old to be able to use optimus-switch but can still be useful with an app like Bumblebee. Again, thanks everyone for your help this week!!! Love this community!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.