Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimus-manager working well with SDDM #538

Open
EmmChriss opened this issue Mar 16, 2024 · 0 comments
Open

optimus-manager working well with SDDM #538

EmmChriss opened this issue Mar 16, 2024 · 0 comments

Comments

@EmmChriss
Copy link

TLDR

optimus-manager works flawlessly with SDDM on AMD/NVIDIA optimus laptop. This should maybe be included in the wiki.

Explanation

On Optimus laptops, it's important to be able to switch active video cards; in my case (AMD + NVIDIA), an external monitor will only work if the proprietary nvidia driver is loaded and in use. As such, I experimented a lot trying to start a graphical session in either battery friendly or NVIDIA mode. optimus-manager did the trick for me on X.

On the wiki, optimus-manager is regarded as public enemy number 1 with regard to multi-monitor setups, but with SDDM, I got it working flawlessy. The trick probably lies in an SDDM config file optimus-manager installs by default on Arch:

[X11]
DisplayCommand=/sbin/prime-offload
DisplayStopCommand=/sbin/prime-switch

My theory is due to there being an X11 config file, Xorg starts even if the selected session is a wayland compositor. Due to this, the optimus-manager hooks run without problems. In my hyprland.conf I have env = WLR_DRM_DEVICES,/dev/dri/card0:/dev/dri/card1, so if /dev/dri/card1 (NVIDIA) is available, Hyprland will use it for an external display; no render offloading is done though. Additionally, in my optimus-manager.conf I have:

[optimus]
switching=none
pci_power_control=yes
pci_remove=yes

What makes this work is temporarily removing the NVIDIA card from the pci bus when switching to integrated mode.

The limitations of this include that optimus-manager is not happy about switching to/being in nvidia mode. The only mode that works well with both internal and external monitor is hybrid.

Also, nvidia kernel modesetting is set up according to Arch wiki.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant