~eliasnaur/gio#214: 
Compute renderer hangs X11 NVIDIA desktop

Launching programs with GIORENDERER=forcecompute on my X11 NVIDIA GNOME desktop causes the entire desktop to hang. Based on what little I can glean in this state by VT switching, it appears that the Xorg server is using 100% of a CPU. It does occasionally draw new frames (perhaps once per 10 seconds or so), so I can eventually kill the program. When I kill the Gio application, performance returns to normal.

Here I have uploaded the output of glxinfo on this system, in the hope that it can help you understand what may or may not be missing here.

I do not get any errors from Gio, and I'm having trouble filtering through various system logs for relevant data. I did find what appears to be an NVIDIA driver crash in dmesg, and I've provided the output here.

Naturally, I'm happy to provide any relevant diagnostic data; just let me know what would be helpful.

My test application is the Gio kitchen example with Gio version gioui.org v0.0.0-20210410094005-495c69018772.

Status
REPORTED
Submitter
~whereswaldon
Assigned to
No-one
Submitted
28 days ago
Updated
18 days ago
Labels
No labels applied.

~eliasnaur 27 days ago*

I happen to be debugging a similar issue on my Intel GPU. The change https://gioui.org/commit/a266052717c3845d fixes one potential cause of GPU hangs. Can you let me know how it fares on your setup?

EDIT: Updated commit hash.

~whereswaldon 25 days ago*

I can resolve that URL, but I can't find that commit in the actual git history at all. I tested against main at gioui.org v0.0.0-20210412115641-3a94f7bf7088 and it still hangs. Here's the error:

panic: glGetError: 0x505

goroutine 19 [running, locked to thread]:
gioui.org/gpu.buildPath(0x69e930, 0xc0001861a0, 0xc000412486, 0x140, 0x2b7a, 0x0, 0x0, 0x0)
	/home/chris/Code/go/pkg/mod/gioui.org@v0.0.0-20210412115641-3a94f7bf7088/gpu/path.go:307 +0xb9
gioui.org/gpu.(*drawOps).collect(0xc00044c040, 0x69e930, 0xc0001861a0, 0xc000194560, 0xc000076460, 0x320, 0x2bc)
	/home/chris/Code/go/pkg/mod/gioui.org@v0.0.0-20210412115641-3a94f7bf7088/gpu/gpu.go:811 +0x31b
gioui.org/gpu.(*compute).Collect(0xc00044c000, 0x320, 0x2bc, 0xc000076460)
	/home/chris/Code/go/pkg/mod/gioui.org@v0.0.0-20210412115641-3a94f7bf7088/gpu/compute.go:263 +0xfa
gioui.org/app.(*renderLoop).renderLoop.func1(0xc0001a0780, 0x69dad8, 0xc000194530, 0xc00022a420)
	/home/chris/Code/go/pkg/mod/gioui.org@v0.0.0-20210412115641-3a94f7bf7088/app/loop.go:91 +0x30f
created by gioui.org/app.(*renderLoop).renderLoop
	/home/chris/Code/go/pkg/mod/gioui.org@v0.0.0-20210412115641-3a94f7bf7088/app/loop.go:61 +0x7f
exit status 2

EDIT: I think this error may have been emitted on stderr the whole time, but after my desktop froze so I couldn't see it. Thank goodness for 2>&1 > file

~eliasnaur 25 days ago

Thanks. git.sr.ht probably garbage collected the commit, and the fix is not on main because i want to verify it. Can you try the compute branch?

~whereswaldon 25 days ago

On the compute branch at gioui.org v0.0.0-20210412203452-8c59aa82afca, I get:

panic: glGetError: 0x505

goroutine 6 [running, locked to thread]:
gioui.org/gpu.buildPath(0x6a1050, 0xc00007a270, 0xc0003de486, 0x140, 0x2b7a, 0x0, 0x0, 0x0)
	/home/chris/Code/go/pkg/mod/gioui.org@v0.0.0-20210412203452-8c59aa82afca/gpu/path.go:307 +0xb9
