Linux: prefer discrete GPU on dual-GPU systems via PRIME environment variables#12602
Merged
Linux: prefer discrete GPU on dual-GPU systems via PRIME environment variables#12602
Conversation
…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.
* Fix double title bar on Linux by removing WM decorations for GTK * wip * fix * finish * address review comment
Contributor
There was a problem hiding this comment.
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=1on 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 foraccess()usage.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
3 tasks
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
Contributor
|
@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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Improve performance on Linux OS when it has both intergrate and discrete GPUs
Screenshots/Recordings/Graphs
Tests