Code Monkey home page Code Monkey logo

mangohud's Introduction

MangoHud

A Vulkan and OpenGL overlay for monitoring FPS, temperatures, CPU/GPU load and more.

Example gif showing a standard performance readout with frametimes


Installation - Build From Source


If you wish to compile MangoHud to keep up to date with any changes - first clone this repository and cd into it:

git clone --recurse-submodules https://github.com/flightlessmango/MangoHud.git
cd MangoHud

Using meson to install "manually":

meson build
ninja -C build install

By default, meson should install MangoHud to /usr/local. Specify install prefix with --prefix=/usr if desired. Add -Dappend_libdir_mangohud=false option to meson to not append mangohud to libdir if desired (e.g. /usr/local/lib/mangohud).

To install 32-bit build on 64-bit distro, specify proper libdir: lib32 for Arch, lib/i386-linux-gnu on Debian-based distros. RPM-based distros usually install 32-bit libraries to /usr/lib and 64-bit to /usr/lib64. You may have to change PKG_CONFIG_PATH to point to correct folders for your distro.

CC="gcc -m32" \
CXX="g++ -m32" \
PKG_CONFIG_PATH="/usr/lib32/pkgconfig:/usr/lib/i386-linux-gnu/pkgconfig:/usr/lib/pkgconfig" \
meson build32 --libdir lib32
ninja -C build32 install

Dependencies

Install necessary development packages.

  • gcc, g++
  • or gcc-multilib, g++-multilib for 32-bit support
  • meson >=0.54
  • ninja (ninja-build)
  • glslang
  • libGL/libEGL (libglvnd, mesa-common-dev, mesa-libGL-devel etc)
  • X11 (libx11-dev)
  • XNVCtrl (libxnvctrl-dev), optional, use -Dwith_xnvctrl=disabled option with meson to disable
  • D-Bus (libdbus-1-dev), optional, use -Dwith_dbus=disabled option with meson to disable
  • wayland-client
  • xcbcommon

Python 3 libraries:

  • Mako (python3-mako or install with pip)

If distro's packaged meson is too old and gives build errors, install newer version with pip (python3-pip).

Building with build script

You can also use build.sh script to do some things automatically like install dependencies, if distro is supported but it usually assumes you are running on x86_64 architecture.

To just build it, execute:

./build.sh build

You can also pass arguments to meson:

./build.sh build -Dwith_xnvctrl=disabled

Resulting files will be install to ./build/release folder.

If you have compiled MangoHud from source, to install it, execute:

./build.sh install

You can then subsequently uninstall MangoHud via the following command

./build.sh uninstall

To tar up the resulting binaries into a package and create a release tar with installer script, execute:

./build.sh package release

or combine the commands, although package should also call build if it doesn't find the built libs:

./build.sh build package release

If you have built MangoHud before and suddenly it fails, you can try cleaning the build folder, execute:

./build.sh clean

Currently it just does rm -fr build and clears subprojects.

NOTE: If you are running an Ubuntu-based, Arch-based, Fedora-based, or openSUSE-based distro, the build script will automatically detect and prompt you to install missing build dependencies. If you run into any issues with this please report them!

Installation - Pre-packaged Binaries


GitHub releases

If you do not wish to compile anything, simply download the file under Releases, extract it, and from within the extracted folder in terminal, execute:

./mangohud-setup.sh install

Arch-based distributions

If you are using an Arch-based distribution, install mangohud and lib32-mangohud from the extra/multilib repository. mangohud-git and lib32-mangohud-git are available on the AUR to be installed via your favourite AUR helper. These can help fix issues with the hud not activating when using stable releases from pacman!

If you are building it by yourself, you need to enable multilib repository, by editing pacman config:

sudo nano /etc/pacman.conf

and uncomment:

#[multilib]
#Include = /etc/pacman.d/mirrorlist

then save the file and execute:

sudo pacman -Syy

Debian, Ubuntu

If you are using Debian 11 (Bullseye) or later, Ubuntu 21.10 (Impish) or later, or distro derived from them, to install the MangoHud package, execute:

sudo apt install mangohud

Optionally, if you also need MangoHud for 32-bit applications, execute:

sudo apt install mangohud:i386

Fedora

If you are using Fedora, to install the MangoHud package, execute:

sudo dnf install mangohud

Solus

If you are using Solus, to install MangoHud simply execute:

sudo eopkg it mangohud

openSUSE

If you run openSUSE Leap or Tumbleweed you can get Mangohud from the official repositories. There are two packages, mangohud for 64bit and mangohud-32bit for 32bit application support. To have Mangohud working for both 32bit and 64bit applications you need to install both packages even on a 64bit operating system.

sudo zypper in mangohud mangohud-32bit

Leap doesn't seem to have the 32bit package.

Leap 15.2

sudo zypper addrepo -f https://download.opensuse.org/repositories/games:tools/openSUSE_Leap_15.2/games:tools.repo
sudo zypper install mangohud

Leap 15.3

sudo zypper addrepo -f https://download.opensuse.org/repositories/games:tools/openSUSE_Leap_15.3/games:tools.repo
sudo zypper install mangohud

Flatpak

If you are using Flatpaks, you will have to add the Flathub repository for your specific distribution, and then, to install it, execute:

For flatpak:

flatpak install org.freedesktop.Platform.VulkanLayer.MangoHud

To enable MangoHud for all Steam games:

flatpak override --user --env=MANGOHUD=1 com.valvesoftware.Steam

Normal usage


To enable the MangoHud overlay layer for Vulkan and OpenGL, run :

mangohud /path/to/app

For Lutris games, go to the System options in Lutris (make sure that advanced options are enabled) and add this to the Command prefix setting:

mangohud

For Steam games, you can add this as a launch option:

mangohud %command%

Or alternatively, add MANGOHUD=1 to your shell profile (Vulkan only).

OpenGL

OpenGL games may also need dlsym hooking. Add --dlsym to your command like mangohud --dlsym %command% for Steam.

Some Linux native OpenGL games overrides LD_PRELOAD and stops MangoHud from working. You can sometimes fix this by editing LD_PRELOAD in the start script LD_PRELOAD=/path/to/mangohud/lib/

Hud configuration

MangoHud comes with a config file which can be used to set configuration options globally or per application. Usually it is installed as /usr/share/doc/mangohud/MangoHud.conf.example or get a copy from here.

The priorities of different config files are:

  1. /path/to/application/dir/MangoHud.conf
  2. Per-application configuration in ~/.config/MangoHud:
    1. ~/.config/MangoHud/<application_name>.conf for native applications, where <application_name> is the case sensitive name of the executable
    2. ~/.config/MangoHud/wine-<application_name>.conf for wine/proton apps, where <application_name> is the case sensitive name of the executable without the .exe ending
  3. ~/.config/MangoHud/MangoHud.conf

Example: For Overwatch, this would be wine-Overwatch.conf (even though the executable you run from Lutris is Battle.net.exe, the actual game executable name is Overwatch.exe).

If you start the game from the terminal with MangoHud enabled (for example by starting Lutris from the terminal), MangoHud will print the config file names it is looking for.

You can find an example config in /usr/share/doc/mangohud

GOverlay is a GUI application that can be used to manage the config


Environment Variables

You can also customize the hud by using the MANGOHUD_CONFIG environment variable while separating different options with a comma. This takes priority over any config file.

You can also specify configuration file with MANGOHUD_CONFIGFILE=/path/to/config for applications whose names are hard to guess (java, python etc).

You can also specify presets file with MANGOHUD_PRESETSFILE=/path/to/config. This is especially useful when running mangohud in a sandbox such as flatpak.

A partial list of parameters are below. See the config file for a complete list. Parameters that are enabled by default have to be explicitly disabled. These (currently) are fps, frame_timing, cpu_stats (cpu load), gpu_stats (gpu load), and each can be disabled by setting the corresponding variable to 0 (e.g., fps=0).

