nvLock: client timed out, taking the lock

I recently installed Compton. When I open 1080p videos in mpv w/ VDPAU relatively quickly (about 4 per minute, I would guess), I get this error message in my system log:

nvLock: client timed out, taking the lock

and mpv locks on the first frame. The entire X server locks momentarily, and then I can start a console and kill mpv with pkill -9 mpv. This happens for probably 20-30 seconds after the last successful video play or until I kill compton.

Someone has mentioned that this may be indicative of a video memory issue. Should I tweak compton to not use as much memory, or to use memory differently? Sometimes, but not always, this system is also accompanied by Xorg errors.

Using nvidia 334.21, Linux 3.13.5, and 01:00.0 VGA compatible controller: NVIDIA Corporation GK104 [GeForce GTX 670] (rev a1).

Same problem Ubuntu 19.04

Fakhamati, please don’t necrobump, check if this applies, test the work around:
https://gitlab.gnome.org/GNOME/gnome-shell/issues/1202