I am having a problem with launching chromium based apps on my second device without nvidia gpu. It takes very long to launch.
I found out that running for example VSCode like this fixes the issue:
$ VK_DRIVER_FILES= code
My idea was to create a script, that would check on each login whether a intel gpu is present (or maybe better if nvidia gpu is not present). The script works like this:
#!/bin/bash
string=$(glxinfo | grep 'Vendor')
if [[ "$string" =~ .+Intel.+ ]]; then
echo "True"
export VK_DRIVER_FILES=
else
echo "False"
fi
Unfortunatelly when I source this script, the variable only exists in the current terminal session and not system wide. Apparently it doesn’t work when putting it to Session and Startup/Application Autostart in XFCE too.
How can I achieve this?
It works, when I make my own “launch script” for each app on chromium which checks the gpu and then launches the app with the VK_DRIVER_FILES= or without, but that seems not very elegnat to me.
#!/bin/sh
# Make sure this is before the 'exec' command or it won't be sourced.
[ -f /etc/xprofile ] && . /etc/xprofile
[ -f ~/.xprofile ] && . ~/.xprofile
STEP2:
Paste this code inside the /.xprofile :
string=$(inxi -G | grep 'NVIDIA')
if [[ "$string" =~ .+NVIDIA.+ ]]; then
echo "True"
else
echo "False"
export VK_DRIVER_FILES=
fi
It checks if a Nvidia GPU is present in your device and sets the VK_DRIVER_FILES= environment variable accordingly.
This solves the issue with slow launch of chromium based apps, when running Endeavour OS on a device without Nvidia GPU.