Variable Description
af Anisotropic filtering level. Improves sharpness of textures viewed at an angle 0-16
alpha Set the opacity of all text and frametime graph 0.0-1.0
arch Show if the application is 32- or 64-bit
autostart_log= Starts the log after X seconds from mangohud init
background_alpha Set the opacity of the background 0.0-1.0
battery_color Change the battery text color
battery_icon Display battery icon instead of percent
battery_watt Display wattage for the battery option
battery_time Display remaining time for battery option
battery Display current battery percent and energy consumption
benchmark_percentiles Configure which framerate percentiles are shown in the logging summary. Default is 97,AVG,1,0.1
bicubic Force bicubic filtering
blacklist Add a program to the blacklist. e.g blacklist=vkcube,WatchDogs2.exe
cellpadding_y Set the vertical cellpadding, default is -0.085
control= Sets up a unix socket with a specific name that can be connected to with mangohud-control.
I.e. control=mangohud or control=mangohud-%p (%p will be replaced by process id)
core_load_change Change the colors of cpu core loads, uses the same data from cpu_load_value and cpu_load_change
core_load Display load & frequency per core
core_bars Change the display of core_load from numbers to vertical bars
cpu_load_change Change the color of the CPU load depending on load
cpu_load_color Set the colors for the gpu load change low, medium and high. e.g cpu_load_color=0000FF,00FFFF,FF00FF
cpu_load_value Set the values for medium and high load e.g cpu_load_value=50,90
cpu_mhz Show the CPUs current MHz
cpu_power
gpu_power
Display CPU/GPU draw in watts
cpu_temp
gpu_temp
gpu_junction_temp
gpu_mem_temp
Display current CPU/GPU temperature
cpu_text
gpu_text
Override CPU and GPU text
custom_text_center Display a custom text centered useful for a header e.g custom_text_center=FlightLessMango Benchmarks
custom_text Display a custom text e.g custom_text=Fsync enabled
debug Shows the graph of gamescope app frametimes and latency (only on gamescope obviously)
device_battery_icon Display wirless device battery icon.
device_battery Display wireless device battery percent. Currently supported arguments gamepad and mouse e.g device_battery=gamepad,mouse
dynamic_frame_timing This changes frame_timing y-axis to correspond with the current maximum and minimum frametime instead of being a static 0-50
engine_short_names Display a short version of the used engine (e.g. OGL instead of OpenGL)
engine_version Display OpenGL or vulkan and vulkan-based render engine's version
exec Display output of bash command in next column, e.g custom_text=/home , exec=df -h /home | tail -n 1. Only works with legacy_layout=0
exec_name Display current exec name
fan Shows the Steam Deck fan rpm
fcat Enables frame capture analysis
fcat_overlay_width= Sets the width of fcat. Default is 24
fcat_screen_edge= Decides the edge fcat is displayed on. A value between 1 and 4
font_file_text Change text font. Otherwise font_file is used
font_file Change default font (set location to .TTF/.OTF file)
font_glyph_ranges Specify extra font glyph ranges, comma separated: korean, chinese, chinese_simplified, japanese, cyrillic, thai, vietnamese, latin_ext_a, latin_ext_b. If you experience crashes or text is just squares, reduce font size or glyph ranges
font_scale= Set global font scale. Default is 1.0
font_scale_media_player Change size of media player text relative to font_size
font_size= Customizeable font size. Default is 24
font_size_text= Customizeable font size for other text like media metadata. Default is 24
fps_color_change Change the FPS text color depepending on the FPS value
fps_color= Choose the colors that the fps changes to when fps_color_change is enabled. Corresponds with fps_value. Default is b22222,fdfd09,39f900
fps_limit_method If FPS limiter should wait before or after presenting a frame. Choose late (default) for the lowest latency or early for the smoothest frametimes
fps_limit Limit the apps framerate. Comma-separated list of one or more FPS values. 0 means unlimited
fps_only Show FPS only. Not meant to be used with other display params
fps_sampling_period= Time interval between two sampling points for gathering the FPS in milliseconds. Default is 500
fps_value Choose the break points where fps_color_change changes colors between. E.g 60,144, default is 30,60
fps_metrics Takes a list of decimal values or the value avg, e.g avg,0.001
frame_count Display frame count
frametime Display frametime next to FPS text
fsr Display the status of FSR (only works in gamescope)
hdr Display the status of HDR (only works in gamescope)
refresh_rate Display the current refresh rate (only works in gamescope)
full Enable most of the toggleable parameters (currently excludes histogram)
gamemode Show if GameMode is on
gpu_color
cpu_color
vram_color
ram_color
io_color
engine_color
frametime_color
background_color
text_color
media_player_color
Change default colors: gpu_color=RRGGBB
gpu_core_clock
gpu_mem_clock
Display GPU core/memory frequency
gpu_fan GPU fan in rpm on AMD, FAN in percent on NVIDIA
gpu_load_change Change the color of the GPU load depending on load
gpu_load_color Set the colors for the gpu load change low,medium and high. e.g gpu_load_color=0000FF,00FFFF,FF00FF
gpu_load_value Set the values for medium and high load e.g gpu_load_value=50,90
gpu_name Display GPU name from pci.ids
gpu_voltage Display GPU voltage (only works on AMD GPUs)
hide_fsr_sharpness Hides the sharpness info for the fsr option (only available in gamescope)
histogram Change FPS graph to histogram
horizontal Display Mangohud in a horizontal position
horizontal_stretch Stretches the background to the screens width in horizontal mode
hud_compact Display compact version of MangoHud
hud_no_margin Remove margins around MangoHud
io_read
io_write
Show non-cached IO read/write, in MiB/s
log_duration Set amount of time the logging will run for (in seconds)
log_interval Change the default log interval in milliseconds. Default is 0
log_versioning Adds more headers and information such as versioning to the log. This format is not supported on flightlessmango.com (yet)
media_player_format Format media player metadata. Add extra text etc. Semi-colon breaks to new line. Defaults to {title};{artist};{album}
media_player_name Force media player DBus service name without the org.mpris.MediaPlayer2 part, like spotify, vlc, audacious or cantata. If none is set, MangoHud tries to switch between currently playing players
media_player Show media player metadata
no_display Hide the HUD by default
no_small_font Use primary font size for smaller text like units
offset_x offset_y HUD position offsets
output_file Set location and name of the log file
output_folder Set location of the output files (Required for logging)
pci_dev Select GPU device in multi-gpu setups
permit_upload Allow uploading of logs to Flightlessmango.com
picmip Mip-map LoD bias. Negative values will increase texture sharpness (and aliasing). Positive values will increase texture blurriness -16-16
position= Location of the HUD: top-left (default), top-right, middle-left, middle-right, bottom-left, bottom-right, top-center, bottom-center
preset= Comma separated list of one or more presets. Default is -1,0,1,2,3,4. Available presets:
0 (No Hud)
1 (FPS Only)
2 (Horizontal)
3 (Extended)
4 (Detailed)
User defined presets can be created by using a presets.conf file in ~/.config/MangoHud/.
procmem
procmem_shared, procmem_virt
Displays process' memory usage: resident, shared and/or virtual. procmem (resident) also toggles others off if disabled
ram
vram
Display system RAM/VRAM usage
read_cfg Add to MANGOHUD_CONFIG as first parameter to also load config file. Otherwise only MANGOHUD_CONFIG parameters are used
reload_cfg= Change keybind for reloading the config. Default = Shift_L+F4
resolution Display the current resolution
retro Disable linear texture filtering. Makes textures look blocky
round_corners Change the amount of roundness of the corners have e.g round_corners=10.0
show_fps_limit Display the current FPS limit
swap Display swap space usage next to system RAM usage
table_columns Set the number of table columns for ImGui, defaults to 3
temp_fahrenheit Show temperature in Fahrenheit
text_outline Draw an outline around text for better readability. Enabled by default.
text_outline_color= Set the color of text_outline. Default = 000000
text_outline_thickness= Set the thickness of text_outline. Default = 1.5
throttling_status Show if GPU is throttling based on Power, current, temp or "other" (Only shows if throttling is currently happening). Currently disabled by default for Nvidia as it causes lag on 3000 series
throttling_status_graph Same as throttling_status but displays throttling in the frametime graph and only power and temp throttling
time
time_format=%T
Display local time. See std::put_time for formatting help. NOTE: Sometimes apps may set TZ (timezone) environment variable to UTC/GMT
time_no_label Remove the label before time
toggle_fps_limit Cycle between FPS limits (needs at least two values set with fps_limit). Defaults to Shift_L+F1
toggle_preset Cycle between Presets. Defaults to Shift_R+F10
toggle_hud=
toggle_logging=
Modifiable toggle hotkeys. Default are Shift_R+F12 and Shift_L+F2, respectively
toggle_hud_position Toggle MangoHud postion. Default is R_Shift+F11
trilinear Force trilinear filtering
upload_log Change keybind for uploading log
upload_logs Enables automatic uploads of logs to flightlessmango.com
version Show current MangoHud version
vkbasalt Show if vkBasalt is on
vsync
gl_vsync
Set Vsync for OpenGL or Vulkan
vulkan_driver Display used Vulkan driver (radv/amdgpu-pro/amdvlk)
width=
height=
Customizeable HUD dimensions (in pixels)
wine_color Change color of the wine/proton text
wine Show current Wine or Proton version in use
winesync Show wine sync method in use
present_mode Shows current vulkan present mode or vsync status in opengl
network Show network interfaces tx and rx kb/s. You can specify interface with network=eth0

