openSUSE / SUSEPrime

Provide nvidia-prime like package for openSUSE
64 stars 11 forks source link

prime-select intel breaks X11 (NVIDIA / Intel Alder-Lake graphics) #84

Closed deividxyz closed 2 years ago

deividxyz commented 2 years ago

Hi,

I'm using latest Tumbleweed 20220815 in my laptop, with official NVIDIA G06 drivers as provided by the openSUSE NVIDIA repo. If I run prime-select intel and then logout from the system, the system displays a black screen with a blinking cursor and I cant't no longer use the graphics environment. In order to fix this issue I need to login using the embedded virtual console in text mode and reverse the changes by running prime-select unset or by removing the files in /etc/X11/xorg.conf.d/ and then rebooting.

I can only use prime-select nvidia if I previously unset prime-select, and in this mode the NVIDIA driver works as intended. I've also disabled Wayland in /etc/gdm/custom.conf.

Any ideas to fix this issue?

Thanks in advance

Laptop Specs Laptop: ASUS TUF Dash F15 FX517ZM_FX517ZM 1.0 Kernel: 5.19.1-1-default DE: GNOME 42.4, X11 CPU: 12th Gen Intel i7-12650H (16) @ 4.600GHz GPU: Intel Alder Lake-P GT1 [UHD Graphics] GPU: NVIDIA GeForce RTX 3060 Mobile / Max-Q

sndirsch commented 2 years ago

Is this the behaviour on an external screen maybe with LID closed? I know some Laptops have the external outputs connected to NVIDIA GPU only. It's different with internal Display. NVIDIA and Intel can drive this.

deividxyz commented 2 years ago

Is this the behaviour on an external screen maybe with LID closed? I know some Laptops have the external outputs connected to NVIDIA GPU only. It's different with internal Display. NVIDIA and Intel can drive this.

I tried it without an external screen attached and with only the internal screen, but same behavior occurs. Also external display (over HDMI) doesn't work without Nvidia drivers installed.

IMG_20220820_223643.jpg

sndirsch commented 2 years ago

Thanks. So seems the Xserver cannot be started/crashed. Could you start it manually by login as root as in the picture above in the Linux console and run Xorg -retro and then attach here /var/log/Xorg.0.log after ther Xserver startup failed.

deividxyz commented 2 years ago

Thanks. So seems the Xserver cannot be started/crashed. Could you start it manually by login as root as in the picture above in the Linux console and run Xorg -retro and then attach here /var/log/Xorg.0.log after ther Xserver startup failed.

Thanks Stefan, I started Xorg -retro using root user and with intel graphics selected and the output of the logfile is the following.

Xorg.0.log.

Let me know if this helps or if you need more information regarding this issue.

Thanks in advance,

sndirsch commented 2 years ago

Hmm.

[...] [ 59.694] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.19.1-1-default root =UUID=e50ef0e1-503c-4aed-905f-0d60d4a42a27 splash=silent quiet security=apparmor mitigations=auto nosimplefb=1 [...] [ 59.713] (II) modeset(0): using default device [ 59.719] (II) modeset(G0): using drv /dev/dri/card0 [ 59.720] (EE) Fatal server error: [ 59.720] (EE) Cannot run in framebuffer mode. Please specify busIDs for all framebuffer devices [ 59.720] (EE) [ 59.720] (EE) Please consult the The X.Org Foundation support at http://wiki.x.org for help. [ 59.720] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information. [ 59.720] (EE) [ 59.749] (EE) Server terminated with error (1). Closing log file.

Could you please attach also /etc/X11/xorg.conf.d/90-intel.conf?

And the output of lspci | grep VGA, please?

deividxyz commented 2 years ago

@sndirsch here are the requested files. To get those outputs, I executed first prime-select unset and then after rebooting I executed prime-select intel and then logged out to text mode virtual console (as Xorg crashed).

lspci output:

0000:00:02.0 VGA compatible controller: Intel Corporation Alder Lake-P GT1 [UHD Graphics] (rev 0c)
0000:01:00.0 VGA compatible controller: NVIDIA Corporation GA106M [GeForce RTX 3060 Mobile / Max-Q] (rev a1)

