Problems running vulkan-tutorial.com "Drawing_a_triangle" tutorial

Could Khronos create a bug category to report technical issues?

I’ve come across an error message that doesn’t make sense.

  1. Why is Vulkan trying to open GOG?

validation layerloader_get_json: Failed to open JSON file C:\ProgramData\GOG(dot)com\Galaxy\redists\overlay\injected\galaxy_overlay_vklayer_x64.json

  1. The forum doesn’t allow links like GOG . com. Only GOG(dot)com

Bug reports should presumably go to the repository for the component that has the issue, in this case that would likely be the Vulkan Loader. However, read on before opening an issue there.

Looks like an implicit layer was installed. See Vulkan Loader and Layer Interface for a description of implicit layers and Vulkan SDK Docs for how to configure layers.

That is a limitation for new posters to reduce the amount of spam on here. I don’t remember exactly for how long the restriction applies.

How did that occur?

I was just following the tutorial.

Any application can install implicit layers. Game stores/launchers like GOG Galaxy, Steam, etc. often do this so they can render in-game overlays.

Are we talking about Shift-Tab in Steam?

It still doesn’t answer why the tutorial tried to open another overlay belonging to GOG.

References:
"Explicit layers are layers which are enabled by an application (e.g. with the vkCreateInstance function as mentioned previously), or by an environment variable.

Implicit layers are those which are enabled by their existence. For example, certain application environments (e.g. Steam or an automotive infotainment system) may have layers which they always want enabled for all applications that they start. Other implicit layers may be for all applications started on a given system (e.g. layers that overlay frames-per-second). Implicit layers are enabled automatically, whereas explicit layers must be enabled explicitly."

