You are not logged in.

#1 2024-05-12 00:53:25

SoundOfE
Member
Registered: 2024-05-11
Posts: 11

[SOLVED] Black screen for NVIDIA and AMD hybrid graphics

I have a Lenovo Legion Slim 5 R7 with a NVIDIA RTX4060 GPU. I've had some problems which have somewhat been fixed:

  • initramfs-linux.img and initramfs-linux-fallback.img were so big that I couldn't install the boot loader on the EFI partition. However, this was fixed by removing KMS from the kernel and running mkinitcpio as described here

  • I need to add the following kernel parameters to GRUB: nomodeset nouveau.modeset=0, otherwise the screen becomes black because the nouveau driver gets loaded.

Adding a line blacklist nouveau to a file /etc/modprobe.d/blacklist.conf does not work (however the line blacklist pcspkr to /etc/modprobe.d/nobeep.conf turns off the annoying console beep). So I have solved this by setting GRUB_CMDLINE_LINUX="nomodeset nouveau.modeset=0" in /etc/default/grub (and then run grub-mkconfig -o /boot/grub/grub.cfg).

My questions:

Why isn't the blacklisting of nouveau working? journalctl shows something like (written by hand)

TIME legionarch kernel: pci 0000:01:00.0: optimus capabilities: enabled, status dynamic power, hda bios codec supported
TIME legionarch kernel: VGA switcheroo: detected Optimus DSM method \_SB.PCI0.GPP0.PEGP handle
TIME legionarch kernel: nouveau detected PR support, it will not use DSM
TIME legionarch kernel: nouveau 000:01:00.0: enabling device (0000 -> 0003)
TIME legionarch kernel: nouveau 000:01:00.0: NVIDIA AD107 (197000a1)

Can I do something else than setting the kernel parameters in GRUB_CMDLINE_LINUX? And why does it load nouveau when the initramfs's has disabled KMS? I guess the loading is done at a later stage?

When I boot the computer, GRUB starts up in high resolution (2560 x 1600). But when I start loading linux, the text size increases and the resolution becomes lower. How can I keep the same console resolution as GRUB? . gfxpayload=keep is set for the linux boot entry in GRUB. Running videoinfo in GRUB command line shows several settings for the Adapter 'EFI GOP driver' (with 2560x1600 selected). Maybe some other driver is loaded when linux starts?

I haven't tried to run X/Wayland yet (using something else than the nouveau driver, probably), but this would be the next thing to do after the system is up and going.

Thank you! This is my first post in this forum, but not my first time using Arch smile

EDIT: This post originally assumed that the nouveau driver caused the problems (based on other search results on internet), but it turned out (?) that the amdgpu driver had issues with the screen. This laptop has a hybrid graphics solution consisting of NVIDIA RTX 4060 and AMD Radeon 780M.

Last edited by SoundOfE (2024-06-15 13:39:56)

Offline

#2 2024-05-12 11:37:42

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

Re: [SOLVED] Black screen for NVIDIA and AMD hybrid graphics

If the nouveau module is in the initramfs you've to regenerate that to apply the modprobe config additions.
Adding "module_blacklist=nouveau" to the kernel parameters will always work.

journalctl shows something like (written by hand)

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

or

sudo journalctl -b -1 | curl -F 'file=@-' 0x0.st # for the previous boot

But when I start loading linux, the text size increases and the resolution becomes lower.

That's w/ the nomodeset parameter? You can expect that. nomodeset is a debug feature, not a solution.

Online

#3 2024-05-12 23:06:01

SoundOfE
Member
Registered: 2024-05-11
Posts: 11

Re: [SOLVED] Black screen for NVIDIA and AMD hybrid graphics

For some reason, if I set GRUB_GFXMODE=1920x1200, then GRUB boots up with a slighter lower resolution than 2560x1600 (obviously), but then the rest of the booting keeps this resolution (in a different, thicker font than the one in GRUB). This does not happen with GRUB_GFXMODE=2560x1600. Both uses GRUB_GFXPAYLOAD=keep. Strange. But better smile

Using the kernel parameter module_blacklist=nouveau did not work. I need the parameters nomodeset nouveau.modeset=0 for some reason. I logged in blindly and ran rmmod nouveau but the screen was still black (running reboot after worked, so I guess I was correctly logged in). If I run rmmod nouveau (not blindly) no message is shown, but I get rmmod: ERROR: Module nouveau is not currently loaded when I run it a second time. So nouveau seems to be loaded but not active if I use the kernel parameters nomodeset noveau.modeset=0.

The nouveau driver should be removed from the initramfs because I had to trim down the size of the initramfs as described here: https://bbs.archlinux.org/viewtopic.php … 0#p2143700 . So where is nouveau pulled from? What I know about the boot process is that initramfs is a temporary root file system that the linux kernel use to set up the rest and then mount the real file system from disk as the root file system. (And then systemd runs to set up my linux system fully). So where could nouveau originate from? nouveau is blacklisted in /etc/modprobe.d/blacklist.conf as I wrote. Or is there something else than nouveau causing my troubles?

Thank you!

Offline

#4 2024-05-12 23:28:02

loqs
Member
Registered: 2014-03-06
Posts: 18,872

Re: [SOLVED] Black screen for NVIDIA and AMD hybrid graphics

SoundOfE wrote:

The nouveau driver should be removed from the initramfs because I had to trim down the size of the initramfs as described here: https://bbs.archlinux.org/viewtopic.php … 0#p2143700 .

That covers the fallback initrd only.   Please post the output of

# lsinitcpio /boot/initramfs-linux.img | grep nouveau
cat /etc/modprobe.d/blacklist.conf
cat /etc/mkinitcpio.conf
cat /etc/mkinitcpio.d/linux.preset

Last edited by loqs (2024-05-12 23:28:21)

Offline

#5 2024-05-13 06:18:02

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

Re: [SOLVED] Black screen for NVIDIA and AMD hybrid graphics

Using the kernel parameter module_blacklist=nouveau did not work.

I'm pretty sure that it deos work, but is actually not what you want.

ran rmmod nouveau but the screen was still black (running reboot after worked, so I guess I was correctly logged in)

You cannot rmmod an active module and whatever you did there would not have survived a reboot.

So nouveau seems to be loaded but not active if I use the kernel parameters nomodeset noveau.modeset=0.

It's active but you're not getting KMS and the parameters are redundant.

Maybe we take a step back.
What are you actually trying to do there?
Do you have the nvidia drivers installed (properly)
Please post your complete system journal for the boot:

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

Online

#6 2024-05-14 00:02:44

SoundOfE
Member
Registered: 2024-05-11
Posts: 11

Re: [SOLVED] Black screen for NVIDIA and AMD hybrid graphics

My first problem was that the whole screen got blank/black. This happens right after the message :: Triggering uevents. This also happened with the Arch USB install medium. A solution here was to add the kernel parameters nomodeset nouveau.modeset=0 (maybe there are other solutions too).

