Black screen in set-nvidia.sh (Optimus-switch)

Good evening, I’m not sure that the category is right this is my first post and I’m a linux beginner.
I’ve installed Optirun-switch on my laptop and everything goes fine with Intel configuration but when I tried Nvidia configuration I get black screen with underscore on the top. How can I boot again into the system and eventually solve the problem?

The Nvidia card is gtx 1050, I don’t know if it can help.
Thanks you in advance.

Have you seen and read through this wiki yet?

Yes I’ve followed it step by step, but I skipped the last part for the tray app, I don’t think it could be a problem

1 Like

https://discovery.endeavouros.com/system-rescue/how-to-boot-without-a-graphical-environment/2021/03/

and revert settings from TTY could be what helps you.

And welcome :enos:

Welcome to the forum @Dario :partying_face: :enos: :enos_flag:

Thanks you so much, exactly what I need, I’ve fixed the black screen problem that was the most annoying. But I didn’t understand why this appens with set-nvidia.sh. I tried to configure Optimus-manager without success. Any idea to fix Optimus switch?

no optimus hardware here to test it…
But

Optimus Switch, written by user @dglt

@dglt

Sorry I didn’t understand what do you mean.

the dev is a user here at the forum and should give a hint what could be wrong :wink:

Not enough information given by the OP to even make an attempt to troubleshoot. How about we try this, please read this link and provide the basic hardware information.

Take special note of how to post this information here.

HINT: It is NOT done by a screenshot.

1 Like
 inxi -Fxxc0z --no-host
Summary
System:
  Kernel: 5.16.8-arch1-1 x86_64 bits: 64 compiler: gcc v: 11.1.0
    Desktop: GNOME 41.3 tk: GTK 3.24.31 wm: gnome-shell dm: GDM
    Distro: EndeavourOS base: Arch Linux
Machine:
  Type: Laptop System: HP product: HP Pavilion Laptop 15-cs1xxx
    v: Type1ProductConfigId serial: <superuser required> Chassis: type: 10
    serial: <superuser required>
  Mobo: HP model: 856A v: 15.32 serial: <superuser required> UEFI: Insyde
    v: F.23 date: 12/25/2020
Battery:
  ID-1: BAT0 charge: 45.3 Wh (76.6%) condition: 59.1/59.1 Wh (100.0%)
    volts: 15.6 min: 15.4 model: HP Primary serial: N/A status: Discharging
  Device-1: hidpp_battery_0 model: Logitech Wireless Mouse M185/M225
    serial: <filter> charge: 100% (should be ignored) status: Discharging
CPU:
  Info: quad core model: Intel Core i7-8565U bits: 64 type: MT MCP
    arch: Whiskey Lake rev: B cache: L1: 256 KiB L2: 1024 KiB L3: 8 MiB
  Speed (MHz): avg: 586 high: 600 min/max: 400/4600 cores: 1: 600 2: 600
    3: 600 4: 563 5: 593 6: 600 7: 600 8: 535 bogomips: 32012
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
  Device-1: Intel WhiskeyLake-U GT2 [UHD Graphics 620]
    vendor: Hewlett-Packard driver: i915 v: kernel bus-ID: 00:02.0
    chip-ID: 8086:3ea0
  Device-2: NVIDIA GP107M [GeForce GTX 1050 Mobile] vendor: Hewlett-Packard
    driver: N/A bus-ID: 02:00.0 chip-ID: 10de:1c8d
  Device-3: Lite-On HP Wide Vision FHD Camera type: USB driver: uvcvideo
    bus-ID: 1-3:3 chip-ID: 04ca:7086
  Display: x11 server: X.Org 1.21.1.3 compositor: gnome-shell driver:
    loaded: intel resolution: 1920x1080~60Hz s-dpi: 96
  OpenGL: renderer: Mesa Intel UHD Graphics 620 (WHL GT2)
    v: 4.6 Mesa 21.3.5 direct render: Yes
