MangoHud icon indicating copy to clipboard operation
MangoHud copied to clipboard

Getting segmentation fault when using with gamescope

Open hartmark opened this issue 3 years ago • 6 comments

I'm using latest from main on arch.

I get segmentation fault when used with gamescope:

% AMD_VULKAN_ICD=RADV gamescope glxgears
No CAP_SYS_NICE, falling back to regular-priority compute and threads.
Performance will be affected.
[2022-08-17 01:15:12.937] [MANGOHUD] [info] [config.cpp:118] skipping config: '/usr/bin/MangoHud.conf' [ not found ]
[2022-08-17 01:15:12.937] [MANGOHUD] [info] [config.cpp:118] skipping config: '/home/markus/.config/MangoHud/gamescope.conf' [ not found ]
[2022-08-17 01:15:12.937] [MANGOHUD] [info] [config.cpp:123] parsing config: '/home/markus/.config/MangoHud/MangoHud.conf'
vulkan: selecting physical device 'AMD RADV VEGA10': queue family 1
vulkan: physical device supports DRM format modifiers
[2022-08-17 01:15:12.998] [MANGOHUD] [error] [file_utils.cpp:43] Error opening directory '/sys/class/drm/card0-HDMI-A-1/device/hwmon/': No such file or directory
[2022-08-17 01:15:12.998] [MANGOHUD] [error] [file_utils.cpp:43] Error opening directory '/sys/class/drm/card0-DVI-D-1/device/hwmon/': No such file or directory
[2022-08-17 01:15:12.998] [MANGOHUD] [error] [file_utils.cpp:43] Error opening directory '/sys/class/drm/card0-DP-2/device/hwmon/': No such file or directory
[2022-08-17 01:15:12.998] [MANGOHUD] [error] [file_utils.cpp:43] Error opening directory '/sys/class/drm/card0-HDMI-A-2/device/hwmon/': No such file or directory
[2022-08-17 01:15:12.998] [MANGOHUD] [info] [overlay.cpp:768] Uploading is disabled (permit_upload = 0)
vulkan: supported DRM formats for sampling usage:
vulkan:   0x34325241
vulkan:   0x34325258
vulkan:   0x3231564E
[1]    5591 segmentation fault (core dumped)  AMD_VULKAN_ICD=RADV gamescope glxgears

gdb trace:

(gdb) bt full
#0  0x00007fffe8dd163a in  () at /usr/lib/libMangoHud.so
#1  0x000055555559bca2 in  ()
#2  0x0000555555587d75 in  ()
#3  0x00005555555604c9 in  ()
#4  0x00007ffff74952d0 in __libc_start_call_main (main=main@entry=0x55555555f190, argc=argc@entry=1, argv=argv@entry=0x7fffffffdbc8) at ../sysdeps/nptl/libc_start_call_main.h:58
        self = <optimized out>
        result = <optimized out>

                      unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140737488346056, -2738145751233012003, 0, 140737488346072, 93824992966616, 140737354125312, 2738145752197947101, 2738127417259908829}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x7fffffffdbc8, 0x1}, data = {prev = 0x0, cleanup = 0x0, canceltype = -9272}}}
        not_first_call = <optimized out>
#5  0x00007ffff749538a in __libc_start_main_impl (main=0x55555555f190, argc=1, argv=0x7fffffffdbc8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffdbb8) at ../csu/libc-start.c:381
#6  0x0000555555563095 in  ()

hartmark avatar Aug 16 '22 23:08 hartmark

use it like thisgamescope -- mangohud glxgears you must have mangohud globally enabled?

MANGOHUD=0 gamescope -- mangohud glxgears

gort818 avatar Aug 17 '22 00:08 gort818

Yes, I'm having it globally enabled.

I'm aware of the workaround but the application should exit with an error instead of segmentation fault if it's not supported.

Also the workaround makes mangohud use opengl instead of vulkan, a subtle difference. The linked issue has another workaround which uses vkbasalt and are successfully working using vulkan.

hartmark avatar Aug 17 '22 06:08 hartmark

It is not a workaround, it is the correct way to use mangohud with gamescope. glxgears is an opengl application, so if it is reporting OpenGL then that is correct.

gort818 avatar Aug 17 '22 14:08 gort818

Alright, then this can be closed if we can live with a segmentation fault instead of an error

hartmark avatar Aug 17 '22 14:08 hartmark

gamescope has an exception for vkBasalt so it won't try to just use compute queues.

jackun avatar Aug 17 '22 21:08 jackun

Aha, so that's the reason I got it working if I used ENABLE_VKBASALT=1

hartmark avatar Aug 17 '22 21:08 hartmark

i do echo $ENABLE_VKBASALT 1 and still got the same error

neondeex avatar Oct 23 '23 13:10 neondeex

and still got the same error

You're not supposed to use mangohud with gamescope. This is what mangoapp is for

flightlessmango avatar Oct 26 '23 00:10 flightlessmango