mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-11-27 15:49:52 -05:00
Make the Discrete GPU a Linux Preference Instead of a Desktop-Entry Hint (#16875)
* Make the Discrete GPU a Linux Preference Instead of a Desktop-Entry Hint The desktop entries asked the launcher for the discrete GPU with PrefersNonDefaultGPU and X-KDE-RunOnDiscreteGpu. KDE and GNOME honour that by adding the PRIME variables to every menu launch, so on a hybrid laptop under Wayland the 3D view was rendered by zink on the GPU that does not drive the display and its frames never reached the compositor: an empty Prepare and Preview canvas from the menu, a working one from a terminal. Drop the two keys from the installed desktop file, the AppImage's embedded entry and the entries the Desktop Integration dialog writes. Add a "Render on the discrete GPU" preference (Linux, default off, requires restart) that exports DRI_PRIME and, with the NVIDIA kernel module loaded, the NVIDIA render-offload variables before GTK opens the display. The GDK_BACKEND=x11 opt-in path exported them unconditionally; it now leaves GPU selection to the preference as well. The preference acts before GUI_App loads the configuration, so AppConfig::peek_bool reads one app boolean straight from the saved file and xdg_config_dir resolves the default Linux data dir the way the wx code did; GUI_App's two copies of that lookup use the same helper, and AppConfig::config_path gained a static form so the file name lives in one place. * Share the Linux Data-Dir Lookup and Let DRI_PRIME Override the GPU Preference default_data_dir() in libslic3r resolves the Linux data dir a start without --datadir uses: a portable data_dir folder next to the executable, else the XDG config dir. GUI_App::init_app_config and the discrete-GPU start-up code both call it, so they cannot drift apart. A DRI_PRIME already in the environment now skips the export entirely, so one start with DRI_PRIME=0 gets back to Preferences when the discrete GPU cannot open the window. The tooltip says so. * Attach the DRI_PRIME Translator Note to the Tooltip It Describes
This commit is contained in:
1 parent
acb4cce4ae
commit
12ce9d6fe6
14 files changed
+240
-59
No files matched your search
@@ -355,8 +355,6 @@ void DesktopIntegrationDialog::perform_desktop_integration()
|
||||
"Exec=\"%3%\" %%F\n"
|
||||
"Terminal=false\n"
|
||||
"Type=Application\n"
|
||||
"PrefersNonDefaultGPU=true\n"
|
||||
"X-KDE-RunOnDiscreteGpu=true\n"
|
||||
"MimeType=model/stl;application/vnd.ms-3mfdocument;application/prs.wavefront-obj;application/x-amf;\n"
|
||||
"Categories=Graphics;3DGraphics;Engineering;\n"
|
||||
"Keywords=3D;Printing;Slicer;slice;3D;printer;convert;gcode;stl;obj;amf;SLA\n"
|
||||
@@ -426,8 +424,6 @@ void DesktopIntegrationDialog::perform_desktop_integration()
|
||||
"Exec=\"%3%\" --gcodeviewer %%F\n"
|
||||
"Terminal=false\n"
|
||||
"Type=Application\n"
|
||||
"PrefersNonDefaultGPU=true\n"
|
||||
"X-KDE-RunOnDiscreteGpu=true\n"
|
||||
"MimeType=text/x.gcode;\n"
|
||||
"Categories=Graphics;3DGraphics;\n"
|
||||
"Keywords=3D;Printing;Slicer;\n"
|
||||
|
||||
Reference in new issue
Block a user