Example: MANGOHUD_CONFIG=cpu_temp,gpu_temp,position=top-right,height=500,font_size=32 Because comma is also used as option delimiter and needs to be escaped for values with a backslash, you can use + like MANGOHUD_CONFIG=fps_limit=60+30+0 instead.

Note: Width and Height are set automatically based on the font_size, but can be overridden.

Note: RAPL is currently used for Intel CPUs to show power draw with cpu_power which may be unreadable for non-root users due to vulnerability. The corresponding energy_uj file has to be readable by corresponding user, e.g. by running chmod o+r /sys/class/powercap/intel-rapl\:0/energy_uj as root, else the power shown will be 0 W, though having the file readable may potentially be a security vulnerability persisting until system reboots.

Note: The zenpower3 or zenergy kernel driver must be installed to show the power draw of Ryzen CPUs.

Vsync

OpenGL Vsync

  • -1 = Adaptive sync
  • 0 = Off
  • 1 = On
  • n = Sync to refresh rate / n.

Vulkan Vsync

  • 0 = Adaptive VSync (FIFO_RELAXED_KHR)
  • 1 = Off (IMMEDIATE_KHR)
  • 2 = Mailbox (VSync with uncapped FPS) (MAILBOX_KHR)
  • 3 = On (FIFO_KHR)

Not all vulkan vsync options may be supported on your device, you can check what your device supports here vulkan.gpuinfo.org

Keybindings

  • Shift_L+F2 : Toggle Logging
  • Shift_L+F4 : Reload Config
  • Shift_R+F12 : Toggle Hud

Workarounds

Options starting with "gl_*" are for OpenGL.

  • gl_size_query = viewport : Specify what to use for getting display size. Options are "viewport", "scissorbox" or disabled. Defaults to using glXQueryDrawable.
  • gl_bind_framebuffer = 0..N : (Re)bind given framebuffer before MangoHud gets drawn. Helps with Crusader Kings III.
  • gl_dont_flip = 1 : Don't swap origin if using GL_UPPER_LEFT. Helps with Ryujinx.

FPS logging

You must set a valid path for output_folder in your configuration to store logs in.

When you toggle logging (default keybind is Shift_L+F2), a file is created with the game name plus a date & timestamp in your output_folder.

Log files can be visualized with two different tools: online and locally.

Online visualization: FlightlessMango.com

Log files can be (batch) uploaded to FlightlessMango.com, which will then take care of creating a frametime graph and a summary with 1% min / average framerate / 97th percentile in a table form and a horizontal bar chart form.

Notes:

  • Uploaded benchmarks are public: you can share them with anyone by simply giving them the link.
  • Benchmark filenames are used as legend in the produced tables and graphs, they can be renamed after the upload.

Gif illustrating the log uploading process

Local visualization: mangoplot

mangoplot is a plotting script that is shipped with MangoHud: on a given folder, it takes each log file, makes a 1D heatmap of its framerates, then stacks the heats maps vertically to form a 2D graph for easy visual comparison between benchmarks.

Example output:

Overwatch 2 windows 11 vs linux

Overwatch 2, 5950X + 5700XT, low graphics preset, FHD, 50% render scale

mangohud's People

Contributors

andrealmeid avatar andrefgard avatar baryluk avatar billli11 avatar boukehaarsma23 avatar danyspin97 avatar dependabot[bot] avatar etaash-mathamsetty avatar evelikov avatar evelikov-work avatar faalagorn avatar flightlessmango avatar forthereallys avatar gort818 avatar hannesmann avatar jackun avatar johnnynator avatar joshua-ashton avatar krathalan avatar larskraemer avatar lukashoracek avatar medusalix avatar newbytee avatar noxphasma avatar sfrcorne avatar skrungly avatar sporif avatar stephanlachnit avatar theevilskeleton avatar valters-tomsons avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mangohud's Issues

Manual build instructions unclear / Missing distro

Hi, there's no documented dependencies in the readme and when running the build.sh it only has support for a few named linux distros. Modified line 53 to read *"buntu"|"Linux Mint"|"Debian"|"Zorin OS"|"Pop!_OS") and then the script downloaded required dependencies.

Can't build without nvidia-settings

