Passing __NV_PRIME_RENDER_OFFLOAD=0 env variable in .desktop file

I'm using a laptop with NVIDIA GPU and running Pop!_OS 22.04 with Wayland.
My work uses Cisco AnyConnect VPN, when trying to log in it opens a SSO sign-in page with some kind of Chrome embedded browser (CEF) window.

Now, this combination of NVIDIA+Wayland+CEF doesn't play nice, and to allow it to run I must pass the __NV_PRIME_RENDER_OFFLOAD=0 env variable to force the CEF window to use the iGPU, otherwise it just doesn't work.

This works fine when running from terminal but I can't get it to work from the .desktop file. Things I tried:

  1. Changing the exec line to Exec=env __NV_PRIME_RENDER_OFFLOAD=0 /opt/cisco/anyconnect/vpnui
  2. Creating a bash script with export __NV_PRIME_RENDER_OFFLOAD=0 and setting the .desktop file to run that instead
  3. Overriding the global .desktop file with one in my ~/.local/share/applications

None of this works for me. I still see it trying to use the NVIDIA GPU to open the browser window (watching nvidia-smi), and it fails every time.

​

Can someone tell me what I'm doing wrong here? Or if there is any other way to make it work (beside running from terminal or switching back to X11)?

Posted Jun 10, 2023, 9:58 AM UTC

156
Loading comments…