From 00556753b19b25ab07114a16a174165c4b18fb8a Mon Sep 17 00:00:00 2001 From: Faalagorn Date: Sun, 29 Nov 2020 17:30:40 +0100 Subject: [PATCH 1/9] README: add info about cpu_power on Intel Added note about RAPL and Intel processors with a way to enable cpu_power on them (on one own's risk) --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 39726e85..4d5527b9 100644 --- a/README.md +++ b/README.md @@ -198,6 +198,8 @@ Example: `MANGOHUD_CONFIG=cpu_temp,gpu_temp,position=top-right,height=500,font_s 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](https://platypusattack.com/). The corresponding `energy_uj` file has to be readable by corrensponding user, e.g. by running `/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. ## Vsync ### OpenGL Vsync - `-1` = Adaptive sync From 1ebb7b1e174b7e1287ff25d1baf1d52c2513b2c1 Mon Sep 17 00:00:00 2001 From: Faalagorn Date: Sun, 29 Nov 2020 18:15:56 +0100 Subject: [PATCH 2/9] ManoguHud.conf: add some parameters and fix typos * Added (commented out `fps_sampling_period`, `version` and `engine_version`) * Commented out `legacy_layout` by default and added `=false` if one want to enable new layout * Unified VSync, FPS, RAM and other minor names while at it * Added space after comments sign for options that were missing it to unify formatting --- bin/MangoHud.conf | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/bin/MangoHud.conf b/bin/MangoHud.conf index 94eb5f9a..b8d27261 100644 --- a/bin/MangoHud.conf +++ b/bin/MangoHud.conf @@ -5,19 +5,19 @@ ################ PERFORMANCE ################# -### Limit the application FPS. Comma-separated list of one or more FPS values (e.g. 0,30,60). 0 means unlimited (unless v-synced). +### Limit the application FPS. Comma-separated list of one or more FPS values (e.g. 0,30,60). 0 means unlimited (unless VSynced). # fps_limit= -### VSYNC [0-3] 0 = adaptive; 1 = off; 2 = mailbox; 3 = on +### VSync [0-3] 0 = adaptive; 1 = off; 2 = mailbox; 3 = on # vsync= -### OpenGL VSYNC [0-N] 0 = off; >=1 = wait for N v-blanks, N > 1 acts as a fps limiter (fps = display refresh rate / N) +### OpenGL VSync [0-N] 0 = off; >=1 = wait for N v-blanks, N > 1 acts as a FPS limiter (FPS = display refresh rate / N) # gl_vsync= ################### VISUAL ################### -### Legacy Layout -legacy_layout +### Legacy layout +# legacy_layout = false ### Display the current CPU information cpu_stats @@ -44,6 +44,7 @@ gpu_stats ### Display FPS and frametime fps +# fps_sampling_period= frametime ### Display loaded MangoHud architecture @@ -59,7 +60,7 @@ frame_timing ### Time formatting examples # time_format = %H:%M # time_format = [ %T %F ] -# time_format = %X # locally formatted time, because of limited glyph range, missing characters may show as '?' (e.g. japanese) +# time_format = %X # locally formatted time, because of limited glyph range, missing characters may show as '?' (e.g. Japanese) ### Change the hud font size (default is 24) font_size=24 @@ -91,11 +92,13 @@ position=top-left # io_write # io_stats -### Display system ram / vram usage +### Display system RAM / VRAM usage # ram # vram -### Display Wine version +### Display MangoHud, engine or Wine version +# version +# engine_version # wine ### Disable / hide the hud by deafult @@ -138,25 +141,25 @@ background_alpha=0.5 # pci_dev = 0:0a:0.0 ### Blacklist -#blacklist = +# blacklist = ################## INTERACTION ################# ### Change toggle keybinds for the hud & logging -#toggle_hud=Shift_R+F12 -#toggle_fps_limit=Shift_L+F1 -#toggle_logging=Shift_L+F2 -#reload_cfg=Shift_L+F4 -#upload_log=Shift_L+F3 +# toggle_hud=Shift_R+F12 +# toggle_fps_limit=Shift_L+F1 +# toggle_logging=Shift_L+F2 +# reload_cfg=Shift_L+F4 +# upload_log=Shift_L+F3 ################## LOG ################# ### Automatically start the log after X seconds # autostart_log = 1 -### Set amount of time in second that the logging will run for +### Set amount of time in seconds that the logging will run for # log_duration -### Set location of the output files (Required for logging) +### Set location of the output files (required for logging) # output_folder = /home//mangologs -### Permit uploading logs directly to Flightlessmango.com +### Permit uploading logs directly to FlightlessMango.com # permit_upload=1 ### Define a '+'-separated list of percentiles shown in the benchmark results. ### Use "AVG" to get a mean average. Default percentiles are 97+AVG+1+0.1 From a1014aa1e740ca66065dbcba54f0c4917ddf8a5f Mon Sep 17 00:00:00 2001 From: Faalagorn Date: Sun, 29 Nov 2020 19:50:54 +0100 Subject: [PATCH 3/9] README: add chmod for RAPL instructions Forgot to add `chmod o+r` to set attributes --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4d5527b9..04304488 100644 --- a/README.md +++ b/README.md @@ -199,7 +199,7 @@ Because comma is also used as option delimiter and needs to be escaped for value 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](https://platypusattack.com/). The corresponding `energy_uj` file has to be readable by corrensponding user, e.g. by running `/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: 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](https://platypusattack.com/). The corresponding `energy_uj` file has to be readable by corrensponding 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. ## Vsync ### OpenGL Vsync - `-1` = Adaptive sync From 6a1028b17e163ca814951427617575a74bc4b10f Mon Sep 17 00:00:00 2001 From: Witold Baryluk Date: Mon, 7 Dec 2020 19:22:36 +0000 Subject: [PATCH 4/9] Fix some MESA inherited references in overlay params MANGOHUD_CONFIG as used. MANGOHUD printf prefix. --- src/overlay_params.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/overlay_params.cpp b/src/overlay_params.cpp index e1435229..f125fc3c 100644 --- a/src/overlay_params.cpp +++ b/src/overlay_params.cpp @@ -401,7 +401,7 @@ parse_font_glyph_ranges(const char *str) static bool parse_help(const char *str) { - fprintf(stderr, "Layer params using VK_LAYER_MESA_OVERLAY_CONFIG=\n"); + fprintf(stderr, "Layer params using MANGOHUD_CONFIG=\n"); #define OVERLAY_PARAM_BOOL(name) \ fprintf(stderr, "\t%s=0|1\n", #name); #define OVERLAY_PARAM_CUSTOM(name) @@ -455,7 +455,7 @@ parse_string(const char *s, char *out_param, char *out_value) } if (*s && !i) { - fprintf(stderr, "mesa-overlay: syntax error: unexpected '%c' (%i) while " + fprintf(stderr, "MANGOHUD: syntax error: unexpected '%c' (%i) while " "parsing a string\n", *s, *s); fflush(stderr); } From fa433cb798299ffcaeeb25adb13157c4383937c7 Mon Sep 17 00:00:00 2001 From: AlexxandreFS Date: Tue, 8 Dec 2020 04:33:10 +0000 Subject: [PATCH 5/9] fix: cut --output-delimiter --- src/vulkan.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vulkan.cpp b/src/vulkan.cpp index a7d78652..89f8b352 100644 --- a/src/vulkan.cpp +++ b/src/vulkan.cpp @@ -608,7 +608,7 @@ void init_system_info(){ trim(os); gpu = exec("lspci | grep VGA | head -n1 | awk -vRS=']' -vFS='[' '{print $2}' | sed '/^$/d' | tail -n1"); trim(gpu); - driver = exec("glxinfo | grep 'OpenGL version' | sed 's/^.*: //' | cut -d' ' --output-delimiter=$'\n' -f1- | grep -v '(' | grep -v ')' | tr '\n' ' ' | cut -c 1-"); + driver = exec("glxinfo | grep 'OpenGL version' | sed 's/^.*: //' | tr -s ' ' '\n' | grep -v '(' | grep -v ')' | tr '\n' ' ' | cut -c 1-"); trim(driver); // Get WINE version From c16332eddf8373bc27e40b02d45a8c3b24773912 Mon Sep 17 00:00:00 2001 From: Alessandro Toia Date: Sat, 12 Dec 2020 19:47:30 -0800 Subject: [PATCH 6/9] Less tr and grep to find driver version --- src/vulkan.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vulkan.cpp b/src/vulkan.cpp index 89f8b352..2bb55c0a 100644 --- a/src/vulkan.cpp +++ b/src/vulkan.cpp @@ -608,7 +608,7 @@ void init_system_info(){ trim(os); gpu = exec("lspci | grep VGA | head -n1 | awk -vRS=']' -vFS='[' '{print $2}' | sed '/^$/d' | tail -n1"); trim(gpu); - driver = exec("glxinfo | grep 'OpenGL version' | sed 's/^.*: //' | tr -s ' ' '\n' | grep -v '(' | grep -v ')' | tr '\n' ' ' | cut -c 1-"); + driver = exec ("glxinfo | grep 'OpenGL version' |sed 's/^.*: //' | sed 's/([^()]*)//g' | tr -s ' '"); trim(driver); // Get WINE version From 0a29c7369a4c6be050f5eea7425d335a314305f2 Mon Sep 17 00:00:00 2001 From: Aidan Harris Date: Sun, 27 Dec 2020 20:55:26 +0000 Subject: [PATCH 7/9] Explicitly test for the mako python module Some distros (Gentoo) support multiple versions of python3 and mako may not be built for all of the implementations. Testing for the module early will make sure meson bails out if the module cannot be found. --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 42808573..f3a196d6 100644 --- a/meson.build +++ b/meson.build @@ -7,7 +7,7 @@ project('MangoHud', cc = meson.get_compiler('c') cpp = meson.get_compiler('cpp') -prog_python = import('python').find_installation('python3') +prog_python = import('python').find_installation('python3', modules: ['mako']) null_dep = dependency('', required : false) mangohud_version = vcs_tag( From d4b8f5f519f8180fe7175aa57d6f5143fe793450 Mon Sep 17 00:00:00 2001 From: Witold Baryluk Date: Sat, 23 Jan 2021 19:33:45 +0000 Subject: [PATCH 8/9] Search whole PATH for glslangValidator from system This is more robust and correct way do to it. --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 5bca4d7c..db9bac55 100755 --- a/build.sh +++ b/build.sh @@ -78,7 +78,7 @@ dependencies() { if [[ $(pip3 show meson; echo $?) == 1 || $(pip3 show mako; echo $?) == 1 ]]; then $SU_CMD pip3 install 'meson>=0.54' mako fi - if [[ ! -f /usr/local/bin/glslangValidator ]]; then + if ! which glslangValidator >/dev/null; then wget https://github.com/KhronosGroup/glslang/releases/download/SDK-candidate-26-Jul-2020/glslang-master-linux-Release.zip unzip glslang-master-linux-Release.zip bin/glslangValidator $SU_CMD install -m755 bin/glslangValidator /usr/local/bin/ From 2bbb7174e385d711d5731012705d2438af7d634d Mon Sep 17 00:00:00 2001 From: freddii Date: Wed, 3 Feb 2021 02:33:03 +0100 Subject: [PATCH 9/9] fixed typos --- README.md | 2 +- bin/MangoHud.conf | 2 +- bin/mangohud.in | 2 +- bin/run-mangohud-gl-pkg.sh | 2 +- bin/run-mangohud-gl.sh | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 04304488..45f7d2b7 100644 --- a/README.md +++ b/README.md @@ -199,7 +199,7 @@ Because comma is also used as option delimiter and needs to be escaped for value 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](https://platypusattack.com/). The corresponding `energy_uj` file has to be readable by corrensponding 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: 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](https://platypusattack.com/). 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. ## Vsync ### OpenGL Vsync - `-1` = Adaptive sync diff --git a/bin/MangoHud.conf b/bin/MangoHud.conf index b8d27261..3efc9ef3 100644 --- a/bin/MangoHud.conf +++ b/bin/MangoHud.conf @@ -101,7 +101,7 @@ position=top-left # engine_version # wine -### Disable / hide the hud by deafult +### Disable / hide the hud by default # no_display ### Hud position offset diff --git a/bin/mangohud.in b/bin/mangohud.in index eadce2d2..8ec21de9 100755 --- a/bin/mangohud.in +++ b/bin/mangohud.in @@ -19,7 +19,7 @@ if [ "$MANGOHUD_DLSYM" = "1" ]; then MANGOHUD_LIB_NAME="@ld_libdir_mangohud_abs@libMangoHud_dlsym.so:${MANGOHUD_LIB_NAME}" fi -# Preload using the plain filesnames of the libs, the dynamic linker will +# Preload using the plain filenames of the libs, the dynamic linker will # figure out whether the 32 or 64 bit version should be used, and will search # for it in the correct directory LD_PRELOAD="${LD_PRELOAD}:${MANGOHUD_LIB_NAME}" diff --git a/bin/run-mangohud-gl-pkg.sh b/bin/run-mangohud-gl-pkg.sh index b8702593..a09ac514 100755 --- a/bin/run-mangohud-gl-pkg.sh +++ b/bin/run-mangohud-gl-pkg.sh @@ -14,7 +14,7 @@ if [ "$#" -eq 0 ]; then fi # Execute the program under a clean environment -# pass through the overriden LD_PRELOAD environment variables +# pass through the overridden LD_PRELOAD environment variables LD_PRELOAD="${LD_PRELOAD}:${MANGOHUD_LIB_NAME}" exec env MANGOHUD=1 LD_PRELOAD="${LD_PRELOAD}" "$@" diff --git a/bin/run-mangohud-gl.sh b/bin/run-mangohud-gl.sh index 3cd7ebc2..6abb1f9a 100755 --- a/bin/run-mangohud-gl.sh +++ b/bin/run-mangohud-gl.sh @@ -15,7 +15,7 @@ if [ "$#" -eq 0 ]; then fi # Execute the program under a clean environment -# pass through the overriden LD_PRELOAD environment variables +# pass through the overridden LD_PRELOAD environment variables LD_PRELOAD="${LD_PRELOAD}:${MANGOHUD_LIB_NAME}" LD_LIBRARY_PATH="${XDG_DATA_HOME}/MangoHud"