Hi. I'm trying to build the master branch, and I got this error:
`eduardo MangoHud (master) $ ./build.sh install

Checking Dependencies

Unable to find distro information!

Attempting to build regardless

The Meson build system
Version: 0.52.1
Source dir: /home/eduardo/Downloads/MangoHud
Build dir: /home/eduardo/Downloads/MangoHud/build/meson64
Build type: native build
Project name: mangohud
Project version: v1.0.0
C compiler for the host machine: ccache cc (gcc 9.2.0 "cc (Gentoo 9.2.0-r2 p3) 9.2.0")
C linker for the host machine: GNU ld.bfd 2.32
C++ compiler for the host machine: ccache c++ (gcc 9.2.0 "c++ (Gentoo 9.2.0-r2 p3) 9.2.0")
C++ linker for the host machine: GNU ld.bfd 2.32
Host machine cpu family: x86_64
Host machine cpu: x86_64
Program python3 found: YES (/usr/bin/python3)
Checking if "GCC atomic builtins" compiles: YES
Checking if "Supports timespec_get" compiles: YES
Checking for function "bswap32" : YES
Checking for function "bswap64" : YES
Checking for function "clz" : YES
Checking for function "clzll" : YES
Checking for function "ctz" : YES
Checking for function "expect" : YES
Checking for function "ffs" : YES
Checking for function "ffsll" : YES
Checking for function "popcount" : YES
Checking for function "popcountll" : YES
Checking for function "unreachable" : YES
Found pkg-config: /usr/bin/pkg-config (0.29.2)
Run-time dependency x11 found: YES 1.6.9
Compiler for C supports arguments -Werror=implicit-function-declaration: YES
Compiler for C supports arguments -Werror=missing-prototypes: YES
Compiler for C supports arguments -Werror=return-type: YES
Compiler for C supports arguments -Werror=incompatible-pointer-types: YES
Compiler for C supports arguments -fno-math-errno: YES
Compiler for C supports arguments -fno-trapping-math: YES
Compiler for C supports arguments -Qunused-arguments: NO
Compiler for C supports arguments -Wmissing-field-initializers: YES
Compiler for C supports arguments -Wformat-truncation: YES
Compiler for C supports arguments -fvisibility=hidden: YES
Compiler for C++ supports arguments -Werror=return-type: YES
Compiler for C++ supports arguments -fno-math-errno: YES
Compiler for C++ supports arguments -fno-trapping-math: YES
Compiler for C++ supports arguments -Qunused-arguments: NO
Compiler for C++ supports arguments -Wnon-virtual-dtor: YES
Compiler for C++ supports arguments -Wmissing-field-initializers: YES
Compiler for C++ supports arguments -Wformat-truncation: YES
Compiler for C++ supports arguments -Wpointer-arith: YES
Compiler for C++ supports arguments -Wunused-variable: YES
Compiler for C supports arguments -Woverride-init: YES
Compiler for C supports arguments -Winitializer-overrides: NO
Compiler for C++ supports arguments -fvisibility=hidden: YES
Checking for function "dlopen" : NO
Library dl found: YES
Library pthread found: YES
Program glslangValidator found: YES (/usr/bin/glslangValidator)
Compiler for C supports link arguments -Wl,-Bsymbolic-functions: YES
Compiler for C supports link arguments -Wl,-z,relro: YES
Build targets in project: 7
Found ninja-1.8.2 at /usr/bin/ninja
The Meson build system
Version: 0.52.1
Source dir: /home/eduardo/Downloads/MangoHud
Build dir: /home/eduardo/Downloads/MangoHud/build/meson32
Build type: native build
Project name: mangohud
Project version: v1.0.0
C compiler for the host machine: gcc -m32 (gcc 9.2.0 "gcc (Gentoo 9.2.0-r2 p3) 9.2.0")
C linker for the host machine: GNU ld.bfd 2.32
C++ compiler for the host machine: g++ -m32 (gcc 9.2.0 "g++ (Gentoo 9.2.0-r2 p3) 9.2.0")
C++ linker for the host machine: GNU ld.bfd 2.32
Host machine cpu family: x86
Host machine cpu: i686
Program python3 found: YES (/usr/bin/python3)
Checking if "GCC atomic builtins" compiles: YES
Checking if "Supports timespec_get" compiles: YES
Checking for function "bswap32" : YES
Checking for function "bswap64" : YES
Checking for function "clz" : YES
Checking for function "clzll" : YES
Checking for function "ctz" : YES
Checking for function "expect" : YES
Checking for function "ffs" : YES
Checking for function "ffsll" : YES
Checking for function "popcount" : YES
Checking for function "popcountll" : YES
Checking for function "unreachable" : YES
Found pkg-config: /usr/bin/pkg-config (0.29.2)
Run-time dependency x11 found: YES 1.6.9
Compiler for C supports arguments -Werror=implicit-function-declaration: YES
Compiler for C supports arguments -Werror=missing-prototypes: YES
Compiler for C supports arguments -Werror=return-type: YES
Compiler for C supports arguments -Werror=incompatible-pointer-types: YES
Compiler for C supports arguments -fno-math-errno: YES
Compiler for C supports arguments -fno-trapping-math: YES
Compiler for C supports arguments -Qunused-arguments: NO
Compiler for C supports arguments -Wmissing-field-initializers: YES
Compiler for C supports arguments -Wformat-truncation: YES
Compiler for C supports arguments -fvisibility=hidden: YES
Compiler for C++ supports arguments -Werror=return-type: YES
Compiler for C++ supports arguments -fno-math-errno: YES
Compiler for C++ supports arguments -fno-trapping-math: YES
Compiler for C++ supports arguments -Qunused-arguments: NO
Compiler for C++ supports arguments -Wnon-virtual-dtor: YES
Compiler for C++ supports arguments -Wmissing-field-initializers: YES
Compiler for C++ supports arguments -Wformat-truncation: YES
Compiler for C++ supports arguments -Wpointer-arith: YES
Compiler for C++ supports arguments -Wunused-variable: YES
Compiler for C supports arguments -Woverride-init: YES
Compiler for C supports arguments -Winitializer-overrides: NO
Compiler for C++ supports arguments -fvisibility=hidden: YES
Checking for function "dlopen" : NO
Library dl found: YES
Library pthread found: YES
Program glslangValidator found: YES (/usr/bin/glslangValidator)
Compiler for C supports link arguments -Wl,-Bsymbolic-functions: YES
Compiler for C supports link arguments -Wl,-z,relro: YES
Build targets in project: 7
Found ninja-1.8.2 at /usr/bin/ninja
ninja: Entering directory build/meson32' [1/25] Generating overlay.vert.spv.h with a custom command. ../../src/overlay.vert [2/25] Generating overlay.frag.spv.h with a custom command. ../../src/overlay.frag [11/25] Compiling C++ object 'src/25a6634@@MangoHud@sha/overlay.cpp.o'. FAILED: src/25a6634@@MangoHud@sha/overlay.cpp.o g++ -m32 -Isrc/25a6634@@MangoHud@sha -Isrc -I../../src -I../../include -I../../modules/Vulkan-Headers/include -I../../modules/ImGui/src -I. -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++14 -O3 -Werror=return-type -fno-math-errno -fno-trapping-math -Wno-non-virtual-dtor -Wno-missing-field-initializers -Wno-format-truncation -Wno-pointer-arith -Wno-unused-variable -fPIC -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS '-DPACKAGE_VERSION="v1.0.0"' -DNDEBUG -D_GNU_SOURCE -DHAVE_PTHREAD -DUSE_GCC_ATOMIC_BUILTINS -DHAVE_TIMESPEC_GET -DHAVE___BUILTIN_BSWAP32 -DHAVE___BUILTIN_BSWAP64 -DHAVE___BUILTIN_CLZ -DHAVE___BUILTIN_CLZLL -DHAVE___BUILTIN_CTZ -DHAVE___BUILTIN_EXPECT -DHAVE___BUILTIN_FFS -DHAVE___BUILTIN_FFSLL -DHAVE___BUILTIN_POPCOUNT -DHAVE___BUILTIN_POPCOUNTLL -DHAVE___BUILTIN_UNREACHABLE -fvisibility=hidden -DVK_USE_PLATFORM_XLIB_KHR -MD -MQ 'src/25a6634@@MangoHud@sha/overlay.cpp.o' -MF 'src/25a6634@@MangoHud@sha/overlay.cpp.o.d' -o 'src/25a6634@@MangoHud@sha/overlay.cpp.o' -c ../../src/overlay.cpp In file included from ../../src/cpu_gpu.h:18, from ../../src/overlay.cpp:49: ../../src/nvctrl.h:2:10: fatal error: NVCtrl/NVCtrl.h: No such file or directory 2 | #include "NVCtrl/NVCtrl.h" | ^~~~~~~~~~~~~~~~~ compilation terminated. [22/25] Compiling C++ object 'src/25a6634@@MangoHud@sha/cpu.cpp.o'. ninja: build stopped: subcommand failed. ninja: Entering directory build/meson64'
[5/25] Generating overlay.frag.spv.h with a custom command.
../../src/overlay.frag
[6/25] Generating overlay.vert.spv.h with a custom command.
../../src/overlay.vert
[23/25] Compiling C++ object 'src/25a6634@@MangoHud@sha/overlay.cpp.o'.
FAILED: src/25a6634@@MangoHud@sha/overlay.cpp.o
ccache c++ -Isrc/25a6634@@MangoHud@sha -Isrc -I../../src -I../../include -I../../modules/Vulkan-Headers/include -I../../modules/ImGui/src -I. -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++14 -O3 -Werror=return-type -fno-math-errno -fno-trapping-math -Wno-non-virtual-dtor -Wno-missing-field-initializers -Wno-format-truncation -Wno-pointer-arith -Wno-unused-variable -fPIC -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS '-DPACKAGE_VERSION="v1.0.0"' -DNDEBUG -D_GNU_SOURCE -DHAVE_PTHREAD -DUSE_GCC_ATOMIC_BUILTINS -DHAVE_TIMESPEC_GET -DHAVE___BUILTIN_BSWAP32 -DHAVE___BUILTIN_BSWAP64 -DHAVE___BUILTIN_CLZ -DHAVE___BUILTIN_CLZLL -DHAVE___BUILTIN_CTZ -DHAVE___BUILTIN_EXPECT -DHAVE___BUILTIN_FFS -DHAVE___BUILTIN_FFSLL -DHAVE___BUILTIN_POPCOUNT -DHAVE___BUILTIN_POPCOUNTLL -DHAVE___BUILTIN_UNREACHABLE -fvisibility=hidden -DVK_USE_PLATFORM_XLIB_KHR -MD -MQ 'src/25a6634@@MangoHud@sha/overlay.cpp.o' -MF 'src/25a6634@@MangoHud@sha/overlay.cpp.o.d' -o 'src/25a6634@@MangoHud@sha/overlay.cpp.o' -c ../../src/overlay.cpp
In file included from ../../src/cpu_gpu.h:18,
from ../../src/overlay.cpp:49:
../../src/nvctrl.h:2:10: fatal error: NVCtrl/NVCtrl.h: No such file or directory
2 | #include "NVCtrl/NVCtrl.h"
| ^~~~~~~~~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.
cp: cannot stat 'build/release/usr/lib32/libMangoHud.so': No such file or directory
cp: cannot stat 'build/release/usr/lib64/libMangoHud.so': No such file or directory
cp: cannot stat 'build/release/usr/share/vulkan/implicit_layer.d/mangohud.json': No such file or directory
cp: cannot stat 'build/release/usr/share/vulkan/implicit_layer.d/mangohud.json': No such file or directory
sed: can't read build/package/MangoHud/.local/share/vulkan/implicit_layer.d/mangohud32.json: No such file or directory
sed: can't read /home/eduardo/.local/share/vulkan/implicit_layer.d/mangohud32.json: No such file or directory
sed: can't read /home/eduardo/.local/share/vulkan/implicit_layer.d/mangohud64.json: No such file or directory
`

I belive that this is related to nvidia-settings stuff, that I really don't have, as I use an AMD GPU. Is this a mandatory dependency?

Wine games specific config and display flexibility

-When trying to use a config file in application's folder using wine, it doesn't load and the default config used instead. So seems that there is no way to use specific config file for an application which runs through wine.

