Running Steam games with an Nvidia GPU on ParrotOS 6.4
Introduction
This guide documents the steps that I took to install and run Steam games on my computer that has an integrated graphics card and a dedicated Nvidia graphics card.
Historically, the easiest ways to install Steam were to use the official .deb package from Steam’s website or use apt, but ParrotOS no longer supports 32-bit binaries which the traditional Steam installer requires. I installed and ran Steam using flatpak.
While the steps that I took worked for me, your mileage may vary and I recommend that you properly back up your data before making any changes to your system!
The ParrotOS discord server has some very knowledgeable people in there, and I recommend posting there if you have questions or run into a problem that you are stuck on.
Installing Nvidia drivers
Before installing Steam, I installed drivers for my graphics card. I’m not entirely sure if it was necessary for me to use Nvidia’s proprietary drivers instead of the open-source nouveau drivers, but I will explain why I did this later on.
Create a config file to block the open-source nouveau driver from running
1
sudo bash -c 'echo -e -n "blacklist nouveau\noptions nouveau modeset=0\nalias nouveau off" > /etc/modprobe.d/blacklist-nouveau.conf'
Check for apt repository updates and install the proprietary Nvidia drivers
1
sudo apt update && sudo apt install nvidia-driver
Reboot your machine
Display graphics card information and validate that the proprietary Nvidia drivers are in use
1
inxi -G
There should be a string that says “driver: nvidia” rather than “driver: nouveau”
Make note of the version number that is specified after “v: “ as this will be needed later
If you would like to display additional information about your GPU and that applications that are using it, install and run the Nvidia System Management Interface
1
2
sudo apt install nvidia-smi
watch nvidia-smi
Geting GPU environment variables & switching between GPUs for applications
switcheroo-control is a tool that can be used to list GPU-specific environment variables that can be set when running an application. It can also be used to execute a program using a specific GPU, however I was not able to get this working with flatpak and did not spend a lot of time troubleshooting this since using environment variables worked for me.
Install switcheroo-control
1
sudo apt install switcheroo-control
List available GPUs and make a note of the environment variables listed for the Nvidia GPU
1
switcherooctl --list
In my case, the environment variables were
1
__GLX_VENDOR_LIBRARY_NAME=nvidia __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only
Installing Steam
Install flatpak
1
sudo apt install flatpak
Install the flathub repository (this is where Steam and the Nvidia flatpak packages will be pulled from)
1
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
Install Steam
1
flatpak install flathub com.valvesoftware.Steam
The Steam flatpak installer should prompt to install the necessary flatpak packages, including the Nvidia flatpaks.
Confirm if the Nvidia flatpaks are installed
1
2
flatpak list --columns=application:f | grep org.freedesktop.Platform.GL.nvidia
flatpak list --columns=application:f | grep org.freedesktop.Platform.GL32.nvidia
Output returned for both commands would indicate that the Nvidia flatpaks are installed.
If no packages are returned in either of the above command outputs, this is where it comes in handy to know the Nvidia driver version that is installed on your system.
For example, if you have driver version 535.247.01 installed, then you would want to install these flatpak packages:
1
2
flatpak install flathub org.freedesktop.Platform.GL.nvidia-535-247-01
flatpak install flathub org.freedesktop.Platform.GL32.nvidia-535-247-01
The format of the Nvidia package naming is org.freedesktop.Platform.GL.nvidia- with the version appended, but the periods are replaced with hyphens
Running Steam
There are at least a couple different ways to run Steam; each are valid and it really comes down to a matter of preference on which one you use (I personally use method 2).
Method 1: Setting environment variables at program execution
This will temporarily set the GPU environment variables when running the flatpak Steam process:
1
__GLX_VENDOR_LIBRARY_NAME=nvidia __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only flatpak run com.valvesoftware.Steam
Note: The environment variables that you need to use may be different. Refer to the earlier switcherooctl --list command.
Method 2: Setting environment variables in flatpak for the Steam package
This will permanently configure the environment variables that need to be set when running Steam. Each environment variable is set using the --env parameter.
1
sudo flatpak override --env="__GLX_VENDOR_LIBRARY_NAME=nvidia" --env="__NV_PRIME_RENDER_OFFLOAD=1" --env="__VK_LAYER_NV_optimus=NVIDIA_only" com.valvesoftware.Steam
Note: The environment variables that you need to use may be different. Refer to the earlier switcherooctl --list command.
Verify that the environment variables have been set
1
flatpak override --show com.valvesoftware.Steam
Run Steam
1
flatpak run com.valvesoftware.Steam
To remove the environment variables
1
sudo flatpak override --reset com.valvesoftware.Steam
Creating desktop shorcuts
If you would like to create a desktop shortcut to run Steam, here are some examples. The important part is the Exec line which contains the command to run.
Method 1
If you used method 1 in the Running Steam section above, use this to create a desktop shortcut
1
2
3
4
5
6
7
8
9
10
cat > ~/Desktop/Steam.desktop << EOF
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Name[en_US]=Steam
Exec=env __GLX_VENDOR_LIBRARY_NAME=nvidia env __NV_PRIME_RENDER_OFFLOAD=1 env __VK_LAYER_NV_optimus=NVIDIA_only flatpak run com.valvesoftware.Steam
Name=Steam
EOF
Method 2
If you used method 2 in the Running Steam section above, use this to create a desktop shortcut
1
2
3
4
5
6
7
8
9
10
cat > ~/Desktop/Steam.desktop << EOF
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Name[en_US]=Steam
Exec=flatpak run com.valvesoftware.Steam
Name=Steam
EOF
Running Steam games
I did not experience any issues when attempting to download and install Steam games, however, when attempting to run them, I found that the Proton version used was crucial.
I had to use Proton version 9 or version 10 to run my games, otherwise they would error out at runtime.
To change the Proton version used for all Steam games:
- Click on the Steam menu in the top-left of your Steam window
- Choose Settings
- Go to the Compatibility tab
- Set the desired Proton version in the
Default compatibility listdrop-down menu
To change the Proton version used for a specific game:
- Go to your Steam library
- Right-click on the game and click on Properties in the menu that appears
- Go to the Compatibility tab
- Check the
Force the use of a specific Steam Play compatibility toolcheckbox - Set the desired Proton version in the drop-down menu
References
https://www.parrotsec.org/docs/configuration/nvidia-drivers/
ParrotOS Discord
https://docs.nvidia.com/datacenter/tesla/driver-installation-guide/optimus-laptops-and-multi-gpu-desktop-systems.html
https://docs.flatpak.org/en/latest/