vkEnumerateInstanceExtensionProperties crash with nvoglv64.dll drive - 419.35 graphic 1060 max-q

Hello

My name is Luke.

I’m learning Vulkan by developing simple game engine and i have problem after updating drivers.
My application crashes almost every time when call function vkEnumerateInstanceExtensionProperties
I did everything what was wrote here:

Reinstalling Drivers Vulkan SDK, VulkanRT, Installing Vulkan SDK without installing VulkanRT, Installing everything, Installing as administrator… nothing helps.

Please help.

My specification:
Windows 10
Visual Studio 2017
VulkanSDK 1.1.101.0
Graphics Cards:
GeForce 1060 Max-q Driver 419.35
and
Intel HD Graphics 630

ERROR FRAGMENT:

‘YasEngine.exe’ (Win32): Unloaded ‘C:\Windows\System32\DriverStore\FileRepository\nvdmi.inf_amd64_29a377e944363297\nvoglv64.dll’
‘YasEngine.exe’ (Win32): Unloaded ‘C:\Windows\System32\dxgi.dll’
Exception thrown at 0x0000000070722DC3 in YasEngine.exe: 0xC0000005: Access violation executing location 0x0000000070722DC3.

I would suggest that you try somebody else’s Vulkan application, preferably one that also make this call.

Does the issue then still happens when you compile from source? What happens when you run a Vulkan demo that has already been precompiled?

Have you tried running your app on another computer?

Hopefully these should tell you if the problem comes from your code or from your machine.

Greetings!

I also have similar issue with my project.

Whenever i launch application there is about 10% chance that it will crash at start on vk::enumerateInstanceExtensionProperties.

After some debugging, I noticed that crash happens in some side-thread spawned in nvoglv64.dll.
If I freeze this crashed thread in debugger and continue the program, everything works perfectly.

So pretty sure it is drivers fault.

Just for info, I only link to glfw3.lib and vulkan-1.lib
Even tried to put vk::enumerate at first line in main before everything, still crashes.

@GPSoofy thank you for your answare because I checked code with vkEnumerateInstanceExtensionProperties from book Learning Vulkan and there is not that error.

@Neithy like I said above it is problem in our code.

This fragment of mine code, which throws error:

bool VulkanLayersAndExtensions::CheckIfAllRequestedInstanceExtensionAreSupported()
{
	uint32_t numberOfAvailableExtensions = 0;

	bool allEnabletExtensionsAreAvailable = false;

	vkEnumerateInstanceExtensionProperties(nullptr, &numberOfAvailableExtensions, nullptr); //lukesawicki error stil here
	//lukesawicki https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/issues/302
	std::vector<VkExtensionProperties> availableExtensions(numberOfAvailableExtensions);

	vkEnumerateInstanceExtensionProperties(nullptr, &numberOfAvailableExtensions, availableExtensions.data());
	int extensionsCounter = 0;

	for(size_t i=0; i<instanceExtensions.size(); i++)
	{
		for(int j=0; j<static_cast<int>(availableExtensions.size()); j++)
		{
			if(strcmp(instanceExtensions[i], availableExtensions[j].extensionName) == 0)
			{
				++extensionsCounter;
			}
			if(extensionsCounter == instanceExtensions.size())
			{
				return true;
			}
		}
	}
	
	return false;
}

And this is code, (it’s working) from: Learning Vulkan Author: Parminder Singh

VkResult VulkanLayerAndExtension::getExtensionProperties(LayerProperties &layerProps, VkPhysicalDevice* gpu)
{
	uint32_t	extensionCount;								 // Stores number of extension per layer
	VkResult	result;										 // Variable to check Vulkan API result status
	char*		layerName = layerProps.properties.layerName; // Name of the layer 

	do {
		// Get the total number of extension in this layer
		if(gpu)
			result = vkEnumerateDeviceExtensionProperties(*gpu, layerName, &extensionCount, NULL);
		else
			result = vkEnumerateInstanceExtensionProperties(layerName, &extensionCount, NULL);

		if (result || extensionCount == 0)
			continue;

		layerProps.extensions.resize(extensionCount);

		// Gather all extension properties 
		if (gpu)
			result = vkEnumerateDeviceExtensionProperties(*gpu, layerName, &extensionCount, layerProps.extensions.data());
		else
			result = vkEnumerateInstanceExtensionProperties(layerName, &extensionCount, layerProps.extensions.data());
	} while (result == VK_INCOMPLETE);

	return result;
}

@lukaszsa1 I doubt it…

int main(){
  auto extensions = vk::enumerateInstanceExtensionProperties();
  // 10% chance to crash in nvoglv64.dll in spawned thread

  ...
}

There is nothing to do wrong, its one call…

You know bug could be earlier in the code, something not initilized or something.
I dont want to argue but example from book about which i was writing never (literaly never) throws that error so… I’m sure we are doing something wrong. @NVIDIA #NVIDIA maybe you say something?

Sad is that I do not know if this is problem in my code or in driver. I reinstall whole Windows 10 with newest drivers and for now my code works.