The second problem was that I wanted to keep the same high resolution as GRUB uses (2560x1600). When I boot Linux, the resolution changes and become lower, and the first  message with this larger font size is :: running early hook [udev] (maybe udev does the change?). The strange thing is that if I change GRUB_GFXMODE from 2560x1600 to 1920x1200 (my screen display's next highest resolution with same aspect 16:10), then GRUB uses this setting, but also the linux terminal keeps this resolution (although it changes the font to a different, bolder font; :: running early hook [udev] is also here the first message with this new font).

So: 2560x1600 resolution for GRUB_GFXMODE => low resolution in terminal; 1920x1200 resolution for GRUB_GFXMODE => higher resolution in terminal.

Here are the outputs from lsinitcpio /boot/initramfs-linux.img | grep nouveau etc:

usr/lib/modules/6.8.9-arch1-2/kernel/drivers/gpu/drm/nouveau/
usr/lib/modules/6.8.9-arch1-2/kernel/drivers/gpu/drm/nouveau/nouveau.ko.zst
───────┬────────────────────────────────────────────────────────────────────────
       │ File: /etc/modprobe.d/blacklist.conf
───────┼────────────────────────────────────────────────────────────────────────
   1   │ blacklist nouveau
───────┴────────────────────────────────────────────────────────────────────────
───────┬────────────────────────────────────────────────────────────────────────
       │ File: /etc/mkinitcpio.conf
───────┼────────────────────────────────────────────────────────────────────────
   1   │ # vim:set ft=sh
   2   │ # MODULES
   3   │ # The following modules are loaded before any boot hooks are
   4   │ # run.  Advanced users may wish to specify all system modules
   5   │ # in this array.  For instance:
   6   │ #     MODULES=(usbhid xhci_hcd)
   7   │ MODULES=()
   8   │ 
   9   │ # BINARIES
  10   │ # This setting includes any additional binaries a given user may
  11   │ # wish into the CPIO image.  This is run last, so it may be used to
  12   │ # override the actual binaries included by a given hook
  13   │ # BINARIES are dependency parsed, so you may safely ignore libraries
  14   │ BINARIES=()
  15   │ 
  16   │ # FILES
  17   │ # This setting is similar to BINARIES above, however, files are added
  18   │ # as-is and are not parsed in any way.  This is useful for config files.
  19   │ FILES=()
  20   │ 
  21   │ # HOOKS
  22   │ # This is the most important setting in this file.  The HOOKS control the
  23   │ # modules and scripts added to the image, and what happens at boot time.
  24   │ # Order is important, and it is recommended that you do not change the
  25   │ # order in which HOOKS are added.  Run 'mkinitcpio -H <hook name>' for
  26   │ # help on a given hook.
  27   │ # 'base' is _required_ unless you know precisely what you are doing.
  28   │ # 'udev' is _required_ in order to automatically load modules
  29   │ # 'filesystems' is _required_ unless you specify your fs modules in MODULES
  30   │ # Examples:
  31   │ ##   This setup specifies all modules in the MODULES setting above.
  32   │ ##   No RAID, lvm2, or encrypted root is needed.
  33   │ #    HOOKS=(base)
  34   │ #
  35   │ ##   This setup will autodetect all modules for your system and should
  36   │ ##   work as a sane default
  37   │ #    HOOKS=(base udev autodetect modconf block filesystems fsck)
  38   │ #
  39   │ ##   This setup will generate a 'full' image which supports most systems.
  40   │ ##   No autodetection is done.
  41   │ #    HOOKS=(base udev modconf block filesystems fsck)
  42   │ #
  43   │ ##   This setup assembles a mdadm array with an encrypted root file system.
  44   │ ##   Note: See 'mkinitcpio -H mdadm_udev' for more information on RAID devices.
  45   │ #    HOOKS=(base udev modconf keyboard keymap consolefont block mdadm_udev encrypt filesystems fsck)
  46   │ #
  47   │ ##   This setup loads an lvm2 volume group.
  48   │ #    HOOKS=(base udev modconf block lvm2 filesystems fsck)
  49   │ #
  50   │ ##   This will create a systemd based initramfs which loads an encrypted root filesystem.
  51   │ #    HOOKS=(base systemd autodetect modconf kms keyboard sd-vconsole sd-encrypt block filesystems fsck)
  52   │ #
  53   │ ##   NOTE: If you have /usr on a separate partition, you MUST include the
  54   │ #    usr and fsck hooks.
  55   │ HOOKS=(base udev autodetect microcode modconf kms keyboard keymap consolefont block filesystems fsck)
  56   │ 
  57   │ # COMPRESSION
  58   │ # Use this to compress the initramfs image. By default, zstd compression
  59   │ # is used for Linux ≥ 5.9 and gzip compression is used for Linux < 5.9.
  60   │ # Use 'cat' to create an uncompressed image.
  61   │ #COMPRESSION="zstd"
  62   │ #COMPRESSION="gzip"
  63   │ #COMPRESSION="bzip2"
  64   │ #COMPRESSION="lzma"
  65   │ #COMPRESSION="xz"
  66   │ #COMPRESSION="lzop"
  67   │ #COMPRESSION="lz4"
  68   │ 
  69   │ # COMPRESSION_OPTIONS
  70   │ # Additional options for the compressor
  71   │ #COMPRESSION_OPTIONS=()
  72   │ 
  73   │ # MODULES_DECOMPRESS
  74   │ # Decompress loadable kernel modules and their firmware during initramfs
  75   │ # creation. Switch (yes/no).
  76   │ # Enable to allow further decreasing image size when using high compression
  77   │ # (e.g. xz -9e or zstd --long --ultra -22) at the expense of increased RAM usage
  78   │ # at early boot.
  79   │ # Note that any compressed files will be placed in the uncompressed early CPIO
  80   │ # to avoid double compression.
  81   │ #MODULES_DECOMPRESS="no"
───────┴────────────────────────────────────────────────────────────────────────
───────┬────────────────────────────────────────────────────────────────────────
       │ File: /etc/mkinitcpio.d/linux.preset
───────┼────────────────────────────────────────────────────────────────────────
   1   │ # mkinitcpio preset file for the 'linux' package
   2   │ 
   3   │ #ALL_config="/etc/mkinitcpio.conf"
   4   │ ALL_kver="/boot/vmlinuz-linux"
   5   │ 
   6   │ PRESETS=('default' 'fallback')
   7   │ 
   8   │ #default_config="/etc/mkinitcpio.conf"
   9   │ default_image="/boot/initramfs-linux.img"
  10   │ #default_uki="/efi/EFI/Linux/arch-linux.efi"
  11   │ default_options="--splash /usr/share/systemd/bootctl/splash-arch.bmp"
  12   │ 
  13   │ #fallback_config="/etc/mkinitcpio.conf"
  14   │ fallback_image="/boot/initramfs-linux-fallback.img"
  15   │ #fallback_uki="/efi/EFI/Linux/arch-linux-fallback.efi"
  16   │ fallback_options="-S autodetect -S kms"
───────┴────────────────────────────────────────────────────────────────────────

Maybe the _nouveau_ driver is still in the initramfs, but KMS is removed and therefore the size of my initramfs images became much smaller?

I got buzzed and confused when I tried to organize the journalctl outputs, so I have to do this later if that's necessary. Sorry. I haven't installed the nvidia drivers yet, because I wanted to have my system up and going first. And now I'm neither sure if nouveau is the problem!

I have somewhat fixed my second problem after doing all this testing, the resolution is higher (1920x1200) but not as nice as the highest for my screen that GRUB is capable of. So I'm not sure how useful it is for you to put much effort to fix the last part only to make the linux terminal look as good as GRUB. But I'm curious what's going on, like is it udev that pulls in a different driver than GRUB is using, and this driver can't handle the 2560x1600 resolution?

Thanks for your help!

PS: The setting GRUB_GFXPAYLOAD_LINUX=keep (which I think is a video parameter GRUB adds to kernel parameters) does not seem to do anything, at least if I use the setting 2560x1600 for gfxpayload.

Last edited by SoundOfE (2024-05-14 00:06:43)

Offline

#7 2024-05-14 00:16:18

loqs
Member
Registered: 2014-03-06
Posts: 18,872

Re: [SOLVED] Black screen for NVIDIA and AMD hybrid graphics

HOOKS=(base udev autodetect microcode modconf kms keyboard keymap consolefont block filesystems fsck)

kms is in the module array of mkinitcpio.conf which causes

usr/lib/modules/6.8.9-arch1-2/kernel/drivers/gpu/drm/nouveau/nouveau.ko.zst

To be in initramfs-linux.img though it may not be loaded as the modconf was also in the hooks array and that should have include /etc/modprobe.d/blacklist.conf in the initrd and that file contains:

blacklist nouveau

Offline

#8 2024-05-14 06:45:25

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

Re: [SOLVED] Black screen for NVIDIA and AMD hybrid graphics

I haven't installed the nvidia drivers yet, because I wanted to have my system up and going first. And now I'm neither sure if nouveau is the problem!I haven't installed the nvidia drivers yet, because I wanted to have my system up and going first. And now I'm neither sure if nouveau is the problem!

You'll need one driver (and nvidia would automatically blacklist nouveau) or you'll end up w/ the simpledrm device or VESA VGA.

https://wiki.archlinux.org/title/NVIDIA#Installation - pay close attention to all steps.
Do not try to "fix" issues w/ nouveau by removing nouveau while using nouveau as your (only) driver

Online

#9 2024-05-28 01:55:04

SoundOfE
Member
Registered: 2024-05-11
Posts: 11

Re: [SOLVED] Black screen for NVIDIA and AMD hybrid graphics

So I've been learning/digging into DRM, mkinitcpio etc. lately, and I'm pretty sure that nouveau has nothing to do with my problem, instead the system is having problem with KMS.

My Legion laptop has hybrid graphic system: a discrete NVIDIA GeForce RTX 4060 and an internal AMD Radeon™ 780M (from AMD Ryzen™ 7 7840HS). The official, newest NVIDIA linux drivers are now installed through pacman. My hypothesis is that my KMS problem is caused by shared display memory between internal and discrete GPU (NVIDIA Optimus technology), but I am not sure. Help is appreciated.

As said, the screen will only keep visible (not switch to blank) if I add the nomodeset kernel parameter.There is also the kernel parameter nvidia_drm.modeset that changes things. With nomodeset, the kernel will either be using the display driver simpledrm (if nvidia_drm.modeset=0) or the efifb driver (nvidia_drm.modeset=1) (I guess efifb is the builtin UEFI text display functionality).

If I remove nomodeset the screen will become blank after some boot messages in the console. But then the amdgpu driver will also load. Based on journalctl, the boot process will switch between 3 console drivers:

simpledrm (nvidia_drm.modeset=0) or efibf (nvidia_drm.modeset=1) -> amdgpu -> nvidia_drm

Here are journals and misc output for the 4 configurations:

nomodeset: http://0x0.st/XN-e.txt (journal), http://0x0.st/XN-2.txt (misc)
nomodeset + nvidia_drm: http://0x0.st/XN-_.txt (journal), http://0x0.st/XN-Y.txt (misc)
modeset: http://0x0.st/XN-p.txt (journal), http://0x0.st/XN-f.txt (mish). Especially lines: 1023 and 1399
modeset + nvidia_drm: http://0x0.st/XNBA.txt (journal), http://0x0.st/XNBc.txt. Especially lines: 1047 and 1402

What can I do?

Thanks!


PS: There are also some mknod errors for nvidia in the journals - may those be interesting? 
PS: Is it possible to remove the noveau driver from the initramfs? It will be included by the autoload hook of mkinitcpio, but blacklisted (by the modprobe hook?). I couldn't find a solution in mkinitcpio

Last edited by SoundOfE (2024-05-29 07:06:34)

Offline

#10 2024-05-28 06:28:10

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

Re: [SOLVED] Black screen for NVIDIA and AMD hybrid graphics

ps1: no
ps2: remove the kms hook and add the modules manually (see the nvidia installation paragraph in the wiki)

http://0x0.st/XN-V.txt has "/sys/module/nvidia_drm/parameters/modeset = N" what's absolutely no supposed to be the case for "nvidia_drm.modeset=1" in http://0x0.st/XN-O.txt and isn't really reflected there either.
http://0x0.st/XN-V.txt is also ~20m younger than http://0x0.st/XN-O.txt - did you instead just obtain that from some nomodeset boot?

May 28 02:22:08 legionarch kernel: nvidia-modeset: WARNING: GPU:0: Unable to read EDID for display device DP-2
May 28 02:22:08 legionarch kernel: nvidia-modeset: WARNING: GPU:0: Unable to read EDID for display device DP-2

Do you have the opportunity to ssh into the system to inspect it in its broken state?

May 28 02:22:06 legionarch kernel: fbcon: Deferring console take-over
May 28 02:22:06 legionarch kernel: fbcon: Taking over console
May 28 02:22:06 legionarch kernel: fbcon: amdgpudrmfb (fb0) is primary device

Stupid question: what if you just add "nvidia_drm.modeset=1 module_blacklist=amdgpu"

Online

#11 2024-05-29 16:08:39

SoundOfE
Member
Registered: 2024-05-11
Posts: 11

Re: [SOLVED] Black screen for NVIDIA and AMD hybrid graphics

(I've corrected the links above)

Not a stupid question! It seems that the blank screen happens when the kernel runs in modeset AND amdgpu is enabled. This is based on the following observations all running in modeset:

0) With no additional kernel parameters, the screen becomes blank
1) If I remove amdgpu by module_blacklist=amdgpu, then the screen will not blank (without and with nvidia_drm.modeset=1). http://0x0.st/XN1d.txt (journal) and http://0x0.st/XN1n.txt (misc)
2) If I change from Dynamic Graphics to Discrete Graphics in UEFI settings, then the screen will not blank (without and with nvidia_drm.modeset=1). The internal GPU is still found and driver loaded (amdgpu). http://0x0.st/XN1R.txt (journal) and http://0x0.st/XN17.txt (misc)
3) If I change from Dynamic Graphics to Discrete Graphics in UEFI settings and also add the two module parameters nvidia_drm.modeset=1 nvidia_drm.fbdev=1, the screen will not blank BUT ALSO switch to a visible new graphics setting nvidia-drmdrmfb (a framebuffer device from NVIDIA different from simpledrmdrmfb and efifb, I guess). http://0x0.st/XN1h.txt (journal) and http://0x0.st/XN1F.txt (misc). The same effect does not happen with dynamic graphics and blacklisted amdgpu.
4) With kernel argument module_blacklist=nvidia, the screen will blank. http://0x0.st/XNjs.txt (journal) and http://0x0.st/XNjz.txt (misc).

