Freeze on vkDestroyDevice in

Whenever an application calls vkDestroyDevice, it will freeze. It affect vulkaninfo, steam, games, vkcube, everything.

Arch Linux on X11
Driver: 495.44 from package nvidia-dkms
GeForce 1070 GTX

Backtrace from debugging:

#0 0x00007ffff79bb8ca in __futex_abstimed_wait_common64 () from /usr/lib/
#1 0x00007ffff79b0743 in __pthread_clockjoin_ex () from /usr/lib/
#2 0x00007ffff5d5ed08 in ?? () from /usr/lib/
#3 0x00007ffff61d3ca0 in ?? () from /usr/lib/
#4 0x00007ffff619b315 in ?? () from /usr/lib/
#5 0x00007ffff770ae8f in ?? () from /usr/lib/
#6 0x00007ffff7f410aa in ?? () from /usr/lib/
#7 0x00007ffff7f4ba78 in vkDestroyDevice () from /usr/lib/
#8 0x0000555555558366 in main () at /home/elrick/Projects/Dumpster/TestVulkan/main.cpp:448

I had to run --safe-mode or it would also freeze:
nvidia-bug-report.log.gz (137.2 KB)

I traced the problem to using __GL_THREADED_OPTIMIZATIONS. I guess it’s not a good idea to blanket enable that everywhere.

Please see: