Askannz / optimus-manager

A Linux program to handle GPU switching on Optimus laptops.
MIT License
2.29k stars 167 forks source link

Cannot run in framebuffer mode. Please specify busIDs. Asus ROG Zephyrus M16 Intel/Nvidia #448

Closed markusressel closed 6 months ago

markusressel commented 2 years ago

Describe the bug Hi there,

I am in the process of setting up an Asus ROG Zephyrus M16 2021 laptop with an Intel Tiger Lake Graphics and an Nvidia RTX 3070 Mobile.

I followed the advice of the README to remove /etc/X11/xorg.conf, however I do not get a picture without letting xorg generate something itself using sudo Xorg :0 -configure.

Even then, switching only results in a black screen with a blinking cursor. I have tried switching between TTY's, but it doesn't help, the screen stays black.

Let me know if you need further details, thx.

System info

Logs

/usr/share/X11/xorg.conf.d/10-nvidia-drm-outputclass.conf

Section "OutputClass"
    Identifier "intel"
    MatchDriver "i915"
    Driver "modesetting"
EndSection

Section "OutputClass"
    Identifier "nvidia"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration"
    ModulePath "/usr/lib/nvidia/xorg"
    ModulePath "/usr/lib/xorg/modules"
EndSection

/etc/X11/xorg.conf.d/10-optimus-manager.conf

Section "Device"
    Identifier "integrated"
    Driver "modesetting"
    BusID "PCI:0:0:2:0"
    Option "DRI" "3"
EndSection

/etc/optimus-manager/optimus-manager.conf

[optimus]
switching=bbswitch
pci_power_control=no
pci_remove=no
pci_reset=no

auto_logout=yes
startup_auto_extpower_mode=nvidia

[intel]
driver=modesetting
accel=
tearfree=
DRI=3
modeset=yes

[amd]
driver=modesetting
tearfree=
DRI=3

[nvidia]
modeset=yes
PAT=yes
DPI=96
ignore_abi=no
allow_external_gpus=no
options=overclocking
dynamic_power_management=fine
dynamic_power_management_memory_threshold=

/home/markus/.local/share/xorg/Xorg.0.log

This is a pre-release version of the X server from The X.Org Foundation.
It is not supported in any way.
Bugs may be filed in the bugzilla at http://bugs.freedesktop.org/.
Select the "xorg" product for bugs you find in this release.
Before reporting bugs in pre-release versions please check the
latest version in the X.Org Foundation git repository.
See http://wiki.x.org/wiki/GitPage for git access instructions.
[   109.493] 
X.Org X Server 1.21.1.1
X Protocol Version 11, Revision 0
[   109.500] Current Operating System: Linux M16 5.15.2-arch1-1 #1 SMP PREEMPT Fri, 12 Nov 2021 19:22:10 +0000 x86_64
[   109.500] Kernel command line: BOOT_IMAGE=/arch/BOOT/default@/vmlinuz-linux root=ZFS=rpool/arch/ROOT/default rw zfs_import_dir=/dev/disk/by-id loglevel=3 quiet
[   109.506]  
[   109.509] Current version of pixman: 0.40.0
[   109.514]    Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
[   109.514] Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[   109.524] (==) Log file: "/home/markus/.local/share/xorg/Xorg.0.log", Time: Mon Nov 15 01:17:55 2021
[   109.527] (==) Using config directory: "/etc/X11/xorg.conf.d"
[   109.529] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[   109.529] (==) No Layout section.  Using the first Screen section.
[   109.529] (==) No screen section available. Using defaults.
[   109.529] (**) |-->Screen "Default Screen Section" (0)
[   109.529] (**) |   |-->Monitor "<default monitor>"
[   109.529] (==) No device specified for screen "Default Screen Section".
    Using the first device section listed.
[   109.529] (**) |   |-->Device "integrated"
[   109.529] (==) No monitor specified for screen "Default Screen Section".
    Using a default monitor configuration.