-Though I like a lot the look of this hud, I would like to have more control to displayed elements. As it is now, I didn't find a way to turn off CPU/GPU elements and graph. Seems that there is no option to display only FPS or CPU load for example. It also would be nice if have 3 modes(simple/full/no_display) and switch them from the shortcut key. Like Assassin's Creed Odyssey has.

Flatpak package (for using with Steam)

First, thank you for creating this nice HUD!

While it's currently impossible to package a vulkan layer so that it would work with all flatpaks at once, MangoHud can be packaged as a flatpak extension for Steam flatpak app, for which it's probably the most useful.

I've submitted it here flathub/flathub#1371. If you'd like to (co)maintain the MangoHud flatpak (which is totally welcome), please let Flathub admins know (in that PR).

GPU stats dissapears with Life Is Strange 2

When I use MangoHud with Life Is Strange 2, GPU stats appears on the launcher, but as soon I press on Play, GPU stats dissapears

Here is the launcher (GPU appears):

Life Is Strange_2

Here is the game itself (GPU disappears):

Life Is Strange 2

Usage inside Steam Linux Runtime

I want to use this tool on Rise of the Tomb Raider, but I am on Arch Linux and this game requires some outdated libraries that only still ship on Ubuntu, so I run it through Steam Linux Runtime. I must point that I got to this solution after a month long chat with Feral support where they couldn't provide much help.

So, the SLR overlays the libraries over the host system, and this overlay hides mangohud library and the implicit_layer.d files. Because of that, the HUD is missing when running Vulkan games inside SLR. Is it possible to make the files visible under SLR so I can have the HUD?

Segfault on launch with Could not find cpu temp sensor location

Mangohud 0.3.0 downloaded from Releases, installed without problems. Ubuntu 19.10, MacBookPro 6,2, Core i7-620M, nVidia Geforce GT 330M driver 340.107. As you can see, there's no Vulkan here. I'm trying to run Mangohud with Doom 3 via dhewm3 in 64-bit mode. Doom itself runs fine.

After it failed the first time I installed lm-sensors and did sensors-detect and then modprobed coretemp, no improvement. Running sensors shows a bunch of temps.

I tried disabling cpu_stats in the config file but it didn't help.

Am I missing something or is this possibly a bug? I'll happily provide any and all info to help fix it. Thanks.

Issue with configuration files

Putting MangoHud.conf inside the folder of the game, or using MANGOHUD_CONFIG= doesn't overwrite the configurations inside ~/.config/MangoHud/MangoHud.conf

32-bit games work with the HUD, but not 64-bit Games.

An odd bug is happening where, no matter what I try, the loader for HUD will work on 32bit games (Sonic Mania, Borderlands 2, even Source Filmmaker!), but not on 64-bit games (A Hat In Time, Shadow of the Tomb Raider, The Witcher III: Wild Hunt, HITMAN 2). I tried different Proton versions, I opted out of the steam beta. I even compiled it myself, with the exact same issues. Sonic Mania works, but Hitman 2 does not.

There seems to be a 64-bit library that Steam isn't loading that does not load the HUD, and i can't quite put my finger on what. Any help would be greatly appreciated!

Whole PC hangs when MANGOHUD_CONFIG=full is used

CPU: AMD Ryzen 5 2600
GPU: Nvidia GTX 1060 (440.59 driver)
OS: Arch
DE: Gnome 3.34.4/Xorg

So when a native or DXVK game is launched with MANGOHUD=1 MANGOHUD_CONFIG=full env variables, whole PC hangs - black screen, background audio stops, no reaction on pressing the num/caps lock key. Only reset helps.
When MANGOHUD_CONFIG is set to cpu_temp,gpu_temp,core_load,ram,vram which is, supposedly, the same as full, this problem does not appears.

20200225193234_1

Installation doesn't work on Ubuntu

Using Ubuntu 19.10:

$ '/home/vadi/Downloads/MangoHud-v0.2.0/MangoHud/install.sh' 
cp: '.local' and '/home/vadi/.local' are the same file
cp: '.config' and '/home/vadi/.config' are the same file
sed: can't read /home/vadi/.local/share/vulkan/implicit_layer.d/mangohud32.json: No such file or directory
sed: can't read /home/vadi/.local/share/vulkan/implicit_layer.d/mangohud64.json: No such file or directory
vadi@gooseberry:~$ 

gpu_load and gpu_temp are missing with Feral3D

I run the official 0.1.0 release and found out that the gpu_load and gpu_temp values are not displayed if a games runs with Feral3D (Shadow of the Tomb Raider) while on DXVK titles and titles using "true" Vulkan it is shown.

My Steam launch options:
MANGOHUD=1 MANGOHUD_CONFIG=cpu_temp,gpu_temp,core_load,ram,vram,frame_timing %command%

Tomb Raider (Feral 3D / Vulkan):
Screenshot_20200209_173854

Bright Memory (DXVK):
Screenshot_20200209_174211

Also I noticed that the parameter vram and ram seems not to work at all as you can see in both screenshots.

My Specs:
OS: openSUSE Tumbleweed
Kernel: 5.4.14
GPU: NVidai GTX 1080
Driver: 440.59
Vulkan: 1.1.119
MangoHUD: 0.1.0
CPU: AMD Ryzen 1800X
Chipset: AMD X370 (if this might matter due to the missing values)

Did I do something wrong, is this an NVidia driver things since MangoHUD is based on the MesaHUD?

And last but not least are there any additional informations I can give?

Thank you for your help in advance :)

Kind regards,
Vortex

Issue with GPU load

GPU load = 0% all the time, and it doesn't change at all.

Darksiders_Genesis

System information:
OS: Kubuntu 19.10 - kernel: 5.3.0-29
GPU: AMD Radeon HD 8750M
CPU: Intel core I5 4200M
Driver: Mesa 20-dev (obiaf ppa)

Vega 3 gets 0% use

I use an AMD Athlon 200GE APU with Vega 3 Graphics and my gpu load is 0% :/

Option to start with hidden MangoHud

I really like how to toggle MangoHud with a hotkey.
Unfortunately, MangoHud must always be displayed on game startup before manually be toggled off.

In my use case, I'd like to start a game with MangoHud initially being hidden and only toggle it on on demand.
Any chance this can be implemented?

Not XDG compliant

Install script and config handling should use XDG_CONFIG_HOME and XDG_DATA_HOME with fallback to current values.

Won't run when compiled with -D_GLIBCXX_ASSERTIONS

FYI: You can safely disregard this issue if you wish, since by default MangoHud doesn't enable GCC hardening flags, such as -D_GLIBCXX_ASSERTIONS.

But I decided to report it here anyway, just in case. Quick background info: I'm building a Flatpak package for MangoHud. Currently, it can build both 64 and 32-bit libraries just fine, and they mostly work too (well, except for this error and the missing glxinfo binary in Flatpak).

However, the installation part is a problem at the moment. I have to manually copy the .so to whatever Flatpak app I want to use the HUD on (e.g. Steam, Lutris), due to some Flatpak restrictions. I'm still trying to find a solution to install MangoHud "globally".

Anyway, back to the issue. To build Flatpak apps we use flatpak-builder, and by default they enable these hardening flags in GCC (they can be bypassed though, that's why I said you can disregard this issue).

But a few commits ago, MangoHud was working just fine with the build made by flatpak-builder. Now, it fails to run with the following error:

$ env MANGOHUD=1 vkcube
/usr/include/c++/9.2.0/bits/stl_vector.h:1042: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = CPUData_; _Alloc = std::allocator<CPUData_>; std::vector<_Tp, _Alloc>::reference = CPUData_&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]: Assertion '__builtin_expect(__n < this->size(), true)' failed.

I'm not a C/C++ programmer, so it was kinda difficult for me to find out where the error was coming from, especially because I have mango/lib32-mango installed here on Arch and they were working just fine. After some Googling, I tried to modify the PKGBUILD to include just the -D_GLIBCXX_ASSERTIONS flag and I've also disabled stripping the debug info from the binary.

Bingo! Here's what gdb tells me:

$ env MANGOHUD=1 gdb -quiet vkcube
Reading symbols from vkcube...
(No debugging symbols found in vkcube)
(gdb) r
Starting program: /usr/bin/vkcube 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
/usr/lib/../share/gcc-9.2.0/python/libstdcxx/v6/xmethods.py:731: SyntaxWarning: list indices must be integers or slices, not str; perhaps you missed a comma?
  refcounts = ['_M_refcount']['_M_pi']