Audio:
  Device-1: Intel Cannon Point-LP High Definition Audio
    vendor: Hewlett-Packard driver: snd_hda_intel v: kernel bus-ID: 00:1f.3
    chip-ID: 8086:9dc8
  Device-2: NVIDIA GP107GL High Definition Audio vendor: Hewlett-Packard
    driver: snd_hda_intel v: kernel bus-ID: 02:00.1 chip-ID: 10de:0fb9
  Sound Server-1: ALSA v: k5.16.8-arch1-1 running: yes
  Sound Server-2: PulseAudio v: 15.0 running: no
  Sound Server-3: PipeWire v: 0.3.45 running: yes
Network:
  Device-1: Intel Cannon Point-LP CNVi [Wireless-AC] driver: iwlwifi
    v: kernel bus-ID: 00:14.3 chip-ID: 8086:9df0
  IF: wlan0 state: up mac: <filter>
  Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: Hewlett-Packard driver: r8169 v: kernel port: 3000 bus-ID: 04:00.0
    chip-ID: 10ec:8168
  IF: eno1 state: down mac: <filter>
Bluetooth:
  Device-1: Intel Bluetooth 9460/9560 Jefferson Peak (JfP) type: USB
    driver: btusb v: 0.8 bus-ID: 1-10:4 chip-ID: 8087:0aaa
  Report: rfkill ID: hci0 rfk-id: 1 state: down bt-service: disabled
    rfk-block: hardware: no software: yes address: see --recommends
RAID:
  Hardware-1: Intel 82801 Mobile SATA Controller [RAID mode] driver: ahci
    v: 3.0 bus-ID: 00:17.0 chip-ID: 8086:282a
Drives:
  Local Storage: total: 476.94 GiB used: 59.69 GiB (12.5%)
  ID-1: /dev/nvme0n1 vendor: Western Digital
    model: PC SN520 SDAPNUW-512G-1006 size: 476.94 GiB speed: 15.8 Gb/s
    lanes: 2 serial: <filter> temp: 30.9 C
Partition:
  ID-1: / size: 90.54 GiB used: 59.62 GiB (65.8%) fs: ext4
    dev: /dev/nvme0n1p7
  ID-2: /boot/efi size: 256 MiB used: 79.3 MiB (31.0%) fs: vfat
    dev: /dev/nvme0n1p1
Swap:
  ID-1: swap-1 type: partition size: 1.91 GiB used: 0 KiB (0.0%) priority: -2
    dev: /dev/nvme0n1p5
Sensors:
  System Temperatures: cpu: 45.0 C pch: 45.0 C mobo: N/A
  Fan Speeds (RPM): N/A
Info:
  Processes: 256 Uptime: 30m Memory: 15.52 GiB used: 2.46 GiB (15.8%)
  Init: systemd v: 250 Compilers: gcc: 11.1.0 Packages: 1127 pacman: 1115
  snap: 12 Shell: Bash v: 5.1.16 running-in: gnome-terminal inxi: 3.3.12

I’ve also noticed on booting with intel configuration appears :
[FAILED] Failed to start Load Kernel Modules.
But after this it will continue without any evident issue.

It looks like no driver for the nVidia card is installed. Make sure that the driver is actually installed.

pacman -Q | grep nvidia

If it is not installed, make sure to install it.

Also, HP laptops can be “fun” when it comes to Linux, especially Optimus Graphics with Arch. Sometimes, the ACPI tables can cause issues. Try adding acpi_osi='Windows 2017' and reboot.

If you need instructions on how to do this, take a look at this article:

Here it is the output, it seems to be ok isn’t it?

lib32-nvidia-utils 510.47.03-1
nvidia-dkms 510.47.03-3
nvidia-installer-db 2.5.4-1
nvidia-installer-dkms 3.3.13-1
nvidia-settings 510.47.03-1
nvidia-utils 510.47.03-3

I noticed it, I’m having so much “fun”…

Yes, that looks good.

Give the kernel parameter thing a try. That is what I had to do to get the Optimus setup (Optimus-Switch) on my laptop working properly on Arch.

Summary
System:
  Kernel: 5.16.8-zen1-1-zen x86_64 bits: 64 compiler: gcc v: 11.1.0
    Desktop: KDE Plasma 5.24.0 tk: Qt 5.15.2 wm: kwin_x11 dm: SDDM
    Distro: Arch Linux
