Skip to content

Linux: prefer discrete GPU on dual-GPU systems via PRIME environment variables#12602

Merged
SoftFever merged 2 commits intomainfrom
feature/select-discrete-gpu-on-linux
Mar 4, 2026
Merged

Linux: prefer discrete GPU on dual-GPU systems via PRIME environment variables#12602
SoftFever merged 2 commits intomainfrom
feature/select-discrete-gpu-on-linux

Conversation

@SoftFever
Copy link
Copy Markdown
Collaborator

Description

Improve performance on Linux OS when it has both intergrate and discrete GPUs

Screenshots/Recordings/Graphs

Tests

…variables

  Set DRI_PRIME=1 for AMD/nouveau PRIME setups and __NV_PRIME_RENDER_OFFLOAD/__GLX_VENDOR_LIBRARY_NAME for NVIDIA proprietary driver, only when the NVIDIA kernel module is detected. Uses replace=false to respect user overrides.
Copilot AI review requested due to automatic review settings March 4, 2026 14:29
* Fix double title bar on Linux by removing WM decorations for GTK

* wip

* fix

* finish

* address review comment
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts Linux (wxGTK) startup environment to prefer a discrete GPU on systems with PRIME/offload support, aiming to improve rendering performance.

Changes:

  • Adds DRI_PRIME=1 on wxGTK to request the non-default GPU for Mesa PRIME setups.
  • Detects NVIDIA kernel module presence and sets NVIDIA PRIME Render Offload env vars.
  • Adds <unistd.h> include for access() usage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/OrcaSlicer.cpp
@SoftFever SoftFever merged commit 008cfd1 into main Mar 4, 2026
14 checks passed
@SoftFever SoftFever deleted the feature/select-discrete-gpu-on-linux branch March 4, 2026 14:48
Xipit pushed a commit to Xipit/OrcaSlicer that referenced this pull request Mar 16, 2026
…variables (OrcaSlicer#12602)

* Linux: prefer discrete GPU on dual-GPU systems via PRIME environment variables

  Set DRI_PRIME=1 for AMD/nouveau PRIME setups and __NV_PRIME_RENDER_OFFLOAD/__GLX_VENDOR_LIBRARY_NAME for NVIDIA proprietary driver, only when the NVIDIA kernel module is detected. Uses replace=false to respect user overrides.

* Improves usability on Linux. No more double title bar (OrcaSlicer#12600)

* Fix double title bar on Linux by removing WM decorations for GTK

* wip

* fix

* finish

* address review comment
davidjdixon pushed a commit to davidjdixon/OrcaSlicer that referenced this pull request Mar 21, 2026
…variables (OrcaSlicer#12602)

* Linux: prefer discrete GPU on dual-GPU systems via PRIME environment variables

  Set DRI_PRIME=1 for AMD/nouveau PRIME setups and __NV_PRIME_RENDER_OFFLOAD/__GLX_VENDOR_LIBRARY_NAME for NVIDIA proprietary driver, only when the NVIDIA kernel module is detected. Uses replace=false to respect user overrides.

* Improves usability on Linux. No more double title bar (OrcaSlicer#12600)

* Fix double title bar on Linux by removing WM decorations for GTK

* wip

* fix

* finish

* address review comment
@anarsoul
Copy link
Copy Markdown
Contributor

anarsoul commented Apr 2, 2026

@SoftFever it looks like this PR causes terrible lags for me on Nouveau (or rather NVK) with GTX 1650.

FWIW I've never experienced any lags on my 5yo laptop with Gen9 Intel GPU.

I use DRI_PRIME=0 as a workaround for now to run it on integrated graphics

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

Successfully merging this pull request may close these issues.

3 participants