You are not logged in.

#1 2023-11-29 23:02:52

kafkalainen
Member
Registered: 2023-11-29
Posts: 9

[SOLVED] Boots up to black screen when iGPU is used on Optimus laptop

Hello all,

I've now tried to debug the issue for three days now, so I decided to give a try to ask from you, what could be the issue here.

Setup:
Lenovo Legion Slim 5 16APH8
Nvidia RTX 4070
AMD Ryzen 7 7840HS (with Radeon 780M/Pheonix) iGPU
6.6.3-arch1-1
KDE Plasma, SDDM and X11

https://wiki.archlinux.org/title/NVIDIA_Optimus
https://wiki.archlinux.org/title/PRIME

I have tried now to install PRIME setup for the machine, and I get stuck to a black screen on startup. Due to the function keys are not currently working on this machine, I can't change to TTY on startup either, so I use install media to mount and chroot to the installation.
BIOS provides a way to set either hybrid or dedicated video card, that was how I am even to able to write this message on this machine. Basically I can boot normally, if I just use dGPU.

The black screen did not happen on every boot however. There were three occasions when system was fully booted, AMDGPU was recognized and I was able to test out

prime-run

command successfully. After a reboot, I was back in the situation that the machine would greet me again with the black abyss.

journalctl output for the failed startup:
https://pastebin.com/CpLcMVLF

Which has an error:

Nov 29 22:55:41 slim kernel: nvidia-modeset: WARNING: GPU:0: Unable to read EDID for display device DP-2

I installed following drivers and utilities for NVIDIA

nvidia lib32-nvidia-utils nvidia-utils nvidia-settings nvidia-prime xorg-xrandr

And these for the AMD

mesa xf86-video-amdgpu lib32-mesa libva-mesa-driver mesa-vdpau vulkan-radeon

I have made following steps to resolve the issue, based on few Youtube videos on driver installation and wiki.
- I preloaded the NVIDIA drivers in /etc/mkinitcpio.conf in:

MODULES=(nvidia nvidia_modeset nvidia_uvm nvidia_drm)

and regenerated initframs using mkinitcpio -P
- I loaded amdgpu before Nvidia in mkinitcpio.conf in modules. This caused black screen to happen earlier in the startup, not seeing regular systemd output.
- I loaded amdgpy after Nvidia mkinitcpio.conf
- Uninstalled and reinstalled xf86-video-amdgpu
- Added and removed kms hook.
- Removed all modules.
- Prepended xrandr --auto to .xinitrc
- Added rcutree.rcu_idle_gp_delay=1 kernel parameter.
- Reinstalled nvidia and nvidia-utils

Last edited by kafkalainen (2023-12-03 09:48:14)

Offline

#2 2023-11-30 08:28:15

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,044

Re: [SOLVED] Boots up to black screen when iGPU is used on Optimus laptop

That's only random lines yout of the journal, probably last page from the pager?
Please post your complete system journal for the boot:

sudo journalctl -b | curl -F 'file=@-' 0x0.st

Please post your Xorg log, https://wiki.archlinux.org/title/Xorg#General

I assume you can boot the multi-user.target fine (2nd link below)?

Offline

#3 2023-11-30 13:27:08

kafkalainen
Member
Registered: 2023-11-29
Posts: 9

Re: [SOLVED] Boots up to black screen when iGPU is used on Optimus laptop

Sorry about sending the partial journal! Have to say that 0x0.st is really nifty service.

Here is the full log from the boot with hybrid graphics on:
http://0x0.st/HxcQ.txt

Here is X.org log with hybrid graphics on:
http://0x0.st/Hxcx.txt

I can boot to the multi-user.target when I have set dGPU on from BIOS, but on hybrid mode, I am greeted by the same black screen, without terminal login.

EDIT:
Here is another with hybrid graphics from more recent boot, the earlier might not match with timestamps.
http://0x0.st/HxTq.txt

and X.org
http://0x0.st/HxTK.txt

Last edited by kafkalainen (2023-11-30 14:28:33)