[   109.529] (==) Automatically adding devices
[   109.529] (==) Automatically enabling devices
[   109.529] (==) Automatically adding GPU devices
[   109.529] (==) Automatically binding GPU devices
[   109.529] (==) Max clients allowed: 256, resource mask: 0x1fffff
[   109.529] (WW) The directory "/usr/share/fonts/misc" does not exist.
[   109.529]    Entry deleted from font path.
[   109.529] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/TTF".
[   109.529]    Entry deleted from font path.
[   109.529]    (Run 'mkfontdir' on "/usr/share/fonts/TTF").
[   109.529] (WW) The directory "/usr/share/fonts/OTF" does not exist.
[   109.529]    Entry deleted from font path.
[   109.529] (WW) The directory "/usr/share/fonts/Type1" does not exist.
[   109.529]    Entry deleted from font path.
[   109.529] (WW) The directory "/usr/share/fonts/100dpi" does not exist.
[   109.529]    Entry deleted from font path.
[   109.529] (WW) The directory "/usr/share/fonts/75dpi" does not exist.
[   109.529]    Entry deleted from font path.
[   109.529] (==) FontPath set to:

[   109.529] (==) ModulePath set to "/usr/lib/xorg/modules"
[   109.529] (II) The server relies on udev to provide the list of input devices.
    If no devices become available, reconfigure udev or disable AutoAddDevices.
[   109.529] (II) Module ABI versions:
[   109.529]    X.Org ANSI C Emulation: 0.4
[   109.529]    X.Org Video Driver: 25.2
[   109.529]    X.Org XInput driver : 24.4
[   109.529]    X.Org Server Extension : 10.0
[   109.530] (++) using VT number 5

[   109.531] (II) systemd-logind: took control of session /org/freedesktop/login1/session/_31
[   109.531] (II) xfree86: Adding drm device (/dev/dri/card0)
[   109.531] (II) Platform probe for /sys/devices/pci0000:00/0000:00:02.0/drm/card0
[   109.532] (II) systemd-logind: got fd for /dev/dri/card0 226:0 fd 11 paused 0
[   109.533] (--) PCI:*(0@0:2:0) 8086:9a60:1043:132c rev 1, Mem @ 0x6230000000/16777216, 0x4000000000/268435456, I/O @ 0x00005000/64, BIOS @ 0x????????/131072
[   109.533] (--) PCI: (1@0:0:0) 10de:249d:1043:132c rev 161, Mem @ 0x85000000/16777216, 0x6000000000/8589934592, 0x6200000000/33554432, I/O @ 0x00004000/128, BIOS @ 0x????????/524288
[   109.533] (II) Open ACPI successful (/var/run/acpid.socket)
[   109.533] (II) LoadModule: "glx"
[   109.533] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[   109.534] (II) Module glx: vendor="X.Org Foundation"
[   109.534]    compiled for 1.21.1.1, module version = 1.0.0
[   109.534]    ABI class: X.Org Server Extension, version 10.0
[   109.534] (II) LoadModule: "modesetting"
[   109.534] (II) Loading /usr/lib/xorg/modules/drivers/modesetting_drv.so
[   109.534] (II) Module modesetting: vendor="X.Org Foundation"
[   109.534]    compiled for 1.21.1.1, module version = 1.21.1
[   109.534]    Module class: X.Org Video Driver
[   109.534]    ABI class: X.Org Video Driver, version 25.2
[   109.534] (II) modesetting: Driver for Modesetting Kernel Drivers: kms
[   109.534] (WW) Falling back to old probe method for modesetting
[   109.534] (II) modeset(0): using default device
[   109.534] (II) modeset(G0): using drv /dev/dri/card0
[   109.534] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
[   109.534] (EE) 
Fatal server error:
[   109.534] (EE) Cannot run in framebuffer mode. Please specify busIDs        for all framebuffer devices
[   109.534] (EE) 
[   109.534] (EE) 
Please consult the The X.Org Foundation support 
    at http://wiki.x.org
 for help. 
[   109.534] (EE) Please also check the log file at "/home/markus/.local/share/xorg/Xorg.0.log" for additional information.
[   109.534] (EE) 
[   109.547] (EE) Server terminated with error (1). Closing log file.

optimus-manager.service:

-- Boot bf83c61b54e548b19957935b2d84d5ee --
Nov 15 01:16:15 M16 systemd[1]: Starting Optimus Manager Commands Daemon...
Nov 15 01:16:15 M16 python3[5074]: [19] INFO: # Daemon pre-start hook
Nov 15 01:16:15 M16 python3[5074]: [19] INFO: Removing /etc/X11/xorg.conf.d/10-optimus-manager.conf (if present)
Nov 15 01:16:15 M16 python3[5074]: [20] INFO: Copying /etc/optimus-manager/optimus-manager.conf to /var/lib/optimus-manager/tmp/config_copy.conf
Nov 15 01:16:15 M16 python3[5074]: [23] INFO: Startup mode is: integrated
Nov 15 01:16:15 M16 python3[5074]: [23] INFO: Writing state {'type': 'pending_pre_xorg_start', 'requested_mode': 'integrated', 'current_mode': None}
Nov 15 01:16:15 M16 python3[5074]: [24] INFO: Daemon pre-start hook completed successfully.
Nov 15 01:16:15 M16 python3[5074]: [24] INFO: Calling Xorg pre-start hook.
Nov 15 01:16:15 M16 python3[5705]: [9] INFO: # Xorg pre-start hook
Nov 15 01:16:15 M16 python3[5705]: [10] INFO: Previous state was: {'type': 'pending_pre_xorg_start', 'requested_mode': 'integrated', 'current_mode': None}
Nov 15 01:16:15 M16 python3[5705]: [10] INFO: Requested mode is: integrated
Nov 15 01:16:16 M16 python3[5705]: [712] INFO: Available modules: ['nouveau', 'bbswitch', 'acpi_call', 'nvidia', 'nvidia_drm', 'nvidia_modeset', 'nvidia_uvm']
Nov 15 01:16:16 M16 python3[5705]: [712] INFO: Unloading modules ['nvidia_drm', 'nvidia_modeset', 'nvidia_uvm', 'nvidia'] (if loaded)
Nov 15 01:16:16 M16 python3[5705]: [715] INFO: Loading module bbswitch
Nov 15 01:16:16 M16 python3[5705]: [719] INFO: Setting GPU power to OFF via bbswitch
Nov 15 01:16:16 M16 python3[5705]: [735] WARNING: bbswitch is enabled, pci_power_control option ignored.
Nov 15 01:16:16 M16 python3[5705]: [1351] INFO: Writing to /etc/X11/xorg.conf.d/10-optimus-manager.conf
Nov 15 01:16:16 M16 python3[5705]: [1351] INFO: Writing state {'type': 'pending_post_xorg_start', 'switch_id': '20211115T011615', 'requested_mode': 'integrated'}
Nov 15 01:16:16 M16 python3[5705]: [1351] INFO: Xorg pre-start hook completed successfully.
Nov 15 01:16:16 M16 systemd[1]: Started Optimus Manager Commands Daemon.
Nov 15 01:16:16 M16 python3[6503]: [0] INFO: # Commands daemon
Nov 15 01:16:16 M16 python3[6503]: [1] INFO: Opening UNIX socket
Nov 15 01:16:16 M16 python3[6503]: [1] INFO: Awaiting commands
> optimus-manager --status
ERROR: a GPU setup was initiated but Xorg post-start hook did not run.
Log at /var/log/optimus-manager/switch/switch-20211115T011615.log
If your login manager is GDM, make sure to follow those instructions:
https://github.com/Askannz/optimus-manager#important--gnome-and-gdm-users
If your display manager is neither GDM, SDDM nor LightDM, or if you don't use one, read the wiki:
https://github.com/Askannz/optimus-manager/wiki/FAQ,-common-issues,-troubleshooting
Cannot execute command because of previous errors.

/var/log/optimus-manager/switch/switch-20211115T011615.log

[9] INFO: # Xorg pre-start hook
[10] INFO: Previous state was: {'type': 'pending_pre_xorg_start', 'requested_mode': 'integrated', 'current_mode': None}
[10] INFO: Requested mode is: integrated
[712] INFO: Available modules: ['nouveau', 'bbswitch', 'acpi_call', 'nvidia', 'nvidia_drm', 'nvidia_modeset', 'nvidia_uvm']
[712] INFO: Unloading modules ['nvidia_drm', 'nvidia_modeset', 'nvidia_uvm', 'nvidia'] (if loaded)
[715] INFO: Loading module bbswitch
[719] INFO: Setting GPU power to OFF via bbswitch
[735] WARNING: bbswitch is enabled, pci_power_control option ignored.
[1351] INFO: Writing to /etc/X11/xorg.conf.d/10-optimus-manager.conf
[1351] INFO: Writing state {'type': 'pending_post_xorg_start', 'switch_id': '20211115T011615', 'requested_mode': 'integrated'}
[1351] INFO: Xorg pre-start hook completed successfully.
[4] INFO: # Xorg post-start hook
[957] INFO: Running /etc/optimus-manager/xsetup-integrated.sh
[995] ERROR: Cannot set DPI (xrandr error):
None
[996] INFO: Writing state {'type': 'done', 'switch_id': '20211115T011615', 'current_mode': 'integrated'}
[996] INFO: Xorg post-start hook completed successfully.
> prime-offload
[4] INFO: # Xorg post-start hook
[957] INFO: Running /etc/optimus-manager/xsetup-integrated.sh
[995] ERROR: Cannot set DPI (xrandr error):
None
[996] INFO: Writing state {'type': 'done', 'switch_id': '20211115T011615', 'current_mode': 'integrated'}
[996] INFO: Xorg post-start hook completed successfully.

