vkEnumerateInstanceExtensions exception

Hello,

While going through some Vulkan tutorials available online, I found some memory leaks even in the most simple examples, even official ones from LunarG SDK.
I was trying to test that here: Vulkan driver memory leak - Vulkan - NVIDIA Developer Forums , it’s probably Nvidia drivers bug, we’ll see…

But I have another problem now.
My simple app to test the mentioned memory leaks is only this:

uint32_t extensionsCount = 0;

vkEnumerateInstanceExtensionProperties(nullptr, &extensionsCount, nullptr);

This worked well yesterday, it returned 3 available extensions. But after messing with different versions of Nvidia GPU drivers (see link above), I came back to the latest, 372.70, which worked before and…

…my app - these 2 lines of code, doesn’t work anymore in 32bit build, it throws an exception, access violation
Works in 64bit however.

What could go wrong? I was always doing clean driver install with PC restarts…

My PC: i7-6700K, 16GB RAM, GTX1060 372.70, Win10 64bit, LunarG SDK 1.0.26

…my app - these 2 lines of code, doesn’t work anymore in 32bit build, it throws an exception, access violation
Works in 64bit however.

Are you running with validation enabled? If so then that may be the cause. If you run a 32bit application you need to use the 32bit validation layers. If you have 64bit validation layer versions registered, then 32bit applications won’t work.

I don’t have validation enabled (as far as I know), my app is just these 2 lines of code. To enable layers, I would need to do this like here? -> Validation layers - Vulkan Tutorial
Or do I enable layers just by registering them in OS??

I should read some documentation again…

Okay, if you don’t enable the layers then that shouldn’t be the case (unless you have set some specific undocumented env vars…). What exception do you get? Is it possible that the 32bit ICD is no longer registered with the loader? Does the 32bit version of vkinfo work?

Will try that in the evening, I’m at work now (no Vulkan)

PS: sorry for bothering you lately (on Twitter etc), but I’m really into Vulkan and you’re the first person I think of when I have a problem, hope it’s okay :slight_smile:

I did complete reinstall of drivers and Vulkan SDK.

64bit samples - cube, tri, vkjson work fine
32bit samples - cube works ok, tri crashes on window closing and vkjson crashes after writing json file (identical to 64bit version json)

I checked registry according to layers.html doc, it seems that only 64bit layers are registered, should I add 32bit versions manually? screenshot link: https://app.box.com/s/5x2l6cuod2ec6pz4us2662o6zlkv6ycq

No need to add 32bit layers to the registry. I don’t think crashes are related to those. What’s the output of the 32bit version of vkjson? If both versions crash I guess there’s an ICD registered somewhere that’s no longer present or corrupt.

Can you try running with the environment variable VK_LOADER_DEBUG set to all or warn? If this is present, the loader will output some messages to the debug output of your IDE that may help in finding the cause of this problem.

E.g. running with this on a system with no Vulkan driver installed you’ll get “Registry lookup failed can’t get ICD manifest files, do you have a Vulkan driver installed” in the debug output window of your IDE and some messages about where the loader is looking for ICDs.

Great news! Your were right: "ICD registered somewhere that’s no longer present "

I checked the chapter “Properly-Installed ICDs” here: Vulkan-LoaderAndValidationLayers/LoaderAndLayerInterface.md at master · KhronosGroup/Vulkan-LoaderAndValidationLayers · GitHub

The 64bit version was OK, nv-vk64.json manifest file was present in the registry.

But there were two 32bit versions: nv-vk32.json and the one from Intel: I once removed my Geforce from PC and tried to use integrated graphics of my i7-6700K (without success, never mind). So that was the reason, 32bit Vulkan apps were probably trying to use Intel driver, which is not present anymore as I use GF. I deleted the json in registry and everything works now.

Thank you!