Display FPS, CPU/GPU Usage While Gaming in Ubuntu 24.04 | 22.04

Last updated: November 12, 2024 — Leave a comment

Want to see frames per second (FPS), as well as CPU, GPU, RAM usage in your game screen? Here’s how to do the job in Debian, Ubuntu, and Linux Mint based systems.

Most Linux distributions include a free open-source mangohud package in their system repositories. Which, allows to add a Vulkan and OpenGL overlay for monitoring FPS, temperatures, CPU/GPU load and more while gaming.

And, here’s how to install and configure mangohud for gaming in Debian/Ubuntu based systems.

NOTE: This tutorial is tested with only a few games. It’s NOT guaranteed that your games will work with it.

Step 1: Install MangoHud

As mentioned, the software package is available in most Linux distributions’ system repository.

For Debian, Ubuntu, and Linux Mint, press Ctrl+Alt+T to open up a terminal window, then run command to install it:

sudo apt install mangohud

If your games were installed as Flatpak package (e.g., Steam), then, also run the command to install the Flatpak run-time:

flatpak install flathub org.freedesktop.Platform.VulkanLayer.MangoHud

If flatpak command not found, then you don’t have any app installed as Flatpak package.

Step 2: Start your game with MangoHud overlay

After installed the software package, you can now try to start the game with mangohud overlay from terminal, to see if it works.

For native (.deb) game package

If your game was installed as native (.deb) game, supertuxkart for example, then try the command below to start the game with mangohud overlay:

mangohud --dlsym supertuxkart

Native game executable files are usually installed to /usr/games directory. You may run ls /usr/games to list them, in case you don’t know the executable name of your game.

If the game is available in other locations, just run mangohud /path/to/game instead, also add --dlsym flag if the overlay does not work.

If the game starts successfully with the overlay, then you may do the steps below to make it work when launching from start menu (or GNOME overview/app grid).

1. The config files for the app shortcuts in start menu are usually handled by .desktop files, under /usr/share/applications directory.

You may run the command below to list .desktop file under that directory, and optionally add |grep -i "keyword_here" to find out the one for your game.

ls /usr/share/applications/ |grep -i "supertux"

2. Next, either edit that file directly, or copy to local directory (.local/share/applications) then edit.

sudo gnome-text-editor /usr/share/applications/supertuxkart.desktop

Here replace supertuxkart.desktop with yours. For 22.04, replace gnome-text-editor with gedit or other text editor depends on your desktop environment, or use nano that works in all desktops.

3. When file opens, just replace the value of “Exec” with the command that you successfully started it with mangohud overlay. Finally, save file (for nano text editor, press Ctrl+S to save, then Ctrl+X to exit).

For Steam Games

NOTE: This step is only tested with Steam flatpak package.

For steam game, first navigate to the library in Steam app, then choose the game in left. Next, click the settings gear icon and go to “Properties”. Finally, add below under LAUNCH OPTIONS in General tab.

mangohud %command%

For Lutris

I don’t have any game installed/managed by Lutris, but if you have, then go to the app “Preferences -> Global options”. Finally, enable Advanced toggle switch and add mangohud into the command prefix input box.

For Flatpak and Snap Game packages

Except Steam, Flatpak and Snap game packages do NOT work properly in my case with the FPS overlay.

However, some non-game Flatpak apps start with the overlay!!!

non-game app starts with mangohud overlay

If you want to keep Steam (flatpak package) working with the overlay, then install Flatseal package from flathub.org, and use the tool to disable GPU acceleration for other apps that wrongly start with the overlay.

Step 3: Configure the MangoHud appearance

The in-game overlay by default shows CPU and GPU utilization ratio, FPS, and frame time with dark semi-transparent background in top-left.

To change the layout, you may create a config file either under either .config/MangoHud/ or game’s own directory. There’s an example config file under /usr/share/doc/mangohud directory. Though, I’m going to show you a graphical tool to do the job.

1. First, open terminal (Ctrl+Alt+T) and run command to install the goverlay package:

sudo apt install goverlay

2. Next, launch the tool from either start menu or GNOME overview depends on your DE:

3. In the first tab of ‘goverlay’ app window, turn on “Global Enable” to enable the configuration for all games running with mangohud, set a title if you want, and set orientation, font, background, transparency, position etc as you want.

While next 3 tabs allow you to configure FPS limit, VSYNC, and toggle display following information:

  • GPU load, core frequency, temperature, memory frequency, power, VRAM, etc.
  • CPU load, frequency, temperature, RAM, power, etc.
  • FPS, resolution, NVME temperature, Distro info, Engine version, etc.

By clicking on Save button, it shows you the overlay preview in right, and automatically create .config/MangoHud/MangoHud.conf file that will apply for all native game packages.

For Steam (Flatpak version), just copy that file from .config/MangoHud and paste to .var/app/com.valvesoftware.Steam/config/MangoHud.

Press Ctrl+H to show or hide the hidden .var, .config folders, and create MangoHud sub-folder if NOT exist.

For more about the MangoHud in-game overlay, see the official project page.

Twitter

I'm a freelance blogger who started using Ubuntu in 2007 and wishes to share my experiences and some useful tips with Ubuntu beginners and lovers. Please comment to let me know if the tutorial is outdated! And, notify me if you find any typo/grammar/language mistakes. English is not my native language. Contact me via ubuntuhandbook1@gmail.com Buy me a coffee: https://ko-fi.com/ubuntuhandbook1 |

No Comments

Be the first to start the conversation.

Leave a Reply

Text formatting is available via select HTML.

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> 

*