[gnome-shell/wip/hadess/always-launch-discrete-gpu] shell-app: Add discrete GPU support for NVidia drivers
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/hadess/always-launch-discrete-gpu] shell-app: Add discrete GPU support for NVidia drivers
- Date: Thu, 24 Oct 2019 12:49:41 +0000 (UTC)
commit 752b1df6596fde6ce9b30fbea5af80f454216da1
Author: Bastien Nocera <hadess hadess net>
Date: Thu Oct 24 14:39:25 2019 +0200
shell-app: Add discrete GPU support for NVidia drivers
Add the necessary environment variables that would make offloading to
the NVidia "secondary" drivers work as expected.
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/1810
src/shell-app.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/shell-app.c b/src/shell-app.c
index b9ceac34b0..663873cde0 100644
--- a/src/shell-app.c
+++ b/src/shell-app.c
@@ -1309,7 +1309,11 @@ shell_app_launch (ShellApp *app,
context = shell_global_create_app_launch_context (global, timestamp, workspace);
/* FIXME: this should probably check whether we're on a dual-GPU system */
if (get_with_discrete_gpu (app, discrete_gpu))
- g_app_launch_context_setenv (context, "DRI_PRIME", "1");
+ {
+ g_app_launch_context_setenv (context, "DRI_PRIME", "1");
+ g_app_launch_context_setenv (context, "__NV_PRIME_RENDER_OFFLOAD", "1");
+ g_app_launch_context_setenv (context, "__GLX_VENDOR_LIBRARY_NAME", "nvidia");
+ }
/* Set LEAVE_DESCRIPTORS_OPEN in order to use an optimized gspawn
* codepath. The shell's open file descriptors should be marked CLOEXEC
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]