Offline

#4 2023-11-30 14:12:55

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,044

Re: [SOLVED] Boots up to black screen when iGPU is used on Optimus laptop

Enable https://wiki.archlinux.org/title/NVIDIA … de_setting and in doubt add "initcall_blacklist=simpledrm_platform_driver_init" to the https://wiki.archlinux.org/title/Kernel_parameters

[    21.889] (WW) AMDGPU(0): flip queue failed: Invalid argument
[    21.889] (WW) AMDGPU(0): Page flip failed: Invalid argument

Try to remove xf86-video-amdgpu, but if the multi-user.target doesn't work either, that's not critical.

Do you have an external monitor that you could plug in for testing purposes?

Offline

#5 2023-11-30 15:00:34

kafkalainen
Member
Registered: 2023-11-29
Posts: 9

Re: [SOLVED] Boots up to black screen when iGPU is used on Optimus laptop

Set the /etc/modeprobe.d/nvidia.conf as follows:

 options nvidia_drm modeset=1 fbdev=1

appended kernel parameters:

 nvidia_drm.modeset=1 initcall_blacklist=simpledrm_platform_driver_init 

No apparent change, except now the screen blinks few times in dGPU mode when entering desktop, testing now removing xf86-video-amdgpu.

EDIT:
No change when removing xf86-video-amdgpu package.

Regretfully I don't own external monitor to plug in the laptop.

Last edited by kafkalainen (2023-11-30 15:24:44)

Offline

#6 2023-11-30 15:41:47

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,044

Re: [SOLVED] Boots up to black screen when iGPU is used on Optimus laptop

Can you boot the multi-user.target when passing

video=2560x1600@60

to the kernel?
https://www.kernel.org/doc/Documentation/fb/modedb.rst

Offline

#7 2023-11-30 16:08:55

kafkalainen
Member
Registered: 2023-11-29
Posts: 9

Re: [SOLVED] Boots up to black screen when iGPU is used on Optimus laptop

Yes, I can boot then to multi-user.target.

Offline

#8 2023-11-30 17:38:27

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,044

Re: [SOLVED] Boots up to black screen when iGPU is used on Optimus laptop

It doesn't like the higher frequency it seems - this is not uncommon w/ hybrid graphics where the higher refresh-rate is only available to the dGPU.
Maybe https://wiki.archlinux.org/title/Variab … _on_AMDGPU doesn't work w/ AMD

I assume you can also boot the graphical target w/ that setting or at least can start it, switch back to the console and "DISPLAY=:0 xrandr --output eDP --rate 60"?

Offline

#9 2023-11-30 18:10:55

kafkalainen
Member
Registered: 2023-11-29
Posts: 9

Re: [SOLVED] Boots up to black screen when iGPU is used on Optimus laptop

Yes, I can boot to graphical.target as well, output for DISPLAY=:0 xrandr --output eDP --rate 60 was:

warning: output eDP not found; ignoring

EDIT:
I was being silly, checked what monitors are connected, and there is eDP-2, used command to that target

DISPLAY=:0 xrandr --output eDP-2 --rate 60

Last edited by kafkalainen (2023-11-30 18:33:55)

Offline

#10 2023-11-30 19:59:28

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,044

Re: [SOLVED] Boots up to black screen when iGPU is used on Optimus laptop

Yes, I can boot to graphical.target as well

Means xrandr becomes irrelevant.
Does it help to enable VRR for amdgpu?
(Otherwise you might be down to running the system on 60Hz)

Offline

#11 2023-11-30 20:45:27

kafkalainen
Member
Registered: 2023-11-29
Posts: 9

Re: [SOLVED] Boots up to black screen when iGPU is used on Optimus laptop

Yeah running on 60Hz doesn't sound that great, when the monitor is capable for more higher refresh rate. You mean using an Xorg conf file for setting it, and removing the kernel parameter?
https://wiki.archlinux.org/title/Variab … _conf_file

Last edited by kafkalainen (2023-11-30 20:49:07)

Offline

#12 2023-12-01 08:28:16

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,044

Re: [SOLVED] Boots up to black screen when iGPU is used on Optimus laptop

I'd first leave the parameter in place and then see whether you can get the output to work on VRR in X11 (you can still change the modeline despite the kernel parameter and I guess the boot pre-GUI isn't interesting enough for higher FPS anyway wink

Offline

#13 2023-12-01 17:53:10

kafkalainen
Member
Registered: 2023-11-29
Posts: 9

Re: [SOLVED] Boots up to black screen when iGPU is used on Optimus laptop

I wasn't entirely sure about how to test it, but xrandr --props | grep -A 1 "vrr" gives out following output for the monitor, so it seemingly is working.

        vrr_capable: 1 
                range: (0, 1)

Also, monitor is currently set to 165 Hz refresh rate, when I check with xrandr -q, where the refresh rate is set to be both current and preferred one

Screen 0: minimum 320 x 200, current 2560 x 1600, maximum 16384 x 16384
eDP-2 connected primary 2560x1600+0+0 (normal left inverted right x axis y axis) 344mm x 215mm
   2560x1600    165.00*+  60.00 + 120.01    96.03    72.01    60.01    59.99    59.97 

Should I also keep NVIDIA DRM settings?

Offline

#14 2023-12-01 17:55:29

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,044

Re: [SOLVED] Boots up to black screen when iGPU is used on Optimus laptop

Should I also keep NVIDIA DRM settings?

Yes.

So to sum up, right now you can boot the system on 60Hz and switch to VRR on the AMD GPU?
(Please post an updated Xorg log, I'm kinda sceptical b/c of the "eDP-2" output name)

Offline

#15 2023-12-02 12:20:04

kafkalainen
Member
Registered: 2023-11-29
Posts: 9

Re: [SOLVED] Boots up to black screen when iGPU is used on Optimus laptop

I set the VVR true for the AMD GPU.

Section "OutputClass"
     Identifier "AMD"
     MatchDriver "amdgpu"
     Driver "amdgpu"
     Option "VariableRefresh" "true"
EndSection

AUR package for VRR test seemed to work once I toggled it with s. Is there somewhere else I could check it?
https://aur.archlinux.org/packages/vrrtest-git

Here's the Xorg log from the latest boot.
http://0x0.st/Hxpp.txt

Offline

#16 2023-12-02 14:52:51

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,044

Re: [SOLVED] Boots up to black screen when iGPU is used on Optimus laptop

You're running on the modesetting driver, not amdgpu, but

[    15.637] (**) modeset(0): Option "VariableRefresh" "true"

and

[    15.790] (II) modeset(0): EDID for output eDP-2

is now also the correct output name.

Is there somewhere else I could check it?

No idea but there's no reason to distrust the results.

Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

Offline

#17 2023-12-03 09:46:32

kafkalainen
Member
Registered: 2023-11-29
Posts: 9

Re: [SOLVED] Boots up to black screen when iGPU is used on Optimus laptop

Sure thing! smile Thank you for all the help, I learned a lot during the process as well. Now know a thing or two, when a next issue might rise.

Offline

#18 2024-01-13 13:43:41

mateudz
Member
Registered: 2018-01-28
Posts: 2

Re: [SOLVED] Boots up to black screen when iGPU is used on Optimus laptop

I have had also the same black screen of death. TTY is glitching with values over 60FPS and completely broke (black) on 165FPS.

Add this to your kernel params and adjust your screen size (It must match correct): (Either manually on boot through your bootloader or make it persistent)

linux [...] video=2560x1600@60 amdgpu.sg_display=0

The last parameter eliminates white screen flash glitches. Works totally fine now on Kernel 6.6 and 6.7.

To be honest, if your internal laptop display is capabale of more than 60hz, then setting 60FPS does not feel like 60FPS on a 60hz display. It feels way smoother, no need to change it.

Anyway whatever theme this is from AMD x GNU/Linux I dont like the ying and yang easter egg.

Offline

Board footer

Powered by FluxBB