And the contents of 90-intel.conf in /etc/X11/xorg.conf.d/90-intel.conf are the following:

Section "ServerLayout"
    Identifier "layout"
    Screen "intel"
    Option "AllowNVIDIAGPUScreens"
EndSection

Section "Device"
    Identifier "intel"
    Driver "modesetting"
    BusID "PCI:0:0:2"
EndSection

Section "Screen"
    Identifier "intel"
    Device "intel"
EndSection

Let me know if you need more information regarding this issue

sndirsch commented 2 years ago

This looks all good. I'll try to reproduce with TW myself as soon as possible with my Optimus test system.

sndirsch commented 2 years ago

Hmm. I cannot reproduce this issue on my Optimus system on TW 20220822

# inxi -aG Graphics: Device-1: Intel TigerLake-H GT1 [UHD Graphics] vendor: Lenovo driver: i915 v: kernel arch: Gen-12.1 process: Intel 10nm built: 2020-21 ports: active: eDP-1 empty: DP-1, DP-2, DP-3, DP-4, DP-5, HDMI-A-1 bus-ID: 00:02.0 chip-ID: 8086:9a60 class-ID: 0300 Device-2: NVIDIA GA104GLM [RTX A4000 Mobile] vendor: Lenovo driver: N/A alternate: nouveau, nvidia_drm, nvidia non-free: 515.xx+ status: current (as of 2022-07) arch: Ampere code: GAxxx process: TSMC n7 (7nm) built: 2020-22 pcie: gen: 4 speed: 16 GT/s lanes: 16 bus-ID: 01:00.0 chip-ID: 10de:24b7 class-ID: 0300 Device-3: Acer Integrated Camera type: USB driver: uvcvideo bus-ID: 3-4:3 chip-ID: 5986:9106 class-ID: 0e02 Display: server: X.org v: 1.21.1.4 with: Xwayland v: 22.1.3 compositor: gnome-shell v: 42.4 driver: X: loaded: modesetting gpu: i915 display-ID: localhost:10.0 screens: 1 Screen-1: 0 s-res: 3968x1080 s-size: Monitor-1: DP-1 pos: right res: 2048x1080 hz: 60 dpi: 84 size: 621x341mm (24.45x13.43") diag: 708mm (27.89") modes: N/A Monitor-2: DP-2 pos: primary,left res: 1920x1080 hz: 60 dpi: 79 size: 621x341mm (24.45x13.43") diag: 708mm (27.89") modes: N/A OpenGL: renderer: llvmpipe (LLVM 14.0.6 256 bits) v: 4.5 Mesa 22.1.6 direct render: Yes

[ 141.225] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.19.2-1-default root=UUID=a264983a-ae4e-4f1e-9d97-4dcefeaf6560 splash=silent mitigations=auto quiet security=apparmor nosimplefb=1 [...] [ 141.231] (II) modesetting: Driver for Modesetting Kernel Drivers: kms [ 141.231] (II) modeset(0): using drv /dev/dri/card0 [ 141.231] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support [ 141.231] (II) modeset(0): Creating default Display subsection in Screen section "intel" for depth/fbbpp 24/32 [ 141.231] (==) modeset(0): Depth 24, (==) framebuffer bpp 32 [...] Only the Intel device is initialized.

/etc/X11/xorg.conf.d/90-intel.conf is identical to yours, even for the BusID.

Attaching also my Xorg.0.log. Xorg.0.log

sndirsch commented 2 years ago

Same results with and without bbswitch package installed.

sndirsch commented 2 years ago

I hope you can live with "nvidia" or "offload" mode for now. Thanks to Turing platform you have DynamicPowerManagement, which is enabled by default. See /usr/lib/modprobe.d/09-nvidia-modprobe-pm-G05.conf

deividxyz commented 2 years ago

Maybe this issue is related to the fact that my laptop has a dedicated mux switch for both GPUs. There's a package in Asus-Linux called asusctl that handles this function, but it's intended for Asus ROG laptops, not TUF. Also in the BIOS there isn't any option for handling this switch, the only reference I've found was in this package below and in the Armoury Crate software package in Windows.