gioui.org/gpu.(*drawOps).collect(0xc0003fe040, 0x6a1050, 0xc00007a270, 0xc000012580, 0xc000136410, 0x320, 0x2bc)
	/home/chris/Code/go/pkg/mod/gioui.org@v0.0.0-20210412203452-8c59aa82afca/gpu/gpu.go:810 +0x31b
gioui.org/gpu.(*compute).Collect(0xc0003fe000, 0x320, 0x2bc, 0xc000136410)
	/home/chris/Code/go/pkg/mod/gioui.org@v0.0.0-20210412203452-8c59aa82afca/gpu/compute.go:265 +0xfa
gioui.org/app.(*renderLoop).renderLoop.func1(0xc00006c7e0, 0x6a01f8, 0xc000012550, 0xc0000204e0)
	/home/chris/Code/go/pkg/mod/gioui.org@v0.0.0-20210412203452-8c59aa82afca/app/loop.go:91 +0x30f
created by gioui.org/app.(*renderLoop).renderLoop
	/home/chris/Code/go/pkg/mod/gioui.org@v0.0.0-20210412203452-8c59aa82afca/app/loop.go:61 +0x7f
exit status 2

I realized that the above was accidentally 1 commit behind compute's HEAD, so I tried at gioui.org v0.0.0-20210412203657-60209f97d31d and got:

2021/04/13 09:24:52 MapBufferRange: error 0x505
exit status 1

~eliasnaur 19 days ago

I pushed the compute fixes to the main branch. Can you try again, confirming that there's still a problem? And if so can you provide me the NVIDIA driver version (your glxinfo says 4.6.0 NVIDIA 460.67 but I'm not sure that's enough)? I have a GTX 970 which is similar enough to your 960 that I might be able to reproduce the error.

~whereswaldon 18 days ago

Okay, gioui.org v0.0.0-20210420101555-354f5b43d27f gives me this:

panic: glGetError: 0x505

goroutine 35 [running, locked to thread]:
gioui.org/gpu.buildPath(0x69ffb0, 0xc000112410, 0xc0003924af, 0x140, 0x2b51, 0x0, 0x0, 0x0)
	/home/chris/Code/go/pkg/mod/gioui.org@v0.0.0-20210420101555-354f5b43d27f/gpu/path.go:307 +0xb9
gioui.org/gpu.(*drawOps).collect(0xc0003cc040, 0x69ffb0, 0xc000112410, 0xc000120560, 0xc0000cc410, 0x320, 0x2bc)
	/home/chris/Code/go/pkg/mod/gioui.org@v0.0.0-20210420101555-354f5b43d27f/gpu/gpu.go:811 +0x31b
gioui.org/gpu.(*compute).Collect(0xc0003cc000, 0x320, 0x2bc, 0xc0000cc410)
	/home/chris/Code/go/pkg/mod/gioui.org@v0.0.0-20210420101555-354f5b43d27f/gpu/compute.go:263 +0xfa
gioui.org/app.(*renderLoop).renderLoop.func1(0xc00012a780, 0x69f158, 0xc000120530, 0xc0001aa420)
	/home/chris/Code/go/pkg/mod/gioui.org@v0.0.0-20210420101555-354f5b43d27f/app/loop.go:91 +0x30f
created by gioui.org/app.(*renderLoop).renderLoop
	/home/chris/Code/go/pkg/mod/gioui.org@v0.0.0-20210420101555-354f5b43d27f/app/loop.go:61 +0x7f
exit status 2

My driver version does not seem to get more granular than the version you're seeing, even in the NVIDIA X Server Settings. Here's what I have installed (on Pop!_OS):

