summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2019-10-24 14:39:25 +0200
committerBastien Nocera <hadess@hadess.net>2019-10-24 14:49:22 +0200
commit752b1df6596fde6ce9b30fbea5af80f454216da1 (patch)
tree405ba92f17351680a22e7057e3c4791d8902c368
parent366b06716d59e45158b4ecf9c2f7d987fcbda7e1 (diff)
downloadgnome-shell-wip/hadess/always-launch-discrete-gpu.tar.gz
shell-app: Add discrete GPU support for NVidia driverswip/hadess/always-launch-discrete-gpu
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
-rw-r--r--src/shell-app.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/shell-app.c b/src/shell-app.c
index b9ceac34b..663873cde 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