Creating/destroying several vkDevices concurrently sometimes crashes or deadlocks

To reproduce:

1 - Install Rust 1.9. There’s a MinGW version or a Visual Studio version.
2 - Clone the vulkano library.
3 - Run the “cargo test” command in the “vulkano” subdirectory. This will build an executable in the “target/debug” directory, and run it. This executable then runs the unit tests of the library.

Each test starts by creating a new instance and a new device, then runs the test, then destroys the instance and the device. Note that none of the tests creates any command buffer. Also the instances and devices and all the objects created from them are never accessed concurrently. However the tests themselves run concurrently.

Sometimes one of tests will crash in the nVidia driver, and sometimes the vkDestroyDevice function will freeze forever. Running the tests one by one (by setting the “RUST_TEST_THREADS” env var to “1”) does not trigger any of these problems. Since this is probably an issue about concurrency, you may have to run “cargo test” two or three times before it triggers.

Driver version: 368.22

Thanks for providing the repro instructions; we were able to reproduce and are working on a fix.



I noticed that this was fixed after your answer.
However since the latest version (384.76) this issue seems to have come back.