$ apt list --installed | rg nvidia

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libnvidia-cfg1-450/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,auto-removable]
libnvidia-cfg1-455/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,auto-removable]
libnvidia-cfg1-460/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,automatic]
libnvidia-common-440/focal,focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 all [installed,auto-removable]
libnvidia-common-450/focal,focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 all [installed,auto-removable]
libnvidia-common-455/focal,focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 all [installed,auto-removable]
libnvidia-common-460/focal,focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 all [installed,automatic]
libnvidia-compute-450/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,auto-removable]
libnvidia-compute-450/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 i386 [installed,auto-removable]
libnvidia-compute-455/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,auto-removable]
libnvidia-compute-455/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 i386 [installed,auto-removable]
libnvidia-compute-460/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,automatic]
libnvidia-compute-460/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 i386 [installed,automatic]
libnvidia-decode-450/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,auto-removable]
libnvidia-decode-450/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 i386 [installed,auto-removable]
libnvidia-decode-455/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,auto-removable]
libnvidia-decode-455/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 i386 [installed,auto-removable]
libnvidia-decode-460/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,automatic]
libnvidia-decode-460/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 i386 [installed,automatic]
libnvidia-encode-450/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,auto-removable]
libnvidia-encode-450/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 i386 [installed,auto-removable]
libnvidia-encode-455/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,auto-removable]
libnvidia-encode-455/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 i386 [installed,auto-removable]
libnvidia-encode-460/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,automatic]
libnvidia-encode-460/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 i386 [installed,automatic]
libnvidia-extra-450/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,auto-removable]
libnvidia-extra-455/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,auto-removable]
libnvidia-extra-460/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,automatic]
libnvidia-fbc1-450/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,auto-removable]
libnvidia-fbc1-450/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 i386 [installed,auto-removable]
libnvidia-fbc1-455/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,auto-removable]
libnvidia-fbc1-455/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 i386 [installed,auto-removable]
libnvidia-fbc1-460/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,automatic]
libnvidia-fbc1-460/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 i386 [installed,automatic]
libnvidia-gl-450/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,auto-removable]
libnvidia-gl-450/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 i386 [installed,auto-removable]
libnvidia-gl-455/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,auto-removable]
libnvidia-gl-455/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 i386 [installed,auto-removable]
libnvidia-gl-460/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,automatic]
libnvidia-gl-460/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 i386 [installed,automatic]
libnvidia-ifr1-450/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,auto-removable]
libnvidia-ifr1-450/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 i386 [installed,auto-removable]
libnvidia-ifr1-455/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,auto-removable]
libnvidia-ifr1-455/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 i386 [installed,auto-removable]
libnvidia-ifr1-460/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,automatic]
libnvidia-ifr1-460/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 i386 [installed,automatic]
nvidia-compute-utils-450/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,auto-removable]
nvidia-compute-utils-455/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,auto-removable]
nvidia-compute-utils-460/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,automatic]
nvidia-dkms-450/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,auto-removable]
nvidia-dkms-455/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,auto-removable]
nvidia-dkms-460/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,automatic]
nvidia-driver-450/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed]
nvidia-driver-455/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,auto-removable]
nvidia-driver-460/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,automatic]
nvidia-kernel-common-450/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,auto-removable]
nvidia-kernel-common-455/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,auto-removable]
nvidia-kernel-common-460/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,automatic]
nvidia-kernel-source-450/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,auto-removable]
nvidia-kernel-source-455/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,auto-removable]
nvidia-kernel-source-460/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,automatic]
nvidia-settings/focal-updates,now 460.39-0ubuntu0.20.04.1 amd64 [installed,automatic]
nvidia-utils-450/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,auto-removable]
nvidia-utils-455/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,auto-removable]
nvidia-utils-460/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,automatic]
xserver-xorg-video-nvidia-450/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,auto-removable]
xserver-xorg-video-nvidia-455/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,auto-removable]
xserver-xorg-video-nvidia-460/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,automatic]

The hardware here is an NVIDIA GTX 960, so very similar to yours. I take it that compute is working for you? Can I ask which Linux distro you're testing on?

~eliasnaur 18 days ago

I haven't tried my 970 yet, because the closed driver is such a pain. I do all my development on the integrated Intel GPU.

~whereswaldon 18 days ago

For testing this, I recommend downloading the Pop!_OS ISO that contains the NVIDIA driver pre-installed. You can likely test it in the live system without even installing the OS.

Register here or Log in to comment, or comment via email.