> optimus-manager --status
Optimus Manager (Client) version 1.4

Current GPU mode : integrated
GPU mode requested for next login : no change
GPU at startup : integrated
Temporary config path: no
inscapist commented 2 years ago

@markusressel did you manage to find a solution? I have the same hardware and I am facing this issue as well

markusressel commented 2 years ago

@sagittaros No :cry:

christopherbui commented 2 years ago

I too am having this problem. I was able to reproduce this problem both on Arch, EndeavourOS, Manjaro

Hardware: Dell XPS 9510, Integrated Intel & RTX 3050

Xorg log

[    13.656] (II) systemd-logind: took control of session /org/freedesktop/login1/session/_31
[    13.657] (II) xfree86: Adding drm device (/dev/dri/card0)
[    13.657] (II) Platform probe for /sys/devices/pci0000:00/0000:00:02.0/drm/card0
[    13.657] (II) systemd-logind: got fd for /dev/dri/card0 226:0 fd 11 paused 0
[    13.659] (--) PCI:*(0@0:2:0) 8086:9a60:1028:0a61 rev 1, Mem @ 0x6164000000/16777216, 0x4000000000/268435456, I/O @ 0x00004000/64, BIOS @ 0x????????/131072
[    13.659] (--) PCI: (1@0:0:0) 10de:25a2:1028:0a61 rev 161, Mem @ 0xa0000000/16777216, 0x6000000000/4294967296, 0x6100000000/33554432, I/O @ 0x00003000/128
[    13.659] (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
[    13.659] (II) LoadModule: "glx"
[    13.660] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[    13.664] (II) Module glx: vendor="X.Org Foundation"
[    13.664]    compiled for 1.21.1.3, module version = 1.0.0
[    13.664]    ABI class: X.Org Server Extension, version 10.0
[    13.664] (II) LoadModule: "modesetting"
[    13.664] (II) Loading /usr/lib/xorg/modules/drivers/modesetting_drv.so
[    13.667] (II) Module modesetting: vendor="X.Org Foundation"
[    13.667]    compiled for 1.21.1.3, module version = 1.21.1
[    13.667]    Module class: X.Org Video Driver
[    13.667]    ABI class: X.Org Video Driver, version 25.2
[    13.667] (II) modesetting: Driver for Modesetting Kernel Drivers: kms
[    13.667] (WW) Falling back to old probe method for modesetting
[    13.667] (II) modeset(0): using default device
[    13.667] (II) modeset(G0): using drv /dev/dri/card0
[    13.667] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
[    13.667] (EE)
Fatal server error:
[    13.667] (EE) Cannot run in framebuffer mode. Please specify busIDs        for all framebuffer devices
[    13.667] (EE)
[    13.667] (EE)
Please consult the The X.Org Foundation support
         at http://wiki.x.org
 for help.
[    13.667] (EE) Please also check the log file at "/home/alphard/.local/share/xorg/Xorg.0.log" for additional information.
[    13.667] (EE)
[    13.691] (EE) Server terminated with error (1). Closing log file.

Optimus Manager log

[8] INFO: # Xorg pre-start hook
[8] INFO: Previous state was: {'type': 'pending_pre_xorg_start', 'requested_mode': 'integrated', 'current_mode': None}
[8] INFO: Requested mode is: integrated
[174] INFO: Available modules: ['nouveau', 'nvidia', 'nvidia_drm', 'nvidia_modeset', 'nvidia_uvm']
[174] INFO: Unloading modules ['nvidia_drm', 'nvidia_modeset', 'nvidia_uvm', 'nvidia'] (if loaded)
[178] INFO: switching=none, nothing to do
[1126] INFO: Writing to /etc/X11/xorg.conf.d/10-optimus-manager.conf
[1126] INFO: Writing state {'type': 'pending_post_xorg_start', 'switch_id': '20220209T130719', 'requested_mode': 'integrated'}
[1126] INFO: Xorg pre-start hook completed successfully.

I have tried with gdm, sddm, and startx, following all necessary steps in the optimus-manager wiki.

rianneogi commented 2 years ago

I'm also having the exact same issue on a ASUS TUF laptop with RTX 3050 mobile GPU and Intel Tiger Lake graphics. Would be nice to know how to fix this.

aleksfadini commented 2 years ago

Having the same issue since last nvidia update, on new hp spectre 16 inch, with rtx3050 and tiger lake on arch.

Anybody found a solution?

chebro commented 2 years ago

chiming in to report the same issue on my new laptop with the following specs:

CPU: intel i7-11370H GPU: nvidia GeForce RTX 3050 Kernel: 5.18.3-arch1-1 Nvidia Driver Version: 515.48.07-9

chebro commented 2 years ago

@markusressel could you check if running startx after removing the autogenerated file at /etc/X11/xorg.conf.d/10-optimus-manager.conf solves the issue? it's working on my end.

update: that was an error on my end i hadn't enabled the optimus manager service. sorry for the false alarm.

lurker98 commented 2 years ago

I have the same issue. I managed to log in by switching to a different tty using alt+ctrl+F2, and then enabling gdm with sudo systemctl enable gdm.service -f. Then, I rebooted.

Gnome and GDM uses wayland by default and this issue is with X11. So this solution is more like a workaround. Since it is wayland, I still cannot get optimus-manager to work as it only works with X11.

If anyone has any solutions, then I'd finally be able to switch to Arch.

markusressel commented 2 years ago

@chebro No. I upgraded to the latest 5.18.6 kernel yesterday, tried to install optimus manager again, and no luck. Just a black screen.

Besides, what would be the point? Optimus manager is supposed to use its config to switch modes. Removing its config will just break it.

barisere commented 2 years ago

Same issue here. I've given up for now, I'll use WSL on Windows until this problem goes away. I couldn't setup Optimus to reduce power draw on my Dell XPS 9710 with the NVIDIA RTX 3050 GPU. I got only 5 hours of usage, compared to 7+ hours on Windows.

aleksfadini commented 2 years ago

Same issue also on a ZenBook Pro Duo UX582ZM, does not run on integrated, nor in any other setting. The only way to get i3 working, for me, is to keep optimus-manager running, but before starting x from terminal I have to manually delete

/etc/X11/xorg.conf.d/10-optimus-manager.conf

which looks exactly like the one posted at the beginning of this report. If I do not delete it, I get this:

[ 11.995] (EE) Fatal server error: [ 11.995] (EE) Cannot run in framebuffer mode. Please specify busIDs for all framebuffer devices

One last thing, if you are running kernel 5.18, try passing the kernel parameter ibt=off.

Due to FS#74886/FS#74891, nvidia does not boot on Linux 5.18 on systems with Intel CPUs. Until this is fixed, a workaround is disabling the Indirect Branch Tracking CPU security feature by setting the ibt=off kernel parameter from the bootloader. This security feature is responsible for mitigating a class of exploit techniques, but is deemed safe as a temporary stopgap solution. You can alternatively try nvidia-open and continue using IBT.

source: https://wiki.archlinux.org/title/NVIDIA#Installation

KilowattJunkie commented 1 year ago

I have a similar laptop (with a RTX 3080), and I was able to fix this by changing the BusIDs in /etc/X11/xorg.conf.d/10-optimus-manager.conf to

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

Section "Device"                        
        Identifier "nvidia"
        Driver "nvidia"
        BusID "PCI:1:0:0"     
EndSection

After restarting gdm I see it's the primary vendor

glxinfo  | grep vendor
server glx vendor string: NVIDIA Corporation
client glx vendor string: NVIDIA Corporation
OpenGL vendor string: NVIDIA Corporation

I don't think 4 numerical identifiers has ever been valid for the PCI bus in Xorg which is what lead me to try it; I haven't looked at the code, but it probably just needs to trim the identifier down (it would be interesting to see if other laptops work with 4, or if they're getting the expected 3 number identifier)

edit:

Ahh it looks like there is a check for this, but it's disabled in code https://github.com/Askannz/optimus-manager/blob/master/optimus_manager/pci.py#L31

es20490446e commented 6 months ago

Fixed at https://github.com/Askannz/optimus-manager/pull/551