From 7e8d6b3f33d7a45caf294cc22fb4cfffa7b09a3a Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 22 Feb 2025 18:51:27 +0100 Subject: Make nvidia-smi run in flatpak on host --- src/egl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/egl.c') diff --git a/src/egl.c b/src/egl.c index e2a0958..d2832f4 100644 --- a/src/egl.c +++ b/src/egl.c @@ -458,7 +458,11 @@ bool gsr_egl_load(gsr_egl *self, gsr_window *window, bool is_monitor_capture, bo if(self->gpu_info.vendor == GSR_GPU_VENDOR_NVIDIA) { /* This fixes nvenc codecs unable to load on openSUSE tumbleweed because of a cuda error. Don't ask me why */ - system("nvidia-smi > /dev/null"); + const bool inside_flatpak = getenv("FLATPAK_ID") != NULL; + if(inside_flatpak) + system("flatpak-spawn --host -- nvidia-smi -f /dev/null"); + else + system("nvidia-smi -f /dev/null"); } return true; -- cgit v1.2.3-70-g09d2