https://gitlab.com/asus-linux/asusctl

prishur commented 2 years ago

Maybe this issue is related to the fact that my laptop has a dedicated mux switch for both GPUs. There's a package in Asus-Linux called asusctl that handles this function, but it's intended for Asus ROG laptops, not TUF. Also in the BIOS there isn't any option for handling this switch, the only reference I've found was in this package below and in the Armoury Crate software package in Windows.

https://gitlab.com/asus-linux/asusctl

So I have exactly the same issue (prime-select intel breaking the X11 at login) on latest Tumblweed 20220822. My machine is a Lenovo without a mux switch.

It seems to me that the prime-select script fails to load the intel driver for some reason. There's no intel conf file in /etc/X11/xorg.conf.d/ at login time.

Specs, just for reference: Kernel: 5.19.2-1-default DE: KDE Plasma 5.25.4, X11 CPU: 11th Gen Intel i5-11320H (8) @ 4.500GHz GPU: Intel TigerLake-LP GT2 [Iris Xe Graphics] GPU: NVIDIA GeForce GTX 1650 Mobile / Max-Q

sndirsch commented 2 years ago

So I have exactly the same issue (prime-select intel breaking the X11 at login) on latest Tumblweed 20220822. My machine is a Lenovo without a mux switch.

It seems to me that the prime-select script fails to load the intel driver for some reason. There's no intel conf file in /etc/X11/xorg.conf.d/ at login time.

Hmm. This script doesn't load any intel driver. If there is no /etc/X11/xorg.conf.d/90-intel.conf on your system after running the script you have a different issue.

prishur commented 2 years ago

So I have exactly the same issue (prime-select intel breaking the X11 at login) on latest Tumblweed 20220822. My machine is a Lenovo without a mux switch. It seems to me that the prime-select script fails to load the intel driver for some reason. There's no intel conf file in /etc/X11/xorg.conf.d/ at login time.

Hmm. This script doesn't load any intel driver. If there is no /etc/X11/xorg.conf.d/90-intel.conf on your system after running the script you have a different issue.

Oh, ok. Might be a tumbleweed issue then.

Either way, as a workaround the OP and I can avoid using prime-select intel by using: prime select unset to use intel (assuming intel mesa is used by default). And prime-select restore ; prime-select nvidia to switch to nvidia. This works for me.

sndirsch commented 2 years ago

So I have exactly the same issue (prime-select intel breaking the X11 at login) on latest Tumblweed 20220822. My machine is a Lenovo without a mux switch. It seems to me that the prime-select script fails to load the intel driver for some reason. There's no intel conf file in /etc/X11/xorg.conf.d/ at login time.

Hmm. This script doesn't load any intel driver. If there is no /etc/X11/xorg.conf.d/90-intel.conf on your system after running the script you have a different issue.

Oh, ok. Might be a tumbleweed issue then.

I don't think so. I'm using the same TW version as you on my Optimus system, which is working fine.

Either way, as a workaround the OP and I can avoid using prime-select intel by using: prime select unset to use intel (assuming intel mesa is used by default). And prime-select restore ; prime-select nvidia to switch to nvidia. This works for me.

The main purpose of using this intel mode is to save power by disabling NVIDIA GPU completely by using bbswitch. But this is mainly important for users of pre-Turing GPUs. You already have Turing and are using DynamicPowerManagement when running in nvidia or offload mode.

deividxyz commented 2 years ago

@sndirsch I've uninstalled suse-prime and then installed asus-ctl and their graphics cards selector works without issues and I'm able to select intel or nvidia graphics using supergfxctl instead of prime-select

https://asus-linux.org/wiki/asusctl-install/

image

image

Their script seems to do a similar job as suse-prime. I'm running with integrated graphics and the outputs are the following:

image

The only file in xorg.conf.d is:

image


I'll be using this package as is more suited for ASUS Laptops.

sndirsch commented 2 years ago

Ok. I don't want to force anybody using suse-prime. Go ahead with asus-ctl if it works better for you. :-) Closing ...