Can the console framebuffer takeover by amdgpudrmfb be the problem (can we prevent the takeover?)?

I need to dual boot with Windows because of professional software for Windows (which this computer is mostly used for), so permanently setting Discrete Graphics in UEFI is not suitable. A solution could be to run Linux only with the power saving internal GPU (amdgpu) because I don't need Linux for graphic applications, but I don't know how to do this. And the best would of course be able to use both (through PRIME?).

I'm going to use a desktop environment, but I have not tried to install Wayland/GUI yet because of all these problems. I've read that KMS is necessary (i.e. I can't use nomodeset). But KMS can now at least be achieved by blacklisting amdgpu.

I can set up SSHD, but not sure what to look after when the screen is blank. Im not sure what the EDID for display device DP-2 means.

Thank you

Last edited by SoundOfE (2024-05-29 16:10:43)

Offline

#12 2024-05-29 21:45:46

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

Re: [SOLVED] Black screen for NVIDIA and AMD hybrid graphics

https://raw.githubusercontent.com/torva … /fbcon.rst
Try "fbcon=map:01" or "fbcon=map:10" (half of your TTYs should™ have output) - there's no output connected to the AMD GPU at all? Why do you have it activated?
X11/wayland can be forced (and hopefully default) to https://wiki.archlinux.org/title/PRIME#Reverse_PRIME

Wrt "dual boot with Windows",  3rd link below. Mandatory.
Disable it (it's NOT the BIOS setting!) and reboot windows and linux twice for voodo reasons.

Online

#13 2024-06-03 20:03:54

SoundOfE
Member
Registered: 2024-05-11
Posts: 11

Re: [SOLVED] Black screen for NVIDIA and AMD hybrid graphics

Dual booting windows (without fast start) is already up and going - well, except for Linux which I have problems with as described here.

Alt-FnX together with fbcon=map:01 (and 10) gave no difference, screen is still black.

This is a hybrid graphics solution: a discrete NVIDIA GeForce RTX 4060 and an internal AMD Radeon™ 780M (from AMD Ryzen™ 7 7840HS). This uses the NVIDIA Optimus technology (I'm pretty sure). As I understand, the NVIDIA GPU needs the AMD GPU (IGP) that has the connection to my laptop screen. I think this is were things goes bad, but I don't know why. I don't know so much about hardware neither. Citing Wikipedia:

Optimus avoids usage of a hardware multiplexer and prevents glitches associated with changing the display driver from IGP to GPU by transferring the display surface from the GPU frame buffer over the PCI Express bus to the main memory-based framebuffer used by the IGP. The Optimus Copy Engine is a new alternative to traditional DMA transfers between the GPU framebuffer memory and main memory used by the IGP.



The kernel log also mentions something about vga_switcheroo(https://www.chiark.greenend.org.uk/doc/ … heroo.html):

May 29 10:13:29 legionarch kernel: amdgpu: amdgpu: vga_switcheroo: detected switching method \_SB_.PCI0.GP17.VGA_.ATPX handle
May 29 10:13:29 legionarch kernel: amdgpu: ATPX version 1, functions 0x00000001
May 29 10:13:29 legionarch kernel: amdgpu: ATPX Hybrid Graphics
May 29 10:13:29 legionarch kernel: amdgpu: Virtual CRAT table created for CPU
May 29 10:13:29 legionarch kernel: amdgpu: Topology: Add CPU node

The path /sys/kernel/debug/vgaswitcheroo/ as described here https://help.ubuntu.com/community/HybridGraphics is not available in my system

Offline

#14 2024-06-04 15:42:16

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

Re: [SOLVED] Black screen for NVIDIA and AMD hybrid graphics

This is a hybrid graphics solution: a discrete NVIDIA GeForce RTX 4060 and an internal AMD Radeon™ 780M (from AMD Ryzen™ 7 7840HS). This uses the NVIDIA Optimus technology (I'm pretty sure). As I understand, the NVIDIA GPU needs the AMD GPU (IGP) that has the connection to my laptop screen.

If this was true blacklisting amdgpu would not work.
Boot the sysetm w/ and w/o amdgpu blacklisted and run

for OUT in /sys/class/drm/card*; do echo $OUT; edid-decode $OUT/edid; echo "================="; done

You'll need https://aur.archlinux.org/packages/edid-decode-git

Online

#15 2024-06-07 12:06:59

SoundOfE
Member
Registered: 2024-05-11
Posts: 11

Re: [SOLVED] Black screen for NVIDIA and AMD hybrid graphics

Sorry for late reply, I have been busy with work.

amdgpu blacklisted or not gives different "cards" in /sys/class/drm. But it turns out that all their edid files are empty.

No extra kernel parameters:

##################################################
#  modeset + amdgpu:

$ ls -lh /sys/class/drm
lrwxrwxrwx  1 root root    0 Jun  7 13:11 card0 -> ../../devices/pci0000:00/0000:00:01.1/0000:01:00.0/drm/card0
lrwxrwxrwx  1 root root    0 Jun  7 13:11 card1 -> ../../devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card1
lrwxrwxrwx  1 root root    0 Jun  7 13:11 card1-DP-1 -> ../../devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card1/card1-DP-1
lrwxrwxrwx  1 root root    0 Jun  7 13:11 card1-DP-2 -> ../../devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card1/card1-DP-2
lrwxrwxrwx  1 root root    0 Jun  7 13:11 card1-DP-3 -> ../../devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card1/card1-DP-3
lrwxrwxrwx  1 root root    0 Jun  7 13:11 card1-DP-4 -> ../../devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card1/card1-DP-4
lrwxrwxrwx  1 root root    0 Jun  7 13:11 card1-DP-5 -> ../../devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card1/card1-DP-5
lrwxrwxrwx  1 root root    0 Jun  7 13:11 card1-DP-6 -> ../../devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card1/card1-DP-6
lrwxrwxrwx  1 root root    0 Jun  7 13:11 card1-DP-7 -> ../../devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card1/card1-DP-7
lrwxrwxrwx  1 root root    0 Jun  7 13:11 card1-DP-8 -> ../../devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card1/card1-DP-8
lrwxrwxrwx  1 root root    0 Jun  7 13:11 card1-eDP-1 -> ../../devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card1/card1-eDP-1
lrwxrwxrwx  1 root root    0 Jun  7 13:11 card1-Writeback-1 -> ../../devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card1/card1-Writeback-1
lrwxrwxrwx  1 root root    0 Jun  7 13:11 renderD128 -> ../../devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/renderD128
lrwxrwxrwx  1 root root    0 Jun  7 13:11 renderD129 -> ../../devices/pci0000:00/0000:00:01.1/0000:01:00.0/drm/renderD129
-r--r--r--  1 root root 4.0K Jun  7 13:11 version

$ fd -l edid /sys
-r--r--r-- 1 root root    0 Jun  7 13:11 /sys/devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card1/card1-DP-1/edid
-r--r--r-- 1 root root    0 Jun  7 13:11 /sys/devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card1/card1-DP-2/edid
-r--r--r-- 1 root root    0 Jun  7 13:11 /sys/devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card1/card1-DP-3/edid
-r--r--r-- 1 root root    0 Jun  7 13:11 /sys/devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card1/card1-DP-4/edid
-r--r--r-- 1 root root    0 Jun  7 13:11 /sys/devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card1/card1-DP-5/edid
-r--r--r-- 1 root root    0 Jun  7 13:11 /sys/devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card1/card1-DP-6/edid
-r--r--r-- 1 root root    0 Jun  7 13:11 /sys/devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card1/card1-DP-7/edid
-r--r--r-- 1 root root    0 Jun  7 13:11 /sys/devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card1/card1-DP-8/edid
-r--r--r-- 1 root root    0 Jun  7 13:11 /sys/devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card1/card1-eDP-1/edid
-r--r--r-- 1 root root    0 Jun  7 13:11 /sys/devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card1/card1-Writeback-1/edid
# removed /sys/kernel/debug/dri/0000:05:00.0/DP-1/edid_override etc
# removed /sys/module/drm/parameters/edid_firmware/edid_fixup

Using extra kernel parameters module_blacklist=amdgpu:

##################################################
# using kernel parameters 'module_blacklist=amdgpu': modeset - amdgpu

$ ls -lh /sys/class/drm
lrwxrwxrwx  1 root root    0 Jun  7 12:57 card0 -> ../../devices/pci0000:00/0000:00:01.1/0000:01:00.0/drm/card0
lrwxrwxrwx  1 root root    0 Jun  7 12:55 card0-DP-1 -> ../../devices/pci0000:00/0000:00:01.1/0000:01:00.0/drm/card0/card0-DP-1
lrwxrwxrwx  1 root root    0 Jun  7 12:55 card0-eDP-1 -> ../../devices/pci0000:00/0000:00:01.1/0000:01:00.0/drm/card0/card0-eDP-1
lrwxrwxrwx  1 root root    0 Jun  7 12:55 card0-HDMI-A-1 -> ../../devices/pci0000:00/0000:00:01.1/0000:01:00.0/drm/card0/card0-HDMI-A-1
lrwxrwxrwx  1 root root    0 Jun  7 12:57 renderD128 -> ../../devices/pci0000:00/0000:00:01.1/0000:01:00.0/drm/renderD128
-r--r--r--  1 root root 4.0K Jun  7 12:57 version

$ fd -l edid /sys
-r--r--r-- 1 root root    0 Jun  7 12:57 /sys/devices/pci0000:00/0000:00:01.1/0000:01:00.0/drm/card0/card0-DP-1/edid
-r--r--r-- 1 root root    0 Jun  7 12:57 /sys/devices/pci0000:00/0000:00:01.1/0000:01:00.0/drm/card0/card0-eDP-1/edid
-r--r--r-- 1 root root    0 Jun  7 12:57 /sys/devices/pci0000:00/0000:00:01.1/0000:01:00.0/drm/card0/card0-HDMI-A-1/edid
# removed /sys/kernel/debug/dri/0000:05:00.0/DP-1/edid_override etc
# removed /sys/module/drm/parameters/edid_firmware/edid_fixup

Using extra kernel parameters nvidia_drm.modeset=1:

##################################################
# using kernel parameters 'nvidia_drm.modeset=1': modeset + nvidia_drm.modeset + amdgpu

$ ls -lh /sys/class/drm
lrwxrwxrwx  1 root root    0 Jun  7 13:13 card0 -> ../../devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card0
lrwxrwxrwx  1 root root    0 Jun  7 13:13 card0-DP-1 -> ../../devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card0/card0-DP-1
lrwxrwxrwx  1 root root    0 Jun  7 13:13 card0-DP-2 -> ../../devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card0/card0-DP-2
lrwxrwxrwx  1 root root    0 Jun  7 13:13 card0-DP-3 -> ../../devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card0/card0-DP-3
lrwxrwxrwx  1 root root    0 Jun  7 13:13 card0-DP-4 -> ../../devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card0/card0-DP-4
lrwxrwxrwx  1 root root    0 Jun  7 13:13 card0-DP-5 -> ../../devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card0/card0-DP-5
lrwxrwxrwx  1 root root    0 Jun  7 13:13 card0-DP-6 -> ../../devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card0/card0-DP-6
lrwxrwxrwx  1 root root    0 Jun  7 13:13 card0-DP-7 -> ../../devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card0/card0-DP-7
lrwxrwxrwx  1 root root    0 Jun  7 13:13 card0-DP-8 -> ../../devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card0/card0-DP-8
lrwxrwxrwx  1 root root    0 Jun  7 13:13 card0-eDP-1 -> ../../devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card0/card0-eDP-1
lrwxrwxrwx  1 root root    0 Jun  7 13:13 card0-Writeback-1 -> ../../devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card0/card0-Writeback-1
lrwxrwxrwx  1 root root    0 Jun  7 13:14 card1 -> ../../devices/pci0000:00/0000:00:01.1/0000:01:00.0/drm/card1
lrwxrwxrwx  1 root root    0 Jun  7 13:13 card1-DP-9 -> ../../devices/pci0000:00/0000:00:01.1/0000:01:00.0/drm/card1/card1-DP-9
lrwxrwxrwx  1 root root    0 Jun  7 13:13 card1-eDP-2 -> ../../devices/pci0000:00/0000:00:01.1/0000:01:00.0/drm/card1/card1-eDP-2
lrwxrwxrwx  1 root root    0 Jun  7 13:13 card1-HDMI-A-1 -> ../../devices/pci0000:00/0000:00:01.1/0000:01:00.0/drm/card1/card1-HDMI-A-1
lrwxrwxrwx  1 root root    0 Jun  7 13:13 renderD128 -> ../../devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/renderD128
lrwxrwxrwx  1 root root    0 Jun  7 13:14 renderD129 -> ../../devices/pci0000:00/0000:00:01.1/0000:01:00.0/drm/renderD129
-r--r--r--  1 root root 4.0K Jun  7 13:14 version

$ fd -l edid /sys
-r--r--r-- 1 root root    0 Jun  7 13:14 /sys/devices/pci0000:00/0000:00:01.1/0000:01:00.0/drm/card1/card1-DP-9/edid
-r--r--r-- 1 root root    0 Jun  7 13:14 /sys/devices/pci0000:00/0000:00:01.1/0000:01:00.0/drm/card1/card1-eDP-2/edid
-r--r--r-- 1 root root    0 Jun  7 13:14 /sys/devices/pci0000:00/0000:00:01.1/0000:01:00.0/drm/card1/card1-HDMI-A-1/edid
-r--r--r-- 1 root root    0 Jun  7 13:14 /sys/devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card0/card0-DP-1/edid
-r--r--r-- 1 root root    0 Jun  7 13:14 /sys/devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card0/card0-DP-2/edid
-r--r--r-- 1 root root    0 Jun  7 13:14 /sys/devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card0/card0-DP-3/edid
-r--r--r-- 1 root root    0 Jun  7 13:14 /sys/devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card0/card0-DP-4/edid
-r--r--r-- 1 root root    0 Jun  7 13:14 /sys/devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card0/card0-DP-5/edid
-r--r--r-- 1 root root    0 Jun  7 13:14 /sys/devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card0/card0-DP-6/edid
-r--r--r-- 1 root root    0 Jun  7 13:14 /sys/devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card0/card0-DP-7/edid
-r--r--r-- 1 root root    0 Jun  7 13:14 /sys/devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card0/card0-DP-8/edid
-r--r--r-- 1 root root    0 Jun  7 13:14 /sys/devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card0/card0-eDP-1/edid
-r--r--r-- 1 root root    0 Jun  7 13:14 /sys/devices/pci0000:00/0000:00:08.1/0000:05:00.0/drm/card0/card0-Writeback-1/edid
# removed /sys/kernel/debug/dri/0000:05:00.0/DP-1/edid_override etc
# removed /sys/module/drm/parameters/edid_firmware/edid_fixup

I changed your for loop into using fd to find all edid files. With the kernel parameter nvidia_drm.modeset=1, I get complaints about missing EDID and not crts or sizes:

Jun 07 03:08:15 legionarch kernel: nvidia 0000:01:00.0: enabling device (0000 -> 0003)
Jun 07 03:08:15 legionarch kernel: nvidia 0000:01:00.0: vgaarb: VGA decodes changed: olddecodes=io+mem,decodes=none:owns=none
Jun 07 03:08:16 legionarch kernel: NVRM: loading NVIDIA UNIX x86_64 Kernel Module  550.78  Sun Apr 14 06:35:45 UTC 2024
Jun 07 03:08:16 legionarch (udev-worker)[436]: nvidia: Process '/usr/bin/bash -c '/usr/bin/mknod -Z -m 666 /dev/nvidiactl c $(grep nvidia /proc/devices | cut -d \  -f 1) 255'' failed with exit code 1.
Jun 07 03:08:16 legionarch (udev-worker)[455]: nvidia: Process '/usr/bin/bash -c '/usr/bin/mknod -Z -m 666 /dev/nvidiactl c $(grep nvidia /proc/devices | cut -d \  -f 1) 255'' failed with exit code 1.
Jun 07 03:08:16 legionarch (udev-worker)[436]: nvidia: Process '/usr/bin/bash -c 'for i in $(cat /proc/driver/nvidia/gpus/*/information | grep Minor | cut -d \  -f 4); do /usr/bin/mknod -Z -m 666 /dev/nvidia${i} c $(grep nvidia /proc/devices | cut -d \  -f 1) ${i}; done'' failed with exit code 1.
Jun 07 03:08:16 legionarch (udev-worker)[455]: nvidia: Process '/usr/bin/bash -c 'for i in $(cat /proc/driver/nvidia/gpus/*/information | grep Minor | cut -d \  -f 4); do /usr/bin/mknod -Z -m 666 /dev/nvidia${i} c $(grep nvidia /proc/devices | cut -d \  -f 1) ${i}; done'' failed with exit code 1.
Jun 07 03:08:16 legionarch kernel: nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms  550.78  Sun Apr 14 06:23:31 UTC 2024
Jun 07 03:08:16 legionarch kernel: nvidia_uvm: module uses symbols nvUvmInterfaceDisableAccessCntr from proprietary module nvidia, inheriting taint.
Jun 07 03:08:16 legionarch kernel: [drm] [nvidia-drm] [GPU ID 0x00000100] Loading driver
Jun 07 03:08:16 legionarch (udev-worker)[436]: nvidia_modeset: Process '/usr/bin/bash -c '/usr/bin/mknod -Z -m 666 /dev/nvidia-modeset c $(grep nvidia /proc/devices | cut -d \  -f 1) 254'' failed with exit code 1.
Jun 07 03:08:16 legionarch kernel: ACPI Warning: \_SB.NPCF._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20230628/nsarguments-61)
Jun 07 03:08:16 legionarch kernel: ACPI Warning: \_SB.PCI0.GPP0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20230628/nsarguments-61)
Jun 07 03:08:16 legionarch kernel: ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.GPP0.PEGP.GPS.NVD1], AE_NOT_FOUND (20230628/psargs-330)
Jun 07 03:08:16 legionarch kernel: ACPI Error: Aborting method \_SB.PCI0.GPP0.PEGP.GPS due to previous error (AE_NOT_FOUND) (20230628/psparse-529)
Jun 07 03:08:16 legionarch kernel: ACPI Error: Aborting method \_SB.PCI0.GPP0.PEGP._DSM due to previous error (AE_NOT_FOUND) (20230628/psparse-529)
Jun 07 03:08:16 legionarch systemd-modules-load[381]: Inserted module 'nvidia_uvm'
Jun 07 03:08:16 legionarch kernel: nvidia-uvm: Loaded the UVM driver, major device number 234.
Jun 07 03:08:16 legionarch systemd-modules-load[381]: Inserted module 'pkcs8_key_parser'
Jun 07 03:08:16 legionarch kernel: Asymmetric key parser 'pkcs8' registered
Jun 07 03:08:16 legionarch systemd[1]: Finished Load Kernel Modules.
Jun 07 03:08:16 legionarch kernel: nvidia-modeset: WARNING: GPU:0: Unable to read EDID for display device DP-2
Jun 07 03:08:16 legionarch kernel: nvidia-modeset: WARNING: GPU:0: Unable to read EDID for display device DP-2
Jun 07 03:08:16 legionarch kernel: [drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:01:00.0 on minor 1
Jun 07 03:08:16 legionarch kernel: nvidia 0000:01:00.0: [drm] Cannot find any crtc or sizes

I can try to read the EDID file for my laptop screen through Windows and then add it to Linux, but not sure if that would do anything better.

seth wrote:

If this was true blacklisting amdgpu would not work.

: Maybe I misunderstand you, but I meant that the discrete GPU depends on hardware of the integrated GPU (IGP), but the IGP does not necessary need a GPU driver for this to work. For example, I can "disable" the integrated GPU with a UEFI graphics setting of "Discrete GPU only" and the screen will work without any amdgpu driver.

Thank you!

Offline

#16 2024-06-07 14:49:41

SoundOfE
Member
Registered: 2024-05-11
Posts: 11

Re: [SOLVED] Black screen for NVIDIA and AMD hybrid graphics

Update: Sorry, empty-sized edid files in sysfs doesn't mean anything. Here is what you asked for.

Kernel parameter nvidia_drm.modeset=1 (modeset + nvidia_drm.modeset + amdgpu):

==== /sys/class/drm/card0-DP-1/edid ====
EDID of '/sys/class/drm/card0-DP-1/edid' was empty.



==== /sys/class/drm/card0-DP-2/edid ====
EDID of '/sys/class/drm/card0-DP-2/edid' was empty.



==== /sys/class/drm/card0-DP-3/edid ====
EDID of '/sys/class/drm/card0-DP-3/edid' was empty.



==== /sys/class/drm/card0-DP-4/edid ====
EDID of '/sys/class/drm/card0-DP-4/edid' was empty.



==== /sys/class/drm/card0-DP-5/edid ====
EDID of '/sys/class/drm/card0-DP-5/edid' was empty.



==== /sys/class/drm/card0-DP-6/edid ====
EDID of '/sys/class/drm/card0-DP-6/edid' was empty.



==== /sys/class/drm/card0-DP-7/edid ====
EDID of '/sys/class/drm/card0-DP-7/edid' was empty.



==== /sys/class/drm/card0-DP-8/edid ====
EDID of '/sys/class/drm/card0-DP-8/edid' was empty.



==== /sys/class/drm/card0-eDP-1/edid ====
edid-decode (hex):

00 ff ff ff ff ff ff 00 06 af a5 c1 a5 c1 00 00
1c 20 01 04 b5 22 16 78 03 ca 35 a6 55 49 99 25
10 50 54 00 00 00 01 01 01 01 01 01 01 01 01 01
01 01 01 01 01 01 78 6e 00 a0 a0 40 84 60 30 20
aa 00 58 d7 10 00 00 18 00 00 00 fd 0c 30 a5 1f
1f 4e 01 0a 20 20 20 20 20 20 00 00 00 fe 00 41
55 4f 0a 20 20 20 20 20 20 20 20 20 00 00 00 fe
00 42 31 36 30 51 41 4e 30 33 2e 4c 20 0a 01 7b

70 13 79 00 00 03 01 14 b6 2f 01 84 ff 09 9f 00
2f 00 1f 00 3f 06 83 00 09 00 09 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 23 90

----------------

Block 0, Base EDID:
  EDID Structure Version & Revision: 1.4
  Vendor & Product Identification:
    Manufacturer: AUO
    Model: 49573
    Serial Number: 49573 (0x0000c1a5)
    Made in: week 28 of 2022
  Basic Display Parameters & Features:
    Digital display
    Bits per primary color channel: 10
    DisplayPort interface
    Maximum image size: 34 cm x 22 cm
    Gamma: 2.20
    Supported color formats: RGB 4:4:4
    First detailed timing includes the native pixel format and preferred refresh rate
    Display supports continuous frequencies
  Color Characteristics:
    Red  : 0.6513, 0.3320
    Green: 0.2871, 0.5996
    Blue : 0.1445, 0.0654
    White: 0.3134, 0.3291
  Established Timings I & II: none
  Standard Timings: none
  Detailed Timing Descriptors:
    DTD 1:  2560x1600   60.029208 Hz  16:10   103.971 kHz    282.800000 MHz (344 mm x 215 mm)
                 Hfront   48 Hsync  32 Hback   80 Hpol N
                 Vfront   10 Vsync  10 Vback  112 Vpol N
    Display Range Limits:
      Monitor ranges (Range Limits Only): 48-165 Hz V, 286-286 kHz H, max dotclock 780 MHz
    Alphanumeric Data String: 'AUO'
    Alphanumeric Data String: 'B160QAN03.L '
  Extension blocks: 1
Checksum: 0x7b

----------------

Block 1, DisplayID Extension Block:
  Version: 1.3
  Extension Count: 0
  Display Product Type: Extension Section
  Video Timing Modes Type 1 - Detailed Timings Data Block:
    DTD:  2560x1600  165.039991 Hz  16:9    285.849 kHz    777.510000 MHz (aspect 16:9, no 3D stereo, preferred)
               Hfront   48 Hsync  32 Hback   80 Hpol N
               Vfront   10 Vsync  10 Vback  112 Vpol N
  Checksum: 0x23
Checksum: 0x90



==== /sys/class/drm/card0-Writeback-1/edid ====
EDID of '/sys/class/drm/card0-Writeback-1/edid' was empty.



==== /sys/class/drm/card1-DP-9/edid ====
EDID of '/sys/class/drm/card1-DP-9/edid' was empty.



==== /sys/class/drm/card1-eDP-2/edid ====
EDID of '/sys/class/drm/card1-eDP-2/edid' was empty.



==== /sys/class/drm/card1-HDMI-A-1/edid ====
EDID of '/sys/class/drm/card1-HDMI-A-1/edid' was empty.

Kernel parameters nvidia_drm.modeset=1 module_blacklist=amdgpu (modeset + nvidia_drm.modeset - amdgpu):

==== /sys/class/drm/card0-DP-1/edid ====
EDID of '/sys/class/drm/card0-DP-1/edid' was empty.



==== /sys/class/drm/card0-eDP-1/edid ====
EDID of '/sys/class/drm/card0-eDP-1/edid' was empty.



==== /sys/class/drm/card0-HDMI-A-1/edid ====
EDID of '/sys/class/drm/card0-HDMI-A-1/edid' was empty.

UEFI Graphic Device setting "Discrete Graphics" and kernel parameters nvidia_drm.modeset=1 module_blacklist=amdgpu (modeset + nvidia_drm.modeset - amdgpu):

==== /sys/class/drm/card0-DP-1/edid ====
EDID of '/sys/class/drm/card0-DP-1/edid' was empty.



==== /sys/class/drm/card0-eDP-1/edid ====
edid-decode (hex):

00 ff ff ff ff ff ff 00 06 af a5 c1 a5 c1 00 00
1c 20 01 04 b5 22 16 78 03 ca 35 a6 55 49 99 25
10 50 54 00 00 00 01 01 01 01 01 01 01 01 01 01
01 01 01 01 01 01 78 6e 00 a0 a0 40 84 60 30 20
aa 00 58 d7 10 00 00 18 00 00 00 fd 0c 30 a5 1f
1f 4e 01 0a 20 20 20 20 20 20 00 00 00 fe 00 41
55 4f 0a 20 20 20 20 20 20 20 20 20 00 00 00 fe
00 42 31 36 30 51 41 4e 30 33 2e 4c 20 0a 01 7b

70 13 79 00 00 03 01 14 b6 2f 01 84 ff 09 9f 00
2f 00 1f 00 3f 06 83 00 09 00 09 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 23 90

----------------

Block 0, Base EDID:
  EDID Structure Version & Revision: 1.4
  Vendor & Product Identification:
    Manufacturer: AUO
    Model: 49573
    Serial Number: 49573 (0x0000c1a5)
    Made in: week 28 of 2022
  Basic Display Parameters & Features:
    Digital display
    Bits per primary color channel: 10
    DisplayPort interface
    Maximum image size: 34 cm x 22 cm
    Gamma: 2.20
    Supported color formats: RGB 4:4:4
    First detailed timing includes the native pixel format and preferred refresh rate
    Display supports continuous frequencies
  Color Characteristics:
    Red  : 0.6513, 0.3320
    Green: 0.2871, 0.5996
    Blue : 0.1445, 0.0654
    White: 0.3134, 0.3291
  Established Timings I & II: none
  Standard Timings: none
  Detailed Timing Descriptors:
    DTD 1:  2560x1600   60.029208 Hz  16:10   103.971 kHz    282.800000 MHz (344 mm x 215 mm)
                 Hfront   48 Hsync  32 Hback   80 Hpol N
                 Vfront   10 Vsync  10 Vback  112 Vpol N
    Display Range Limits:
      Monitor ranges (Range Limits Only): 48-165 Hz V, 286-286 kHz H, max dotclock 780 MHz
    Alphanumeric Data String: 'AUO'
    Alphanumeric Data String: 'B160QAN03.L '
  Extension blocks: 1
Checksum: 0x7b

----------------

Block 1, DisplayID Extension Block:
  Version: 1.3
  Extension Count: 0
  Display Product Type: Extension Section
  Video Timing Modes Type 1 - Detailed Timings Data Block:
    DTD:  2560x1600  165.039991 Hz  16:9    285.849 kHz    777.510000 MHz (aspect 16:9, no 3D stereo, preferred)
               Hfront   48 Hsync  32 Hback   80 Hpol N
               Vfront   10 Vsync  10 Vback  112 Vpol N
  Checksum: 0x23
Checksum: 0x90



==== /sys/class/drm/card0-HDMI-A-1/edid ====
EDID of '/sys/class/drm/card0-HDMI-A-1/edid' was empty.

The UEFI setting of discrete graphics is interesting. I get access to eDP (which seems to be the laptop screen) even though module_blacklist=amdgpu. Using UEFI discrete graphics also works without blacklisting amdgpu (and amdgpu driver is also loaded according to lspci -nk). I can also plug in an external monitor through USB-C or HDMI and it works.

Using discrete graphics by UEFI settings is not desirable, since I mostly use Windows 11 for work and need the internal graphics for extended battery time.

PS: Numbering for card0, card1 and DP-n in each of the outputs above depends on whether amdgpu is enabled or not.

Last edited by SoundOfE (2024-06-07 14:55:45)

Offline

#17 2024-06-08 15:11:36

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

Re: [SOLVED] Black screen for NVIDIA and AMD hybrid graphics

[edit: stealth bbs tag fix]

Maybe I misunderstand you, but I meant that the discrete GPU depends on hardware of the integrated GPU (IGP), but the IGP does not necessary need a GPU driver for this to work. For example, I can "disable" the integrated GPU with a UEFI graphics setting of "Discrete GPU only" and the screen will work without any amdgpu driver.

These are different conditions.
If you disable the IGP in the UEFI the outputs get re-wired by the firmware and this is completely opaque to the OS (and you also don't need to blacklist amdgpu because it's not loaded because the IGP doesn't appear to theOS at all)
If you keep the IGP enabled and have outputs attached to it you cannot blacklist amdgpu because it'll be required to redirect the output on the OS level.

The EDID output confirms that setup - the eDP is wired to the AMD GPU, you'll need that driver. The system runs on the AMD GPU, the nvidia one is largely irrelevant in this configuration.
You can try to force a resolution, https://www.kernel.org/doc/Documentation/fb/modedb.rst but since the EDID exclusively advertises 2560x1600 at 60Hz and 165Hz, I'm not even sure whether you're actually seeing any kind of resolution switch or just a bigger font to compensate for the HiDPI output.
What does "stty size" report? "25 80" or more?

Last edited by seth (2024-06-11 16:31:56)

Online

#18 2024-06-11 15:43:53

SoundOfE
Member
Registered: 2024-05-11
Posts: 11

Re: [SOLVED] Black screen for NVIDIA and AMD hybrid graphics

For some reason, adding the kernel parameter

video=2560x1600-32@60

makes amdgpu work smile (And just video=2560x1600 or video=2560x1600-32 does not work). At first sight the resolution seems to be low, but showconsolefont -iv shows 16x32, and calling setfont with no arguments sets the font to 8x16 and the fb resolution is shown to actually be the full 2560x1600 (stty size shows 100x320 too).

The video=2560x1600-32@60 kernel parameter also works well together with the parameter nvidia_drm.modeset=1. It also works if I blacklist nvidia, nvidia_drm and nouveau. I can also modprobe nouveau (lspci -nk shows nouveau in use), so I guess this post's title should be changed.

This was strange but nice. Not sure what was going on. I can hopefully set this post's status to [SOLVED] once I have verified that things are OK smile


PS: ssh (and scp) together with the program https://github.com/GunnarMonell/fbgrab (available from pacman) makes it possible to grab the console window when there is nothing on the screen.

Offline

#19 2024-06-15 13:26:55

SoundOfE
Member
Registered: 2024-05-11
Posts: 11

Re: [SOLVED] Black screen for NVIDIA and AMD hybrid graphics

I've done some tests, and the system seems to work! Here is what we've done:

A. Removed my nomodeset kernel parameter and adding this instead:

nvidia_drm.modeset=1 video=2560x1600-32@60

B. Added this line to /etc/vconsole.conf:

FONT=default8x16

C. Moved consolefont before keyboard in /etc/mkinitcpio.conf:

HOOKS=(base udev autodetect microcode modconf kms consolefont keyboard keymap block filesystems fsck)

D. Set my laptops highest screen resolution in /etc/default/grub:

GRUB_GFXMODE=2560x1600x32

E. Removed the udev rule that forces Xorg mode for GDM:

$ ln -s /dev/null /etc/udev/rules.d/61-gdm.rules

A fixes the black screen (original problem) caused by the amdgpu driver. B sets a small font for the console so I can see/use my screen's maximal resolution. C sets the small font earlier in the boot sequence so the console keeps a more consistent text resolution during boot. D makes GRUB use highest resolution (auto may work too). E lets me start/enable Gnome through the GDM systemd job.

I haven't tested external monitors, PRIME etc, but the system is now usable. GNOME > Settings > Displays > Refresh Rate shows 165.04 Hz, so I guess Gnome/Wayland know more about things.

I finally have a working Arch Linux dual boot system on my Lenovo Legion Slim 5 16APH8 laptop smile

Thank you so much to all (especially @seth) smile

Offline

Board footer

Powered by FluxBB