dec05eba / gpu-screen-recorder-issues

GPU Screen Recorder issue tracker
11 stars 0 forks source link

[BUG] Not all monitors detected on a multi-GPU system. #27

Closed jackmio32 closed 1 month ago

jackmio32 commented 1 month ago

Describe the bug I am running 3 monitors across 2 GPUs. My gaming/main monitor is hooked up to my main GPU, an RX 6800, and my other 2 monitors are hooked up to my secondary GPU, a RX 5500XT. When I run GPU Screen Recorder, it only detects my two monitors on my secondary GPU, and doesn't seem to be aware of my main monitor/GPU at all, as no option for them are shown.

To Reproduce No special run conditions/options, besides being on a multi-monitor multi-GPU system.

Screenshots Screenshot_20240621_160650 Edit: Screenshot did not show the context menu correctly, so I got another one.

Desktop (please complete the following information):

Additional context When ran from a terminal, the only output is amdgpu: amdgpu_cs_ctx_create2 failed. (-13)

dec05eba commented 1 month ago

gpu screen recorder does currently not support selecting which gpu is used, it will select the "default" one and it can only capture monitors that are connected to that gpu. You can try setting this environment variable before you run gpu screen recorder: https://docs.mesa3d.org/envvars.html#envvar-DRI_PRIME to the other gpu (maybe try export DRI_PRIME=1). Also, can your run sudo drm_info > log.txt and upload that file here?

jackmio32 commented 1 month ago

Sorry, here is my log.txt

dec05eba commented 1 month ago

Thanks, can you try that DRI_PRIME environment variable option? I dont have a system with two gpus so I cant test it myself. But I also want to clearify that it's not a bug, it's a missing feature (option) to select which gpu to use, so I'll close this issue but I also want to know if that DRI_PRIME environment variable is a temporary solution that can be used.

jackmio32 commented 1 month ago

I seem to be having other issues pop up. This app seems to be mad at me and refuses to run now, and I'm not sure why. Will do a system reboot to see if it persists, and try again.

dec05eba commented 1 month ago

Run it from the terminal to see if there is any error. But maybe DRI_PRIME option doesn't really work.

jackmio32 commented 1 month ago

Okay, restarted and it runs now, so back at square 1.

Did export DRI_PRIME=1002:73bf (the syntax to specify the vendor and device ID of my main GPU), and now it immediately exits with no output to terminal.

jackmio32 commented 1 month ago

Further tinkering: Running DRI_PRIME=0 causes GPU Screen Recorder to behave like before (only shows outputs from my secondary GPU), and DRI_PRIME=1 causes it to immediately exit with no output to terminal.

dec05eba commented 1 month ago

Can you run eglgears_wayland (part of mesa utils) with DRI_PRIME=1? maybe the option doesn't work at all

jackmio32 commented 1 month ago

It ran, but opened on a monitor connected to my second GPU.

Also, I ran GPU Screen Recorder with sudo -i, and got this as output:

:~$ sudo -i flatpak run com.dec05eba.gpu_screen_recorder 

(gpu-screen-recorder-gtk:2): Gtk-WARNING **: 17:06:12.874: cannot open display: :1
:~$
dec05eba commented 1 month ago

Running gpu screen recorder (gui) as root is not supported and wayland doesn't support running graphical applications as another used (root) anyways. I dont think that warning is related to the failure to run.

dec05eba commented 1 month ago

Can you try running flatpak run --command=gpu-screen-recorder com.dec05eba.gpu_screen_recorder -w screen -f 60 -o video.mp4 instead, with and without DRI_PRIME=1?

jackmio32 commented 1 month ago

I did export DRI_PRIME_DEBUG=1, and it seems its picking the right GPU (based on the vendor:device id matching with what lspci -nn | grep VGA says my main GPU is) when DRI_PRIME=1 is enabled. (Side note: Its DRI_PRIME, not DRM_PRIME)

Can you try running flatpak run --command=gpu-screen-recorder com.dec05eba.gpu_screen_recorder -w screen -f 60 -o video.mp4 instead, with and without DRM_PRIME=1?

No output or video file using DRI_PRIME=1, successfully records one of my second monitors on my second GPU and outputs the video file using DRI_PRIME=

dec05eba commented 1 month ago

Hmm, can you try flatpak run --env=DRI_PRIME=1 --command=gpu-screen-recorder com.dec05eba.gpu_screen_recorder -w screen -f 60 -o video.mp4 instead? and remove the DRI_PRIME=1 that you set before

jackmio32 commented 1 month ago

Still nothing.

dec05eba commented 1 month ago

Alright then I dont know. I guess you will have to wait until I add support for selecting the gpu in gpu screen recorder instead. Unfortunately I dont have a system with two amd gpus so I cant do this right now. Another solution right now would be to use x11 instead and capturing a single window. That should work even if the window (application) is being run on another gpu. Im working on pipewire support as well and in that case capturing any monitor should also work I believe.