Machine:
  Type: Laptop System: ASUSTeK product: TUF GAMING FX504GD_FX80GD v: 1.0
    serial: <superuser required>
  Mobo: ASUSTeK model: FX504GD v: 1.0 serial: <superuser required>
    UEFI: American Megatrends v: FX504GD.319 date: 06/19/2020
Battery:
  ID-1: BAT1 charge: 41.9 Wh (100.0%) condition: 41.9/48.1 Wh (87.1%)
    volts: 4.0 min: 11.7 model: ASUS A32-K55 serial: N/A status: Full
CPU:
  Info: 6-core model: Intel Core i7-8750H bits: 64 type: MT MCP
    arch: Coffee Lake rev: A cache: L1: 384 KiB L2: 1.5 MiB L3: 9 MiB
  Speed (MHz): avg: 898 high: 900 min/max: 800/4100 cores: 1: 900 2: 900
    3: 900 4: 900 5: 900 6: 900 7: 900 8: 900 9: 885 10: 899 11: 900 12: 900
    bogomips: 52799
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
  Device-1: Intel CoffeeLake-H GT2 [UHD Graphics 630] vendor: ASUSTeK
    driver: i915 v: kernel bus-ID: 00:02.0 chip-ID: 8086:3e9b
  Device-2: NVIDIA GP107M [GeForce GTX 1050 Mobile] vendor: ASUSTeK
    driver: nvidia v: 510.47.03 bus-ID: 01:00.0 chip-ID: 10de:1c8d
  Device-3: IMC Networks USB2.0 HD UVC WebCam type: USB driver: uvcvideo
    bus-ID: 1-7:2 chip-ID: 13d3:5666
  Display: x11 server: X.Org 1.21.1.3 compositor: kwin_x11 driver:
    loaded: modesetting,nvidia resolution: 1920x1080~60Hz s-dpi: 96
  OpenGL: renderer: NVIDIA GeForce GTX 1050/PCIe/SSE2
    v: 4.6.0 NVIDIA 510.47.03 direct render: Yes
Audio:
  Device-1: Intel Cannon Lake PCH cAVS vendor: ASUSTeK driver: snd_hda_intel
    v: kernel bus-ID: 00:1f.3 chip-ID: 8086:a348
  Sound Server-1: ALSA v: k5.16.8-zen1-1-zen running: yes
  Sound Server-2: JACK v: 1.9.20 running: no
  Sound Server-3: PulseAudio v: 15.0 running: no
  Sound Server-4: PipeWire v: 0.3.45 running: yes
Network:
  Device-1: Intel Cannon Lake PCH CNVi WiFi driver: iwlwifi v: kernel
    bus-ID: 00:14.3 chip-ID: 8086:a370
  IF: wlo1 state: up mac: <filter>
  Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: ASUSTeK driver: r8169 v: kernel port: 3000 bus-ID: 03:00.0
    chip-ID: 10ec:8168
  IF: enp3s0 state: down mac: <filter>
Bluetooth:
  Device-1: Intel Bluetooth 9460/9560 Jefferson Peak (JfP) type: USB
    driver: btusb v: 0.8 bus-ID: 1-14:4 chip-ID: 8087:0aaa
  Report: rfkill ID: hci0 rfk-id: 2 state: up address: see --recommends
Drives:
  Local Storage: total: 1.14 TiB used: 404.44 GiB (34.7%)
  ID-1: /dev/nvme0n1 vendor: Western Digital model: WDS250G2X0C-00L350
    size: 232.89 GiB speed: 31.6 Gb/s lanes: 4 serial: <filter> temp: 53.9 C
  ID-2: /dev/sda vendor: Crucial model: CT1000MX500SSD1 size: 931.51 GiB
    speed: 6.0 Gb/s serial: <filter>
Partition:
  ID-1: / size: 211.62 GiB used: 33.34 GiB (15.8%) fs: ext4
    dev: /dev/nvme0n1p4
  ID-2: /boot size: 1022 MiB used: 140.8 MiB (13.8%) fs: vfat
    dev: /dev/nvme0n1p1
