Hybrid Graphics Problem (Intel/Nvidia) (config Problem?)

Hi,

i try to get my Hybrid Graphics working.

First some System Infos
And at the end the Error (see # Optimus Manager)

Switching mode should be Hybrid.
Login Manager is SDDM

To me it looks like installation is fine.
The Error Message of Optimus Manager i can not understand
Unfortunately, the links in the error message don’t help me either

I would guess there is some config i have to edit/change?

Let me know if you need more Information

System Info

Compositor

echo XDG_SESSION_TYPE

  • wayland

Graphics

lspci -vnn | grep '\''[030[02]\]'

  • 00:02.0 VGA compatible controller [0300]: Intel Corporation CoffeeLake-H GT2 [UHD Graphics 630] [8086:3e9b] (prog-if 00 [VGA controller])
  • 01:00.0 VGA compatible controller [0300]: NVIDIA Corporation TU106M [GeForce RTX 2070 Mobile] [10de:1f10] (rev a1) (prog-if 00 [VGA controller])

Installation

Optimus-manager Service

  • systemctl status optimus-manager.service
● optimus-manager.service - Optimus Manager Commands Daemon

Loaded: loaded (/usr/lib/systemd/system/optimus-manager.service; enabled; preset: disabled)
Active: active (running) since Mon 2024-09-16 10:54:58 CEST; 5min ago
Invocation: 147fc7e4ad474ee9a7439925e826c34c
Process: 881 ExecStartPre=/usr/bin/python3 -u -m optimus_manager.hooks.pre_daemon_start (code=exited, status=0/SUCCESS)
Process: 955 ExecStartPre=/usr/bin/python3 -u -m optimus_manager.hooks.pre_xorg_start (code=exited, status=0/SUCCESS)
Main PID: 969 (python3)
Tasks: 1 (limit: 38168)
Memory: 18.7M (peak: 21.6M)
CPU: 276ms
CGroup: /system.slice/optimus-manager.service
└─969 /usr/bin/python3 -u -m optimus_manager.daemon

Sep 16 10:54:58 HN-LNNBDD-01 python3[955]: [39] INFO: Available modules: ['nouveau', 'nvidia', 'nvidia_drm', 'nvidia_modeset', 'nvidia_uvm']
Sep 16 10:54:58 HN-LNNBDD-01 python3[955]: [39] INFO: Unloading modules ['nvidia_drm', 'nvidia_modeset', 'nvidia_uvm', 'nvidia'] (if loaded)
Sep 16 10:54:58 HN-LNNBDD-01 python3[955]: [43] INFO: switching=none, nothing to do
Sep 16 10:54:58 HN-LNNBDD-01 python3[955]: [69] INFO: Writing to /etc/X11/xorg.conf.d/10-optimus-manager.conf
Sep 16 10:54:58 HN-LNNBDD-01 python3[955]: [69] INFO: Writing state {'type': 'pending_post_xorg_start', 'switch_id': '20240916T105458', 'requested_mode': 'integrated'}
Sep 16 10:54:58 HN-LNNBDD-01 python3[955]: [69] INFO: Xorg pre-start hook completed successfully.
Sep 16 10:54:58 HN-LNNBDD-01 systemd[1]: Started Optimus Manager Commands Daemon.
Sep 16 10:54:58 HN-LNNBDD-01 python3[969]: [1] INFO: # Commands daemon
Sep 16 10:54:58 HN-LNNBDD-01 python3[969]: [1] INFO: Opening UNIX socket
Sep 16 10:54:58 HN-LNNBDD-01 python3[969]: [1] INFO: Awaiting commands

journalctl

SDDM

journalctl -u sddm

Aug 23 18:46:54 HN-LNNBDD-01 systemd[1]: Started Simple Desktop Display Manager.
Aug 23 18:46:54 HN-LNNBDD-01 sddm[825]: Initializing...
Aug 23 18:46:54 HN-LNNBDD-01 sddm[825]: Starting...
Aug 23 18:46:54 HN-LNNBDD-01 sddm[825]: Logind interface found
Aug 23 18:46:54 HN-LNNBDD-01 sddm[825]: Adding new display...
Aug 23 18:46:54 HN-LNNBDD-01 sddm[825]: Loaded empty theme configuration
Aug 23 18:46:54 HN-LNNBDD-01 sddm[825]: Xauthority path: "/run/sddm/xauth_xiQNcU"
Aug 23 18:46:54 HN-LNNBDD-01 sddm[825]: Using VT 2
Aug 23 18:46:54 HN-LNNBDD-01 sddm[825]: Display server starting...
Aug 23 18:46:54 HN-LNNBDD-01 sddm[825]: Writing cookie to "/run/sddm/xauth_xiQNcU"
Aug 23 18:46:54 HN-LNNBDD-01 sddm[825]: Running: /usr/bin/X -nolisten tcp -background none -seat seat0 vt2 -aut>
Aug 23 18:46:57 HN-LNNBDD-01 sddm[825]: Setting default cursor
Aug 23 18:46:57 HN-LNNBDD-01 sddm[825]: Running display setup script "/usr/share/sddm/scripts/Xsetup"
Aug 23 18:46:57 HN-LNNBDD-01 sddm[825]: Display server started.
Aug 23 18:46:57 HN-LNNBDD-01 sddm[825]: Socket server starting...
Aug 23 18:46:57 HN-LNNBDD-01 sddm[825]: Socket server started.
Aug 23 18:46:57 HN-LNNBDD-01 sddm[825]: Loading theme configuration from "/usr/share/sddm/themes/breeze/theme.c>
Aug 23 18:46:57 HN-LNNBDD-01 sddm[825]: Greeter starting...
Aug 23 18:46:57 HN-LNNBDD-01 sddm-helper[847]: [PAM] Starting...
Aug 23 18:46:57 HN-LNNBDD-01 sddm-helper[847]: [PAM] Authenticating...
Aug 23 18:46:57 HN-LNNBDD-01 sddm-helper[847]: [PAM] returning.
Aug 23 18:46:57 HN-LNNBDD-01 sddm-helper[847]: pam_unix(sddm-greeter:session): session opened for user sddm(uid>
Aug 23 18:46:57 HN-LNNBDD-01 sddm-helper[847]: pam_systemd(sddm-greeter:session): New sd-bus connection (system>
Aug 23 18:46:57 HN-LNNBDD-01 sddm-helper[847]: Writing cookie to "/tmp/xauth_HrvMjV"
Aug 23 18:46:57 HN-LNNBDD-01 sddm-helper[847]: Starting X11 session: "" "/usr/bin/sddm-greeter-qt6 --socket /tm>
Aug 23 18:46:57 HN-LNNBDD-01 sddm[825]: Greeter session started successfully
Aug 23 18:46:57 HN-LNNBDD-01 sddm[825]: Message received from greeter: Connect
Aug 23 18:47:05 HN-LNNBDD-01 sddm[825]: Message received from greeter: Login
Aug 23 18:47:05 HN-LNNBDD-01 sddm[825]: Reading from "/usr/share/wayland-sessions/plasma.desktop"
Aug 23 18:47:05 HN-LNNBDD-01 sddm[825]: Session "/usr/share/wayland-sessions/plasma.desktop" selected, command:>
Aug 23 18:47:05 HN-LNNBDD-01 sddm-helper[888]: [PAM] Starting...

Optimus Manager

journalctl -u optimus-manager -b0

Sep 16 10:54:58 HN-LNNBDD-01 systemd[1]: Starting Optimus Manager Commands Daemon...
Sep 16 10:54:58 HN-LNNBDD-01 python3[881]: [50] INFO: # Daemon pre-start hook
Sep 16 10:54:58 HN-LNNBDD-01 python3[881]: [50] INFO: Removing /etc/X11/xorg.conf.d/10-optimus-manager.conf (if present)
Sep 16 10:54:58 HN-LNNBDD-01 python3[881]: [51] INFO: Copying /etc/optimus-manager/optimus-manager.conf to /var/lib/optimus-manager/tmp/config_copy.conf
Sep 16 10:54:58 HN-LNNBDD-01 python3[881]: [53] INFO: Startup mode is: integrated
Sep 16 10:54:58 HN-LNNBDD-01 python3[881]: [53] INFO: Writing state {'type': 'pending_pre_xorg_start', 'requested_mode': 'integrated', 'current_mode': None}
Sep 16 10:54:58 HN-LNNBDD-01 python3[881]: [53] INFO: Daemon pre-start hook completed successfully.
Sep 16 10:54:58 HN-LNNBDD-01 python3[881]: [53] INFO: Calling Xorg pre-start hook.
Sep 16 10:54:58 HN-LNNBDD-01 python3[955]: [11] INFO: # Xorg pre-start hook
Sep 16 10:54:58 HN-LNNBDD-01 python3[955]: [11] INFO: Previous state was: {'type': 'pending_pre_xorg_start', 'requested_mode': 'integrated', 'current_mode': None}
Sep 16 10:54:58 HN-LNNBDD-01 python3[955]: [11] INFO: Requested mode is: integrated
Sep 16 10:54:58 HN-LNNBDD-01 python3[958]: modinfo: ERROR: Module bbswitch not found.
Sep 16 10:54:58 HN-LNNBDD-01 python3[959]: modinfo: ERROR: Module acpi_call not found.
Sep 16 10:54:58 HN-LNNBDD-01 python3[955]: [39] INFO: Available modules: ['nouveau', 'nvidia', 'nvidia_drm', 'nvidia_modeset', 'nvidia_uvm']
Sep 16 10:54:58 HN-LNNBDD-01 python3[955]: [39] INFO: Unloading modules ['nvidia_drm', 'nvidia_modeset', 'nvidia_uvm', 'nvidia'] (if loaded)
Sep 16 10:54:58 HN-LNNBDD-01 python3[955]: [43] INFO: switching=none, nothing to do
Sep 16 10:54:58 HN-LNNBDD-01 python3[955]: [69] INFO: Writing to /etc/X11/xorg.conf.d/10-optimus-manager.conf
Sep 16 10:54:58 HN-LNNBDD-01 python3[955]: [69] INFO: Writing state {'type': 'pending_post_xorg_start', 'switch_id': '20240916T105458', 'requested_mode': 'integrated'}
Sep 16 10:54:58 HN-LNNBDD-01 python3[955]: [69] INFO: Xorg pre-start hook completed successfully.
Sep 16 10:54:58 HN-LNNBDD-01 systemd[1]: Started Optimus Manager Commands Daemon.
Sep 16 10:54:58 HN-LNNBDD-01 python3[969]: [1] INFO: # Commands daemon
Sep 16 10:54:58 HN-LNNBDD-01 python3[969]: [1] INFO: Opening UNIX socket
Sep 16 10:54:58 HN-LNNBDD-01 python3[969]: [1] INFO: Awaiting commands

Optimus Manager

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-20240916T105458.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.

Switch Log

cat /var/log/optimus-manager/switch/switch-20240916T105458.log

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

Version of Optimus Manager

Optimus Manager (Client) version 1.5

Optimus Manager Config

cat /usr/share/optimus-manager.conf

[optimus]

# This parameter defines the method used to power switch the Nvidia card. See the documentation
# for a complete description of what each value does. Possible values :
#
# - nouveau : load the nouveau module on the Nvidia card.
# - bbswitch : power off the card using the bbswitch module (requires the bbswitch dependency).
# - acpi_call : try various ACPI method calls to power the card on and off (requires the acpi_call dependency)
# - custom: use custom scripts at /etc/optimus-manager/nvidia-enable.sh and /etc/optimus-manager/nvidia-disable.sh
# - none : do not use an external module for power management. For some laptop models it's preferable to
# use this option in combination with pci_power_control (see below).
switching=none
# Enable PCI power management in "integrated" mode.
# This option is incompatible with acpi_call and bbswitch, so it will be ignored in those cases.
pci_power_control=no
# Remove the Nvidia card from the PCI bus.
# May prevent crashes caused by power switching.
# Ignored if switching=nouveau or switching=bbswitch.
pci_remove=no
# Reset the Nvidia card at the PCI level before reloading the nvidia module.
# Ensures the card is in a fresh state before reloading the nvidia module.
# May fix some switching issues. Possible values :
#
# - no : does not perform any reset
# - function_level : perform a light "function-level" reset
# - hot_reset : perform a "hot reset" of the PCI bridge. ATTENTION : this method messes with the hardware
# directly, please read the online documentation of optimus-manager before using it.
# Also, it will perform a PCI remove even if pci_remove=no.
#
pci_reset=no
# Automatically log out the current desktop session when switching GPUs.
# This feature is currently supported for the following DE/WM :
# GNOME, KDE Plasma, LXDE, Deepin, Xfce, i3, Openbox, AwesomeWM, bspwm, dwm, Xmonad, herbstluftwm
# If this option is disabled or you use a different desktop environment,
# GPU switching only becomes effective at the next graphical session login.
auto_logout=yes
# GPU mode to use at computer startup.
# Possible values: nvidia, integrated, hybrid, auto, auto_nvdisplay, intel (deprecated, equivalent to integrated)
# "auto" is a special mode that auto-detects if the computer is running on battery
# and selects a proper GPU mode.
# "auto_nvdisplay" sets the GPU mode based on whether a display is connected directly to the nvidia GPU,
# which can be useful if any display output works only in a specific mode.
# See the other options below.
startup_mode=integrated
# GPU mode to select when startup_mode=auto and the computer is running on battery.
# Possible values: nvidia, integrated, hybrid, intel (deprecated, equivalent to integrated)
startup_auto_battery_mode=integrated
# GPU mode to select when startup_mode=auto and the computer is running on external power.
# Possible values: nvidia, integrated, hybrid, intel (deprecated, equivalent to integrated)
startup_auto_extpower_mode=nvidia
# GPU mode to select when startup_mode=auto_nvdisplay and no display is connected directly to the nvidia GPU.
# Possible values: nvidia, integrated, hybrid
startup_auto_nvdisplay_off_mode=integrated
# GPU mode to select when startup_mode=auto_nvdisplay and a display is connected directly to the nvidia GPU.
# Possible values: nvidia, integrated, hybrid
startup_auto_nvdisplay_on_mode=nvidia

[intel]
# Driver to use for the Intel GPU. Possible values : modesetting, intel, hybrid
# To use the intel driver, you need to install the package "xf86-video-intel".
# If you want to use the intel driver only in integrated mode and modesetting for
# nvidia mode, use "hybrid" driver.
driver=modesetting
# Acceleration method (corresponds to AccelMethod in the Xorg configuration).
# Only applies to the intel driver.
# Possible values : sna, xna, uxa, none
# Leave blank for the default (no option specified)
accel=
# Enable TearFree option in the Xorg configuration.
# Only applies to the intel driver.
# Possible values : yes, no
# Leave blank for the default (no option specified)
tearfree=
# DRI version. Possible values : 2, 3, 0
# To omit the option, specify 0
DRI=3
# Whether or not to enable modesetting for the nouveau driver.
# Does not affect modesetting for the Intel GPU driver !
# This option only matters if you use nouveau as the switching backend.
modeset=yes

[amd]
# Driver to use for the AMD GPU. Possible values : modesetting, amdgpu, hybrid
# To use the amdgpu driver, you need to install the package "xf86-video-amdgpu".
# If you want to use the amdgpu driver only in integrated mode and modesetting for
# nvidia mode, use "hybrid" driver.
driver=modesetting
# Enable TearFree option in the Xorg configuration.
# Only applies to the amdgpu driver.
# Possible values : yes, no
# Leave blank for the default (no option specified)
tearfree=
# DRI version. Possible values : 2, 3, 0
# To omit the option, specify 0
DRI=3

[nvidia]

# Whether or not to enable modesetting. Required for PRIME Synchronization (which prevents tearing).
modeset=yes
# Whether or not to enable the NVreg_UsePageAttributeTable option in the Nvidia driver.
# Recommended, can cause poor CPU performance otherwise.
PAT=yes
# DPI value. This will be set using the Xsetup script passed to your login manager.
# It will run the command
# xrandr --dpi <DPI>
# Leave blank for the default (the above command will not be run).
DPI=96
# If you're running an updated version of xorg-server (let's say to get PRIME Render offload enabled),
# the nvidia driver may not load because of an ABI version mismatch. Setting this flag to "yes"
# will allow the loading of the nvidia driver.
ignore_abi=no
# Set to yes if you want to use optimus-manager with external Nvidia GPUs (experimental)
allow_external_gpus=no
# Comma-separated list of Nvidia-specific options to apply.
# Available options :
# - overclocking : enable CoolBits in the Xorg configuration, which unlocks clocking options
# in the Nvidia control panel. Note: does not work in hybrid mode.
# - triple_buffer : enable triple buffering.
options=overclocking
# Enable Runtime D3 (RTD3) Power Management in the Nvidia driver. While in hybrid mode,
# this feature allows the Nvidia card to go into a low-power mode if it's not in use.
#
# IMPORTANT NOTES:
# - The feature is still experimental
# - It's only supported on laptops with a Turing GPU or above, and an Intel Coffee Lake CPU
# or above (not sure about the state of support for AMD CPUs).
# - if your Nvidia card also has an audio chip (for HDMI) or a USB port wired to it, they may not
# function properly while in low-power mode
#
# For more details, see
# https://download.nvidia.com/XFree86/Linux-x86_64/460.39/README/dynamicpowermanagement.html
#
# Available options:
# - no (the default): RTD3 power management is disabled.
# - coarse: the card only goes to low-power if no application is using it.
# - fine: the card is also allowed to go to low-power if applications are using it but have not
# actively submitted GPU work in some amount of time.
dynamic_power_management=no
# The Nvidia driver handles power to the video memory separately from the rest of GPU.
# When dynamic_power_management=fine, this options controls the threshold of memory utilization
# (in Megabytes) under which the memory is put in a low-power state.
# Values over 200MB are ignored. Leave blank for the default (200MB).
# Setting this value to 0 keeps the memory powered at all times.
dynamic_power_management_memory_threshold=

Kind Regards,
JCA

Optimus Manager only works on Xorg and it isn’t the official method from Nvidia to manage two GPUs at the same time on Linux.

If you want a similar experience to Optimus Manager, use EnvyControl. Otherwise, I personally recommend going with the official Nvidia method named PRIME. Here’s a link to the Arch Wiki article talking about it.

Thx for the hint. @winnyace

i removed the Optimus stuff and checked the wiki.
The Information regarding Wayland is very little, but it looks like the config is correct on my System.

I used the “nvidia-inst” Script from EndeavourOS and it looks like it was working right out of the Box. Never ever had this before, so i tried to fix things that where not broken

When starting a game i can see, that game is using the Nvidia card.

Is there a command to check, what is running on which card?

Kind Regards,
JCA

Besides using something like MangoHUD, I don’t think there’s an universal way to check what GPU is being used.

Thank you @winnyace

1 Like