Skip to main content
Topic: screensharing makes games unplayable (Read 452 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

screensharing makes games unplayable

Hi, I have an Artix dinit system running KDE plasma wayland on an AMD cpu and Nvidia gpu.
Whenever I try to screenshare a game, whether it be through one of the discord clients that support wayland screensharing like vesktop, or screensharing through firefox using discord on web, the game I screenshare becomes completely unplayable. Screensharing will cause the game to stutter like crazy, for every ~0.3 seconds of it running fine it will freeze for around ~1-2 seconds. I have noticed that for some reason this only happens if the game is the focused application and is running in fullscreen. If I continue to screenshare and simply alt-tab to focus on a different window, the game stops stuttering. If I make the game windowed, it stops stuttering. If I run the game under gamescope, it stops stuttering. I really have no clue what could be causing this, any help would be appreciated!

Re: screensharing makes games unplayable

Reply #1
could you provide some more basic info? what gpu? driver version? kernel version and params? pure gayland or xgayland app? do you have nvidia modules preloaded?
cat /etc/modprobe.d/nvidia.conf (or at least a file that modifies nvidia NVReg parameters) vs cat /proc/driver/nvidia/params?

Re: screensharing makes games unplayable

Reply #2
could you provide some more basic info? what gpu? driver version? kernel version and params? pure gayland or xgayland app? do you have nvidia modules preloaded?
cat /etc/modprobe.d/nvidia.conf (or at least a file that modifies nvidia NVReg parameters) vs cat /proc/driver/nvidia/params?


My gpu is the 4080, on driver nvidia-open-dkms version 565.57.01-1

kernel is 6.11.7-artix1-1 with parameters of
Code: [Select]
BOOT_IMAGE=/boot/vmlinuz-linux root=UUID=e7fd22c2-4c03-492f-8f1b-f7db6fce0506 rw net.ifnames=0 quiet amd_iommu=on iommu=pt nvidia-drm.modeset=1 nvidia-drm.fbdev=1

application doing the screensharing is native wayland and application being screenshared I would assume is running under xwayland, thats the standard for basically every game isn't it?

I have this in my /etc/mkinitcpio.conf to preload the nvidia stuff
Code: [Select]
MODULES=(nvidia nvidia_modeset nvidia_uvm nvidia_drm)

Re: screensharing makes games unplayable

Reply #3
Code: [Select]
amd_iommu=on iommu=pt
This is enabled by default on any ryzen platform, so it's redundant.
You didn't provided:
cat /proc/driver/nvidia/params
and I assume you don't have anything nvidia related in /etc/modprobe.d/?
If you run pure wayland, you should route every game through valve's gamescope compositor.

Re: screensharing makes games unplayable

Reply #4
Code: [Select]
amd_iommu=on iommu=pt
This is enabled by default on any ryzen platform, so it's redundant.
You didn't provided:
cat /proc/driver/nvidia/params
and I assume you don't have anything nvidia related in /etc/modprobe.d/?
If you run pure wayland, you should route every game through valve's gamescope compositor.
cat /proc/driver/nvidia/params
Code: [Select]
ResmanDebugLevel: 4294967295
RmLogonRC: 1
ModifyDeviceFiles: 1
DeviceFileUID: 0
DeviceFileGID: 0
DeviceFileMode: 438
InitializeSystemMemoryAllocations: 1
UsePageAttributeTable: 4294967295
EnableMSI: 1
EnablePCIeGen3: 0
MemoryPoolSize: 0
KMallocHeapMaxSize: 0
VMallocHeapMaxSize: 0
IgnoreMMIOCheck: 0
TCEBypassMode: 0
EnableStreamMemOPs: 0
EnableUserNUMAManagement: 1
NvLinkDisable: 0
RmProfilingAdminOnly: 1
PreserveVideoMemoryAllocations: 1
EnableS0ixPowerManagement: 0
S0ixPowerManagementVideoMemoryThreshold: 256
DynamicPowerManagement: 3
DynamicPowerManagementVideoMemoryThreshold: 200
RegisterPCIDriver: 1
EnablePCIERelaxedOrderingMode: 0
EnableResizableBar: 0
EnableGpuFirmware: 18
EnableGpuFirmwareLogs: 2
RmNvlinkBandwidthLinkCount: 0
EnableDbgBreakpoint: 0
OpenRmEnableUnsupportedGpus: 1
DmaRemapPeerMmio: 1
ImexChannelCount: 2048
CreateImexChannel0: 0
RegistryDwords: ""
RegistryDwordsPerDevice: ""
RmMsg: ""
GpuBlacklist: ""
TemporaryFilePath: "/var/tmp"
ExcludedGpus: ""

yes, /etc/modprobe.d/ is completely empty.

I would like this issue fixed without having to use gamescope since when I don't screenshare games work perfectly fine without gamescope and I get around a 20% performance loss when using gamescope.

Re: screensharing makes games unplayable

Reply #5
Hmmm, at this point this seems like more of an GSP <-> nvidia-open issue, could you try installing full proprietary package and disable GSP by creating a file:
Code: [Select]
# /etc/modprobe.d/nvidia.conf
# https://download.nvidia.com/XFree86/Linux-x86_64/565.57.01/README/gsp.html
options nvidia NVreg_EnableGpuFirmware=0
It's just for a test if it changes anything, you can switch back to nvidia-open and delete that file, because that'd mean it's just wayland shenanigans, and if it is actually a wayland issue then I'm out of ideas...

Also I'm not sure what 18 as a value means here, and from the what I got on reddit it seems like it forces GSP firmware to be always active in this mode on nvidia-open, so that's why I recommend trying going with nvidia-dkms instead.

Marking this one as offtopic, because it's performance related and just what I noticed on my GTX 1060:
Spoiler (click to show/hide)

 

Re: screensharing makes games unplayable

Reply #6
Hmmm, at this point this seems like more of an GSP <-> nvidia-open issue, could you try installing full proprietary package and disable GSP by creating a file:
Code: [Select]
# /etc/modprobe.d/nvidia.conf
# https://download.nvidia.com/XFree86/Linux-x86_64/565.57.01/README/gsp.html
options nvidia NVreg_EnableGpuFirmware=0
It's just for a test if it changes anything, you can switch back to nvidia-open and delete that file, because that'd mean it's just wayland shenanigans, and if it is actually a wayland issue then I'm out of ideas...

Also I'm not sure what 18 as a value means here, and from the what I got on reddit it seems like it forces GSP firmware to be always active in this mode on nvidia-open, so that's why I recommend trying going with nvidia-dkms instead.

Marking this one as offtopic, because it's performance related and just what I noticed on my GTX 1060:
Spoiler (click to show/hide)

I swapped to nvidia-dkms instead of nvidia-open-dkms and added the nvidia.conf file with "options nvidia NVreg_EnableGpuFirmware=0" in the /etc/modprobe.d/ directory and the issue still persists, Thanks for trying at least.