dec05eba / gpu-screen-recorder-issues

GPU Screen Recorder issue tracker
13 stars 0 forks source link

[BUG] Seg fault if display is turned off while gpu-screen-recorder is running, continues to segfault after display is turned back on until gpu-screen-recorder is restarted #39

Closed cproo12 closed 1 month ago

cproo12 commented 1 month ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce

  1. Run gpu-screen-recorder (running as a service in systemctl to record last 60 seconds when hotkey is pressed)
  2. Turn off display
  3. Turn display back on
  4. Should segfault every so often

Desktop (please complete the following information):

Additional context Add any other context about the problem here, such as terminal output of running GPU Screen Recorder and if the issue isn't related to audio then please run sudo drm_info > log.txt and attach that log.txt file in this bug report. drm_info.txt

I am not sure drm_info will show you the info you are looking for, so here is the output of sudo dmesg (where I discovered the source of the random freezing problem) dmesg.txt

Does the issue also happen if you use obs studio instead with equivalent settings (video encoding settings and audio codec settings. Nvenc on nvidia and vaapi on amd/intel and same video/audio codec)? Not sure how I would test this- so no.

dec05eba commented 1 month ago

Have you followed the section here https://git.dec05eba.com/gpu-screen-recorder/about/ about cuda? there is a cuda bug in nvidia drivers:

Nvidia drivers have an issue where CUDA breaks if CUDA is running when suspend/hibernation happens, and it remains broken until you reload the nvidia driver. To fix this, either disable suspend or tell the NVIDIA driver to preserve video memory on suspend/hibernate by using the NVreg_PreserveVideoMemoryAllocations=1 option. You can run sudo extra/install_preserve_video_memory.sh to automatically add that option to your system.

Or is this specifically about turning off the monitor physically and nothing to do with suspend?

cproo12 commented 1 month ago

My apologies. I have definitely read that and I guess I didn't think that was the issue I am having.

I have no idea what suspend is, when I'm done using my computer I just turn on the display- no clue if that is "suspending" my system or not.

Sorry for being the kind of arch linux user that isn't knowledgable enough to be using arch linux... I just downloaded the script and gsr-nvidia.conf and installed that. I will update this issue if it fixes it. Guessing it is going to.

By the way- thanks heaps for your great program. One of my main concerns about switching to linux 4 years ago was the lack of shadowplay, windows game bar, or whatever- but this is soooo much better than anything even offered on windows!!

dec05eba commented 1 month ago

Remember to reboot your computer after installing that gsr-nvidia.conf. It's not guaranteed to be the issue you are seeing but it likely is. Since nvidia doesn't seem to care about fixing this issue this issue will only be "fixed" when gpu screen recorder gets support for vulkan video encoding instead of nvenc, which will happen when ffmpeg gets support for vulkan video encoding. I think some distros enable this suspend fix by default now since it also breaks wayland.

If this fixes the issue for you then i'll make the aur package automatically install the gsr-nvidia.conf file. I think I did that long ago but removed it for some reason.

dec05eba commented 1 month ago

@cproo12 has any issue occured related to this after setting gsr-nvidia.conf up (that file is also installed in the aur package now)?

cproo12 commented 1 month ago

I'm sorry, I forgot to reply as I've been travelling.

Yes, it seems to have been fixed :) Thank you so much!