glxgears has a black screen with PRIME Render Offload

Can’t really tell whats wrong with the configuration since I don’t really know. Vulkan works after patching the paths in the icd files. glmark2 also ends up with a black screen as well. The actual setup for the GPU itself seem to be fine, since the output NVIDIA-G0 was created and the GPU initializes in low-power mode. The bug report can be found here [1].

Issue on Github [2].

[1] https://gist.github.com/eadwu/ff2690fbef75323c7b54bea1ba1c0745
[2] https://github.com/NixOS/nixpkgs/pull/66601

That nixos stuff is confusing. That one doesn’t look correct in terms of libglvnd:
libGL.so.1 => /nix/store/mlxbm6hyg1d5nrzfqv1vx114b7bcy14m-libGL-1.0.0/lib/libGL.so.1

libGL.so.1 should end up at libGL.so.1.7.0 effectively. Maybe check for that.

Bumped libglvnd to 1.1.1 and can verify libGL.so.1.7.0 exists. Rebuilding the entire system right now because it seems libglvnd looks like a base dependency for a lot of things so it’ll be a while before I can verify whether that was the issue.

Doesn’t seem like it fixed the issue, libGL.so.1 now points to libGL.so.1.7.0 but I still get a black screen. Using the script below as the offloading command (nvidia-offload) and tried without it but no differences were seen in the behavior. Updated the gist with the strace output of glxgears and a refreshed nvidia-bug-report.log.

#!/nix/store/l6h4ya0wzb4b8mr0y58k2gh2nhfql4sn-bash-4.4-p23/bin/bash
export __NV_PRIME_RENDER_OFFLOAD=1
export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0
export __GLX_VENDOR_LIBRARY_NAME=nvidia
export __VK_LAYER_NV_optimus=NVIDIA_only
exec -a "$0" "$@"

There’s a drm error in dmesg, might point to mesa being used on the nvidia gpu so an incomplete glvnd setup. For debugging purposes, I’d recommend to disable nvidia drm kms, i.e. nvidia-drm.modeset=0

[   17.030836] Call Trace:
[   17.030841]  nv_drm_atomic_helper_disable_all+0xaa/0x250 [nvidia_drm]
[   17.030842]  nv_drm_master_drop+0x25/0x60 [nvidia_drm]
[   17.030847]  drm_drop_master+0x28/0x40 [drm]
[   17.030850]  drm_master_release+0x91/0xb0 [drm]
[   17.030853]  drm_file_free.part.5+0x2e2/0x2f0 [drm]
[   17.030858]  drm_release+0x46/0x80 [drm]
[   17.030861]  __fput+0xba/0x230
[   17.030864]  task_work_run+0x8a/0xb0
[   17.030866]  do_syscall_64+0x39b/0x3ee
[   17.030868]  entry_SYSCALL_64_after_hwframe+0x44/0xa9

appears even when I use PRIME sync and still appears even when explicitly disabling modeset through the kernel parameter. Like before, still getting a black screen. I’ll try to cross compare things from sync to the offload setup and see if I can pinpoint the problem from there.