/usr/include/c++/9.2.0/bits/stl_vector.h:1042: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = CPUData_; _Alloc = std::allocator<CPUData_>; std::vector<_Tp, _Alloc>::reference = CPUData_&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]: Assertion '__builtin_expect(__n < this->size(), true)' failed.

Program received signal SIGABRT, Aborted.
0x00007ffff7c2df25 in raise () from /usr/lib/libc.so.6
(gdb) bt
#0  0x00007ffff7c2df25 in raise () from /usr/lib/libc.so.6
#1  0x00007ffff7c17897 in abort () from /usr/lib/libc.so.6
#2  0x00007ffff570c984 in std::__replacement_assert (__file=__file@entry=0x7ffff5787f98 "/usr/include/c++/9.2.0/bits/stl_vector.h", __line=__line@entry=1042, 
    __function=__function@entry=0x7ffff57b8890 "std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = CPUData_; _Alloc = std::allocator<CPUData_>; std::vector<_Tp, _Alloc>::referen"..., __condition=__condition@entry=0x7ffff5787e58 "__builtin_expect(__n < this->size(), true)")
    at /usr/include/c++/9.2.0/x86_64-pc-linux-gnu/bits/c++config.h:463
#3  0x00007ffff570af17 in std::vector<CPUData_, std::allocator<CPUData_> >::operator[] (__n=4, this=0x7ffff57d7a08 <cpuStats+8>) at /usr/include/c++/9.2.0/bits/locale_facets.h:877
#4  CPUStats::UpdateCoreMhz (this=0x7ffff57d7a00 <cpuStats>) at ../../src/cpu.cpp:210
#5  0x00007ffff570b1bc in CPUStats::UpdateCPUData (this=0x7ffff57d7a00 <cpuStats>) at ../../src/cpu.cpp:150
#6  0x00007ffff570be3c in CPUStats::Init (this=0x7ffff57d7a00 <cpuStats>) at ../../src/cpu.cpp:143
#7  0x00007ffff570c124 in CPUStats::CPUStats (this=0x7ffff57d7a00 <cpuStats>) at ../../src/cpu.cpp:99
#8  0x00007ffff56f5158 in __static_initialization_and_destruction_0 (__initialize_p=1, __priority=65535) at ../../src/cpu.cpp:220
#9  _GLOBAL__sub_I_cpu.cpp(void) () at ../../src/cpu.cpp:220
#10 0x00007ffff7fe272a in call_init.part () from /lib64/ld-linux-x86-64.so.2
#11 0x00007ffff7fe2831 in _dl_init () from /lib64/ld-linux-x86-64.so.2
#12 0x00007ffff7fe6603 in dl_open_worker () from /lib64/ld-linux-x86-64.so.2
#13 0x00007ffff7d2bd79 in _dl_catch_exception () from /usr/lib/libc.so.6
#14 0x00007ffff7fe5eee in _dl_open () from /lib64/ld-linux-x86-64.so.2
#15 0x00007ffff7bdf34c in ?? () from /usr/lib/libdl.so.2
#16 0x00007ffff7d2bd79 in _dl_catch_exception () from /usr/lib/libc.so.6
#17 0x00007ffff7d2be13 in _dl_catch_error () from /usr/lib/libc.so.6
#18 0x00007ffff7bdfab9 in ?? () from /usr/lib/libdl.so.2
#19 0x00007ffff7bdf3da in dlopen () from /usr/lib/libdl.so.2
#20 0x00007ffff7de783c in ?? () from /usr/lib/libvulkan.so.1
#21 0x00007ffff7debe6e in vkCreateInstance () from /usr/lib/libvulkan.so.1
#22 0x00005555555576b5 in ?? ()
#23 0x00007ffff7c19153 in __libc_start_main () from /usr/lib/libc.so.6
#24 0x00005555555597ae in ?? ()