validation layerValidation Error: [ VUID-VkDeviceCreateInfo-sType-sType ] Object 0: VK_NULL_HANDLE, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x656af84 | vkCreateDevice: parameter pCreateInfo->sType must be VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO. The Vulkan spec states: sType must be VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO (https://vulkan.lunarg.com/doc/view/1.2.162.1/windows/1.2-extensions/vkspec.html#VUID-VkDeviceCreateInfo-sType-sType)

validation layerValidation Error: [ VUID-VkSwapchainCreateInfoKHR-imageFormat-01778 ] Object 0: handle = 0x273c5ff2000, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0xc036022f | vkCreateSwapchainKHR(): pCreateInfo->imageFormat VK_FORMAT_UNDEFINED with tiling VK_IMAGE_TILING_OPTIMAL has no supported format features on this physical device. The Vulkan spec states: The implied image creation parameters of the swapchain must be supported as reported by vkGetPhysicalDeviceImageFormatProperties (https://vulkan.lunarg.com/doc/view/1.2.162.1/windows/1.2-extensions/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageFormat-01778)

validation layerValidation Error: [ VUID-VkSwapchainCreateInfoKHR-imageFormat-01778 ] Object 0: handle = 0x273c5ff2000, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0xc036022f | vkGetPhysicalDeviceImageFormatProperties() unexpectedly failed, when called for vkCreateSwapchainKHR() validation with following params: format: VK_FORMAT_UNDEFINED, imageType: VK_IMAGE_TYPE_2D, tiling: VK_IMAGE_TILING_OPTIMAL, usage: VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, flags: Unhandled VkImageCreateFlagBits. The Vulkan spec states: The implied image creation parameters of the swapchain must be supported as reported by vkGetPhysicalDeviceImageFormatProperties (https://vulkan.lunarg.com/doc/view/1.2.162.1/windows/1.2-extensions/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageFormat-01778)

validation layerValidation Error: [ VUID-VkSwapchainCreateInfoKHR-imageFormat-01778 ] Object 0: handle = 0x273c5ff2000, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0xc036022f | vkCreateSwapchainKHR() called with a non-supported imageArrayLayers (i.e. 1). Maximum value returned by vkGetPhysicalDeviceImageFormatProperties() is 0 for imageFormat VK_FORMAT_UNDEFINED with tiling VK_IMAGE_TILING_OPTIMAL The Vulkan spec states: The implied image creation parameters of the swapchain must be supported as reported by vkGetPhysicalDeviceImageFormatProperties (https://vulkan.lunarg.com/doc/view/1.2.162.1/windows/1.2-extensions/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageFormat-01778)

validation layerValidation Error: [ VUID-VkSwapchainCreateInfoKHR-imageFormat-01778 ] Object 0: handle = 0x273c5ff2000, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0xc036022f | vkCreateSwapchainKHR() called with imageExtent = (800,600), which is bigger than max extent (0,0)returned by vkGetPhysicalDeviceImageFormatProperties(): for imageFormat VK_FORMAT_UNDEFINED with tiling VK_IMAGE_TILING_OPTIMAL The Vulkan spec states: The implied image creation parameters of the swapchain must be supported as reported by vkGetPhysicalDeviceImageFormatProperties (https://vulkan.lunarg.com/doc/view/1.2.162.1/windows/1.2-extensions/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageFormat-01778)

For example, I would like to request a Vulkan page with debug queries and solutions.

That way, anyone just needs to copy-paste the error message into Google and be redirected here to Khronos Forums to find the solution and possible cause of the error.

What is wrong here?

C:\VulkanSDK\1.2.162.1\Bin32>C:/VulkanSDK/1.2.162.1/Bin32/glslc.exe shader.vert -o vert.spv
glslc: error: cannot open input file: ‘shader.vert’: No such file or directory

C:\VulkanSDK\1.2.162.1\Bin32>C:/VulkanSDK/1.2.162.1/Bin32/glslc.exe shader.frag -o vert.spv
glslc: error: cannot open input file: ‘shader.frag’: No such file or directory

C:\VulkanSDK\1.2.162.1\Bin32>pause
Press any key to continue . . .

After adding the shader.vert and shader.frag to the same folder as compile.bat

C:\VulkanSDK\1.2.162.1\Bin32>C:/VulkanSDK/1.2.162.1/Bin32/glslc.exe shader.vert -o vert.spv
shader.vert:2: warning: ‘#extension’ : extension not supported: GL_ARB_seperate_shader_objects
1 warning generated.

C:\VulkanSDK\1.2.162.1\Bin32>C:/VulkanSDK/1.2.162.1/Bin32/glslc.exe shader.frag -o vert.spv
shader.frag:2: warning: ‘#extension’ : extension not supported: GL_ARB_seperate_shader_objects
1 warning generated.

C:\VulkanSDK\1.2.162.1\Bin32>pause
Press any key to continue . . .

I think so or perhaps the notifications if someone on your friends list starts a game or sends you a message - I don’t know what is done with the layer and what uses perhaps a different mechanism.

GOG installed an implicit layer, which will (unless you configure things otherwise) be loaded into every Vulkan application by the Vulkan Loader. In other words the layer is loaded implicitly without the affected application having to do anything.

The validation error messages you’ve quoted already say what you are doing wrong, for example the first one tells you that the VkDeviceCreateInfo structure that you are passing to vkCreateDevice has its member sType not set to the required value VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO. Similarly for the others you’ve quoted. For cases where it is not so clear I would expect the cause to be fairly specific to something the application is doing wrong.

I have no idea. You never mentioned what tutorial you are trying to follow or even if this error is from that tutorial? Looks like the shader source uses the GL_ARB_seperate_shader_objects extension, which seems strange to me given that Vulkan uses monolithic pipeline objects, so I’m not at all suprised if the GLSL compiler barfs at it.

It does make some sense. ARB_separate_shader_objects provides the ability to specify locations for variables shared between shader stages. And Vulkan/SPIR-V require that variables between stages rendezvous by location indices rather than by name.

Granted, a more reasonable tutorial would have just use GL version 4.1 (or 4.5), so I’m not sure how much I’d trust that tutorial.

That sounds real intrusive and creepy. I never gave it explicit permission to do so. Yet, it’s capable of installing a hidden layer in GOG? Since it’s not explicit, we could run viruses/bugs into other software using Vulkan.

I solved the VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO issue. It was a typo. However, the others were not as easy to solve. I looked at the code but there doesn’t seem to be any typo errors for the others in ‘void createSwapChain’.

I followed this tutorial. Conclusion - Vulkan Tutorial

Should I use another one?

So, vulkan-tutorial.com is a fake tutorial using the Vulkan library?

Ok, where should we use the real Vulkan tutorials?

You installed GOG and it probably had administrative privileges while doing so, that means you already trusted it. I’m not sure what “it” refers to in your second sentence; again it is GOG that installed the layer.

If you want to feel seriously creeped out you should take a look at what kind of antics anti-cheating software for multiplayer games tends to pull :wink: The ability to intercept every Vulkan API call an application makes (which is what a layer can do) seems rather benign by comparison.

1 Like

Glad to hear you solved one problem. I really encourage you to practice parsing the output from the validation layers. It can take a bit getting used to it, but often all the necessary info is there.

Take the second one from your post above:

It complains that the imageFormat member of the VkSwapchainCreateInfoKHR structure is VK_FORMAT_UNDEFINED which is not a format accepted for swapchain images (by your graphics card and in this case probably no card on the planet). You should check in your code where you fill in the VkSwapchainCreateInfoKHR struct, maybe you have not set imageFormat at all?

VkSwapchainCreateInfoKHR createInfo{};
createInfo.sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR;
createInfo.surface = surface;

  createInfo.minImageCount	= imageCount;
  createInfo.imageFormat		= surfaceFormat.format;
  createInfo.imageColorSpace	= surfaceFormat.colorSpace;
  createInfo.imageExtent		= extent;//remove this to test the validation layer
  createInfo.imageArrayLayers = 1;
  createInfo.imageUsage	        = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;

The code doesn’t seem to have any issues.

I went to recheck and it’s correct.

There is something wrong obviously but I’m not sure why.

My graphics card seems capable of running Vulkan but is there something wrong?

Time to show me how to do it, eh?

Looking at searches is so passe. :mask:

Have you tried setting a breakpoint on the vkCreateSwapchainKHR call and examined the value ofcreateInfo.imageFormat? The validation layer message says it is VK_FORMAT_UNDEFINED which is not allowed and rather odd. Where is surfaceFormat.format assigned, perhaps things go wrong there?

Have you tried running vulkaninfo and vkcube from the Vulkan SDK?

When I looked at VulkanInfo from VulkanConfigurator ->Tools->VulkanInfo, I got the following message;

Capture

As for vkcube, it seems to work fine.

I would also like to point out that I uninstalled GOG.com years ago.

So, the error message is most peculiar.