Swap:
  ID-1: swap-1 type: zram size: 330.3 MiB used: 0 KiB (0.0%) priority: 32767
    dev: /dev/zram0
  ID-2: swap-2 type: zram size: 330.3 MiB used: 0 KiB (0.0%)
    priority: 32767 dev: /dev/zram1
  ID-3: swap-3 type: zram size: 330.3 MiB used: 0 KiB (0.0%)
    priority: 32767 dev: /dev/zram2
  ID-4: swap-4 type: zram size: 330.3 MiB used: 0 KiB (0.0%)
    priority: 32767 dev: /dev/zram3
  ID-5: swap-5 type: zram size: 330.3 MiB used: 0 KiB (0.0%)
    priority: 32767 dev: /dev/zram4
  ID-6: swap-6 type: zram size: 330.3 MiB used: 0 KiB (0.0%)
    priority: 32767 dev: /dev/zram5
  ID-7: swap-7 type: zram size: 330.3 MiB used: 0 KiB (0.0%)
    priority: 32767 dev: /dev/zram6
  ID-8: swap-8 type: zram size: 330.3 MiB used: 0 KiB (0.0%)
    priority: 32767 dev: /dev/zram7
  ID-9: swap-9 type: zram size: 330.3 MiB used: 0 KiB (0.0%)
    priority: 32767 dev: /dev/zram8
  ID-10: swap-10 type: zram size: 330.3 MiB used: 0 KiB (0.0%)
    priority: 32767 dev: /dev/zram9
  ID-11: swap-11 type: zram size: 330.3 MiB used: 0 KiB (0.0%)
    priority: 32767 dev: /dev/zram10
  ID-12: swap-12 type: zram size: 330.3 MiB used: 0 KiB (0.0%)
    priority: 32767 dev: /dev/zram11
Sensors:
  System Temperatures: cpu: 52.0 C pch: 78.0 C mobo: 27.8 C gpu: nvidia
    temp: 44 C
  Fan Speeds (RPM): cpu: 0
Info:
  Processes: 282 Uptime: 25m Memory: 15.48 GiB used: 2.71 GiB (17.5%)
  Init: systemd v: 250 Compilers: gcc: 11.1.0 Packages: pacman: 1079
  Shell: Bash v: 5.1.16 running-in: konsole inxi: 3.3.12

I would also go take a look at /etc/gdm/custom.conf and make sure the # is removed before the line #WaylandEnable=false. This will make sure that Gnome does not try to load Wayland first before falling back to X11. Both Optimus-Switch and Optimus-Manager do not play well with Wayland.

Also, your OP was unclear, what did you do to try and get things working? Can you post things in the order you did them? Optimus-Switch and Optimus-Manager do not play well together.

If Optimus-Manager was installed, there are more steps required to remove it than just uninstalling the package. You need to run optimus-manager --cleanup BEFORE uninstalling the package to have it completely uninstalled. Also, since you are running Gnome, Optimus-Manager requires that you use GDM Prime instead of the default GDM (This is the screen that you log in on). You would also need to switch back to the default GDM. To be honest, that is beyond my knowledge.

1 Like

I started the nvidia cofiguration following the Welcome guide to get Optimus-manager. I carefully followed every step from that guide, I tried to install GDM Prime, but something went wrong because from yay it gives me an error. I tried to solve it but without success, so I decided to get Optimus-switch, but I skipped the command optimus-manager --cleanup and I just uninstall it. After that I followed every step from the welcome guide to install correcly op.-sw.

1 Like

Okay, when you installed your system, were you able to boot into a desktop after the initial install before doing any configuration?

I don’t remember it was a mouth ago. Only a few days ago I decided to set up nvidia, but probably yes.

Did you make a backup before doing anything? If so, I would revert back before doing anything else and see what happens.

Hopefully someone can pick up form here, it is very late where I am at and the morning is going to come too soon. I have to get some sleep. Also, we are approaching the limits of my knowledge.

1 Like

No backup I’m sorry. Please go to sleep, the most important thing was to have access again to my system just to use some programs that I need for University (I’ve checked that they work). Maybe next week if there is no solution I can do a fresh install and give Op-sw another chance. Thank you so much.

1 Like