I’ve built a simple Vulkan program that works just fine when I’m using the NVIDIA Linux driver with a version from 375.66 to 384.130 (haven’t tested earlier versions). However, if I use version 387.12 or later, when the Vulkan program calls vkGetPhysicalDeviceSurfaceFormatsKHR, this function returns VK_ERROR_INITIALIZATION_FAILED. I tested a few later versions of the driver, up through 396.24, and got the same result. All versions that I tested were x86_64.
I am running the NixOS distribution of Linux, kernel version 4.9.104. I have an NVIDIA GeForce 980 GTX video card.
I also tried a newer kernel version, 4.14.46, with driver version 390.48, and saw the same error. I was unable to test an older (i.e. working) version of the driver with this kernel due to build failures (which might be a NixOS-specific problem).
Here is the console output of my program, when it works, to demonstrate what it does:
Window created.
All required validation layers supported.
Vulkan instance created.
Debug callback setup.
Obtained the window surface.
Found queue family indices.
All expected device extensions are supported.
Obtained physical device surface capabilities.
Obtained physical device surface formats.
Obtained physical device surface present modes.
Finished obtaining swapchain support details.
Found a suitable physical device.
Vulkan device created.
Obtained the graphics queue.
Obtained the present queue.
Swapchain created.
Obtained the swapchain images.
Swapchain image views created.
Entering main loop.
Main loop ended, cleaning up.
And when it fails:
Window created.
All required validation layers supported.
Instance created.
Debug callback setup.
Obtained the window surface.
Found queue family indices.
All expected device extensions are supported.
Obtained physical device surface capabilities.
Vulkan error (VK_ERROR_INITIALIZATION_FAILED): vkGetPhysicalDeviceSurfaceFormatsKHR failed.