If you chose to fix this (but again, you don't have to), let me know if I can provide any other information.

Thanks.

No MangoHud.conf file found anywhere

This seems strange, but I can't find the .conf file anywhere on my system. I've looked not only in the default location, but did a system wide search for it, but nothing was found.
Could you add something to show how the .conf file is supposed to look so I can just create one?

Ryzen 5 2600x
16GB DDR4 3200
Sapphire Nitro+ RX580
Pop!_OS 19.04

Memory leak when used with DX9 applications

zany130.zip
for example hat in time does this https://youtu.be/Ryq41Iu7NDU it's the same in trails in the sky (DX9) bully and valkyrie chronicles 1 they will all crash right away

the mem leak also happens in vkcube but not in directx 11 games only hat in time seems to be memleaking and rise of the tombraider works fine

steps to reproduce:

  1. launch any dx9 game with PROTON_USE_D9VK=1 MANGOHUD=1 %command% in steam
  2. Mango hud will load and show your fps etc.
  3. observe freeze and possible mem leak(not all memleak) within the first minute of running the game ( games will more or less consistently crash at the same point)
  4. try any non directx9 game that is or can be translated to vulkan with MANGOHUD=1 %command%
  5. mango hud loads fine and game does not freeze
inxi -Fxxxza --no-host
System:    Kernel: 5.4.16-29-tkg-MuQSS x86_64 bits: 64 compiler: gcc v: 9.2.0 
           parameters: BOOT_IMAGE=/boot/vmlinuz-linux54-tkg-MuQSS root=UUID=db3314cf-97c1-46aa-a6c8-05cde55c83e6 rw 
           quiet nvidia-drm.modeset=1 apparmor=1 security=apparmor resume=UUID=45c1ddfa-1329-44cb-94b6-e74c8bd86bd2 
           udev.log_priority=3 
           Desktop: KDE Plasma 5.17.5 tk: Qt 5.14.0 wm: kwin_x11 dm: SDDM Distro: Manjaro Linux 
Machine:   Type: Desktop System: Gigabyte product: X470 AORUS ULTRA GAMING v: N/A serial: <filter> 
           Mobo: Gigabyte model: X470 AORUS ULTRA GAMING-CF v: x.x serial: <filter> UEFI: American Megatrends v: F50 
           date: 11/27/2019 
CPU:       Topology: 8-Core model: AMD Ryzen 7 2700X bits: 64 type: MT MCP arch: Zen+ family: 17 (23) model-id: 8 
           stepping: 2 microcode: 800820D L2 cache: 4096 KiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm bogomips: 118381 
           Speed: 3957 MHz min/max: 2200/3700 MHz boost: enabled Core speeds (MHz): 1: 3957 2: 4131 3: 4084 4: 4171 
           5: 4065 6: 4069 7: 3862 8: 4180 9: 4089 10: 4170 11: 3611 12: 4080 13: 4020 14: 4186 15: 3674 16: 4078 
           Vulnerabilities: Type: itlb_multihit status: Not affected 
           Type: l1tf status: Not affected 
           Type: mds status: Not affected 
           Type: meltdown status: Not affected 
           Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl and seccomp 
           Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization 
           Type: spectre_v2 mitigation: Full AMD retpoline, IBPB: conditional, STIBP: disabled, RSB filling 
           Type: tsx_async_abort status: Not affected 
Graphics:  Device-1: NVIDIA GP104 [GeForce GTX 1080] vendor: Gigabyte driver: nvidia v: 440.44 bus ID: 0a:00.0 
           chip ID: 10de:1b80 
           Display: x11 server: X.Org 1.20.7 driver: nvidia compositor: kwin_x11 tty: N/A 
           OpenGL: renderer: GeForce GTX 1080/PCIe/SSE2 v: 4.6.0 NVIDIA 440.44 direct render: Yes 
Audio:     Device-1: NVIDIA GP104 High Definition Audio vendor: Gigabyte driver: snd_hda_intel v: kernel 
           bus ID: 0a:00.1 chip ID: 10de:10f0 
           Device-2: Advanced Micro Devices [AMD] Family 17h HD Audio vendor: Gigabyte driver: snd_hda_intel v: kernel 
           bus ID: 0c:00.3 chip ID: 1022:1457 
           Sound Server: ALSA v: k5.4.16-29-tkg-MuQSS 
Network:   Device-1: Intel Wi-Fi 6 AX200 driver: iwlwifi v: kernel bus ID: 05:00.0 chip ID: 8086:2723 
           IF: wlp5s0 state: down mac: <filter> 
           Device-2: Intel I211 Gigabit Network vendor: Gigabyte driver: igb v: 5.6.0-k port: f000 bus ID: 07:00.0 
           chip ID: 8086:1539 
           IF: enp7s0 state: up speed: 1000 Mbps duplex: full mac: <filter> 
           IF-ID-1: anbox0 state: down mac: <filter> 
Drives:    Local Storage: total: 3.01 TiB used: 2.48 TiB (82.2%) 
           ID-1: /dev/nvme0n1 vendor: Samsung model: SSD 970 EVO 250GB size: 232.89 GiB block size: physical: 512 B 
           logical: 512 B speed: 31.6 Gb/s lanes: 4 serial: <filter> rev: 2B2QEXE7 scheme: GPT 
           ID-2: /dev/nvme1n1 vendor: Samsung model: SSD 960 EVO 250GB size: 232.89 GiB block size: physical: 512 B 
           logical: 512 B speed: 31.6 Gb/s lanes: 4 serial: <filter> rev: 3B7QCXE7 scheme: GPT 
           ID-3: /dev/sda vendor: Seagate model: ST1000DM010-2EP102 size: 931.51 GiB block size: physical: 4096 B 
           logical: 512 B speed: 6.0 Gb/s rotation: 7200 rpm serial: <filter> rev: CC43 scheme: GPT 
           ID-4: /dev/sdb vendor: Seagate model: ST2000DX002-2DV164 size: 1.82 TiB block size: physical: 4096 B 
           logical: 512 B speed: 6.0 Gb/s rotation: 7200 rpm serial: <filter> rev: CC41 
           ID-5: /dev/sdc type: USB vendor: Patriot model: N/A size: 57.70 GiB block size: physical: 512 B 
           logical: 512 B serial: <filter> rev: PMAP scheme: MBR 
Partition: ID-1: / raw size: 215.45 GiB size: 211.06 GiB (97.97%) used: 150.88 GiB (71.5%) fs: ext4 dev: /dev/nvme0n1p2 
           ID-2: swap-1 size: 17.14 GiB used: 2.5 MiB (0.0%) fs: swap swappiness: 33 (default 60) 
           cache pressure: 50 (default 100) dev: /dev/nvme0n1p3 
Sensors:   System Temperatures: cpu: 59.1 C mobo: N/A gpu: nvidia temp: 34 C 
           Fan Speeds (RPM): N/A gpu: nvidia fan: 36% 
Info:      Processes: 425 Uptime: 1h 05m Memory: 15.64 GiB used: 6.32 GiB (40.4%) Init: systemd v: 242 Compilers: 
           gcc: 9.2.0 alt: 8 Shell: bash v: 5.0.11 running in: deepin-terminal inxi: 3.0.37 

HUD flickers on Dota 2 (Arch Linux)

I load the HUD via Steam launch options: MANGOHUD=1 %command% -vulkan
The HUD loads, but flickers constantly, I do not have the lib32 version installed anymore.

Issue with installing MangoHud

I followed your install instruction, but ./build.sh install ends up with this error message:

In file included from ../../src/mesa/util/hash_table.c:50:
../../src/mesa/util/../main/hash.h:36:10: fatal error: GL/gl.h: No such file or directory
   36 | #include <GL/gl.h>
      |          ^~~~~~~~~
compilation terminated.
[6/8] Compiling C++ object 'src/25a6634@@MangoHud@sha/cpu.cpp.o'.
ninja: build stopped: subcommand failed.

I use Kubuntu 19.10

hotkey ignores #comment

### Change toggle keybinds for the hud & logging
# toggle_hud=F12
# toggle_logging=F2

F12 is default screenshot button.
pressing F12 still toggles the hud on and off....
setting =0 does disable it

toggle_hud=0
toggle_logging=0

i have by default to hide the hud.

### Disable / hide the hud by deafult
no_display

HUD displayed by default, and incorrectly on SteamPlay games

When MangoHUD is being installed into the system, games running with SteamPlay will display dxvk hud by default. If you add MANGOHUD=1, then both huds are displayed at the same time.

HOW TO REPRODUCE

  • Open Steam for Linux, and enable SteamPlay.
  • Install Quake Champions, or any other DXVK game.
  • Open the game
    2
    If you add the env var MONGOHUD=1, it will show both HUDS at the same time.
    3

WHAT WORKS FINE
Running the game with wine and steam for windows and adding the env var MONGOHUD=1.
1

"Logging" label position needs to be based on the hud position

Currently, the label seems to be hardcoded to be at the top right. However, if you move the hud with MANGOHUD_CONFIG to the top right, it will mask the label.

A solution is to move the label at the opposite of where the hud is:

  • If the hud is top left, display it top right and vice-versa.
  • If the hud is bottom left , display it bottom right and vice-versa.

Installing the package "vulkan-headers" required on Arch

I needed to install the package "vulkan-headers" to get the hud working on Arch. Without it games seemed to freeze early in the starting process if the hud was enabled.

It's not one of the dependencies build.sh checks for, but I noticed the build process tries to compile it, so I assume it not being in the dependencies is intentional.

It looks like the compilation of it fails though, hence why installing the package was needed.
Here's what seems to be the relevant error:

Cloning into '/home/sasamus/Downloads/Temporary/MangoHud/build/meson32/modules/Vulkan-Headers'... [22/25] Compiling C++ object 'src/25a6634@@MangoHud@sha/overlay.cpp.o'. ../../src/overlay.cpp: In function ‘void init_gpu_stats(device_data*)’: ../../src/overlay.cpp:794:26: warning: unused variable ‘instance_data’ [-Wunused-variable] 794 | struct instance_data *instance_data = device_data->instance; |

I don't know if installing the package is a better solution than compiling it, but at least it seems to work fine for me.

This was tested with the latest master, which is at this commit as of writing this.

Getting NVIDIA Xid error on Skyrim Special Edition when 'gpu_timing' is enabled

My info:

CPU: Intel i5 3570k
GPU: NVIDIA GTX 660
RAM: 8 GB

Software:

NVIDIA Driver: 440.59
MangoHud: v0.2.0
Runtime: Flatpak
Steam: Beta Update (Feb 18, 2020)
Proton: 5.0-2

Launch options for Skyrim Special Edition:

PROTON_LOG=1 MANGOHUD=1 MANGOHUD_CONFIG=gpu_timing WINEDLLOVERRIDES="xaudio2_7=n,b" %command%

This is the Xid message that pops up in dmesg after you click the PLAY button in the game's launcher:

[ 3252.896909] NVRM: Xid (PCI:0000:01:00): 32, pid=16176, Channel ID 00000055 intr1 00000008 HCE_DBG0 00000110 HCE_DBG1 00000000

This crash also occurs if I set MANGOHUD_CONFIG=full instead, but after narrowing them down, I found out that the option crashing the game is gpu_timing.

The proton log file shows the following message too, which is probably the root cause:

[...]
Command buffer submitted multiple times before present.
This could lead to invalid data.
[...]

Full log file: steam-489830.log

MangoHud doesn't work on Kubuntu 19.10

I installed MangoHud on Kubuntu 19.10, and I checked to see if it is installed successfully, and I found these files:
~/.local/share/MangoHud/libMangoHud.so
~/.local/share/vulkan/implicit_layer.d/mangohud32.json
~/.local/share/vulkan/implicit_layer.d/mangohud64.json

but I can't find the file libMangoHud32.so, I don't know if this is related to Ubuntu dropping the support for 32bit packages from Ubuntu starting from version 19.10, or not.

Anyway, trying to run any 64bit game with MANGOHUD=1 freeze the game during loading, and I had to kill the game, otherwise, it will load forever.

Enable CPU load at log files

Hello,

As I can see by benchmarks by @flightlessmango, it's possible to log CPU load, as by this results for instance: https://flightlessmango.com/benchmarks/phA-M1biogE

However, the build I'm currently using (and, AFAIK, other users as well, given their results) this data is not write on log files, possible related to this line: https://github.com/flightlessmango/MangoHud/blob/master/src/logging.h#L54

It would be possible to enable this for all users? Is there any motivation in disabling this feature by default?

Thanks!

Consider using libXNVCtrl instead of NVML?

Hello,

I don't know if this happens only in older GPUs from NVIDIA, but MangoHud can't report GPU usage properly at all.

That's because nvmlDeviceGetUtilizationRates() currently returns NVML_ERROR_NOT_SUPPORTED on my GTX 660. It's also observable when using nvidia-smi:

$ nvidia-smi --query-gpu=utilization.gpu --format=csv,noheader
[Not Supported]

Which I find weird, because the documentation for that function clearly states:

Description
Retrieves the current utilization rates for the device's major subsystems.

FERMI_OR_NEWER%

Well, the GTX 660 has a Kepler-based architecture, which is the successor of Fermi, so it should be working...

Not everything is lost, though. The nvidia-settings utility is able to actually report GPU usage (percentage):

$ nvidia-settings -tq '[gpu:0]/GPUUtilization'
graphics=8, memory=4, video=0, PCIe=0

Of course it's not ideal for MangoHud to keep calling nvidia-settings to query these values. For that, there is a C library called libXNVCtrl, developed by NVIDIA:

https://github.com/NVIDIA/nvidia-settings/tree/master/src/libXNVCtrl

Sample codes are available as well:

https://github.com/NVIDIA/nvidia-settings/tree/master/samples

P.S.: I'm not entirely sure if libXNVCtrl could fully replace all the NVML bits you guys are using, but it's definitely worth taking a look.

Thanks!

Is it posible to display just time?

That's how I used MSI Afterbunrer years ago on Windows.

Currently the HUD will still show renderer (DXVK and its version, for instance), FPS / frametime.

VRAM not showing

I tried to make vram and ram show into the hud, but apparently it doesn't work on my system. The configuration is read (as you can see, no frame_timing and additional core_load) but ram and vram is ignored. Is there a way to get an output on why that is? Like, a log or something? I guess it simply can't find where to look for.

Here are my launch options:

MANGOHUD_CONFIG=cpu_temp,gpu_temp,core_load,ram,vram,frame_timing=0 MANGOHUD=1 gamemoderun %command%

(Removing gamemoderun didn't change anything, so that's not the issue)

I'm using manjaro (latest version) with an RX580 with the latest mesa-version.

Screenshot

Elementary OS

So I am using elementary os (hera) and when I try and install mangoHUD it says

# Checking Dependencies

Unable to find distro information!

Attempting to build regardless

./build.sh: line 112: meson: command not found
./build.sh: line 119: meson: command not found
./build.sh: line 127: ninja: command not found
./build.sh: line 128: ninja: command not found
cp: cannot stat 'build/release/usr/lib32/libMangoHud.so': No such file or directory
cp: cannot stat 'build/release/usr/lib64/libMangoHud.so': No such file or directory
cp: cannot stat 'build/release/usr/share/vulkan/implicit_layer.d/mangohud.json': No such file or directory
cp: cannot stat 'build/release/usr/share/vulkan/implicit_layer.d/mangohud.json': No such file or directory
sed: can't read build/package/MangoHud/.local/share/vulkan/implicit_layer.d/mangohud32.json: No such file or directory
sed: can't read /home/user/.local/share/vulkan/implicit_layer.d/mangohud32.json: No such file or directory
sed: can't read /home/user/.local/share/vulkan/implicit_layer.d/mangohud64.json: No such file or directory

So it is not working and I am not sure what the dependncies are so I cant install them manually. How could I find that info?

Parameter to enable all hud elements

First of all thank you for the hard work!

In DXVK DXVK_HUD=full enables all avaliable hud elements.

It would be great to have the same parameter in MangoHud

MangoHUD does not work on ZorinOS 15.1

Hello, how are you? First of all I would like to congratulate you for the work and I hope it will evolve even more and thus be a reference in the Linux world.

Well, I'm an editor on the Brazilian blog Diolinux and through the GamingOnLinux blog, I saw your tool and found it interesting and went to test it. But unfortunately on ZorinOS 15.1 Core (Gnome) and Lite (XFCE), MangoHUD is not working, I ran both the .sh script and tried to compile it and it was not. In theory ZorinOS uses the Ubuntu 18.04 base, and in some packages it can use the 18.04.1 base or the 18.04.3 base. I also saw that the meson is in version 0.47. I have a hybrid laptop from Dell (Intel + Nvidia), with a GTX 960M and using the 440.44 drivers. I wonder if you have any procedure to do or something like that. I am available to help.

Att
Ricardo

MangoHud incompatible with EA Origin

No matter what I do, on multiple different Wineprefixes for different games I have installed on EA Origin, MangoHud crashes Origin immediately after the window opens. The HUD shows up for a moment, the little thing starts spinning, and then it freezes, crashes, and the "Origin has experienced a problem and must close" window pops up, no matter what. I've tried it with both a manually-built install and just a release download install, on separate Wineprefixes with separate Origin installs for Jedi Fallen Order, Titanfall 2, and Battlefield V. None of them seem to work, and I didn't see an issue on the issues threads. Also, while typing this, I figured I'd try the AUR packages, and still got the same result.
Distribution: Arch Linux
Kernel: 5.6.0-rc1-1-tkg-pds
mesa: mesa-tkg-git-20.1.0_devel

yay -Q | grep -ie vulkan -ie mesa
lib32-mesa-demos 8.4.0-1
lib32-mesa-tkg-git 20.1.0_devel.120191.a603822b2fc-1
lib32-vulkan-icd-loader 1.2.132-1
mesa-demos 8.4.0-2
mesa-tkg-git 20.1.0_devel.120191.a603822b2fc-1
vulkan-caps-viewer 2.03-2
vulkan-headers 1:1.2.132-1
vulkan-html-docs 1:1.2.132-1
vulkan-icd-loader 1.2.132-1
vulkan-tools 1.2.131.1-1

New Feature: Show currently used driver

Hi,

it would be really nice if mangohud could show the currently in use driver.
This is handy especially for amd with the 3 different vulkan drivers, so that you can verify which one is in use atm.

Many thx,
Christian

Deb/PPA packaging?

Any chance we could see this with a DEB packaging for releases or perhaps a PPA? :)

How to change hotkeys?

How do you change the hotkeys such as F12 and F2? For me F12 is not very convenient because it conflicts with Yakuake.

MPV segmentation fault

0x00007fffc8fa8154 in overlay_CreateInstance(VkInstanceCreateInfo const*, VkAllocationCallbacks const*, VkInstance_T**) () from /home/catbox/.local/share/MangoHud/libMangoHud.so
(gdb) quit

checked with

gdb mpv

using mpv.conf

hwdec=vo_gpu
vo=gpu
# VULKAN
gpu-context=x11vk
gpu-api=vulkan
spirv-compiler=auto

this is my MangoHud.conf

### MangoHud configuration file
### Uncomment any options you wish to enable. Default options are left uncommented
### Use some_parameter=0 to disable a parameter (only works with on/off parameters)
### Everything below can be used / overridden with the environment variable MANGOHUD_CONFIG instead

### MANGOHUD=1 %command%

################ PERFORMANCE #################

### Limit the application FPS
fps_limit=60

### VSYNC [0-3] 0 = adaptive; 1 = off; 2 = mailbox; 3 = on
vsync=1

################### VISUAL ###################

### Display the current CPU information
cpu_stats
cpu_temp

### Display the current GPU information
gpu_stats
gpu_temp

### Display the frametime line graph
frame_timing=0

### Display the current system time
# time

### Change the hud font size (default is 24)
font_size=12

### Change the hud position (default is top-left)
position=top-left

### Display the current CPU load & frequency for each core
# core_load

### Display system ram / vram usage
ram
vram

### Disable / hide the hud by deafult
no_display

### Hud position offset
offset_x=0
offset_y=16

### Hud dimensions
width=133
height=69

### Hud transparency / alpha
background_alpha=0.01

### Crosshair overlay (default size is 30)
# crosshair
# crosshair_size=16
# crosshair_color=RRGGBB

################## INTERACTION #################

### Change toggle keybinds for the hud & logging
toggle_hud=F13
toggle_logging=F13
# toggle_hud=F12
# toggle_logging=F2

my ~/.profile

export MANGOHUD=1

mpv version
v0.32.0

vulkanapi version (vulkaninfo)
Vulkan Instance Version: 1.2.131
MangoHud 32/64bit (Vulkan Hud Overlay) Vulkan version 1.1.125

NVIDIA-SMI 440.59

setting MANGOHUD=0 fixes the issue

Issue with VRAM readings

VRAM = 0 all the time, and it doesn't change at all.

System information:
OS: Kubuntu 19.10 - kernel: 5.3.0-29
GPU: AMD Radeon HD 8750M
CPU: Intel core I5 4200M
Driver: Mesa 20-devel (obiaf ppa)

Can't Compile MangoHud

$ ./build.sh install
sed: can't read /home/nutta/.local/share/vulkan/implicit_layer.d/mangohud32.json: No such file or directory
sed: can't read /home/nutta/.local/share/vulkan/implicit_layer.d/mangohud64.json: No such file or directory

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.