cancel
Showing results for 
Search instead for 
Did you mean: 

OpenGL & Vulkan

vkCreateGraphicsPipelines returns VK_ERROR_OUT_OF_HOST_MEMORY

Hi All !

I use glslang for compilation GLSL/HLSL to SPIR-V.  vkCreateGraphicsPipelines returns VK_ERROR_OUT_OF_HOST_MEMORY

So, I know the problem in my shader code, because if I use SV_POSITION instead of POSITION it works.

The similar problem was described here:vkCreateGraphicsPipelines returns VK_ERROR_INITIALIZATION_FAILED 

I have attached minimal test project for Visual Studio 2017 with source code, HLSL source code and spirv output.

please see vs.vert

#define POSITION SV_POSITION // it will work.‍‍

 

...

I have no problem on nVidia/ARM Mali GPU. Bug happens on AMD R7 240, AMD R7 350X 

May be could you  fix Vulkan Driver ? 

BR, Andrey.

0 Likes
6 Replies
dorisyan
Staff

Yes, HLSL declare the output as "Position" instead of "SV_Position", where "Position" is not a system value but a generic semantic name, or else PS won't executed because VS doesn't export position.

Hi dorisyan‌, why do we have VK_ERROR_OUT_OF_HOST_MEMORY? Because on another GPU we have no this error.

0 Likes

VK_ERROR_OUT_OF_HOST_MEMORY means the memory you are going to use is NULL now, do you allocate host memory for that? and maybe it has been deleted?

0 Likes

Hi dorisyan

VK_ERROR_OUT_OF_HOST_MEMORY means the memory you are going to use is NULL now, do you allocate host memory for that? and maybe it has been deleted?

I have no problem with memory on HOST for attached small test project. I didn't allocate any memory for this project on HOST using malloc/new. May be we have some allocations inside C RunTime, All structs and variable is allocated in stack. I still think that is AMD driver bug despite we have error in HLSL code.

I suggest AMD return VK_ERROR_INCOMPLETE instead of VK_ERROR_OUT_OF_HOST_MEMORY and fix memory bug in driver, if it exists.

What do you think?

0 Likes

Hi Andrey2007AMD‌, I also think this error code is not  proper.

Refer to spec: 

VkResult vkCreateGraphicsPipelines()
Return Codes
Success
  • VK_SUCCESS

Failure
  • VK_ERROR_OUT_OF_HOST_MEMORY

  • VK_ERROR_OUT_OF_DEVICE_MEMORY

  • VK_ERROR_INVALID_SHADER_NV

VK_ERROR_INVALID_SHADER_NV may be a good choice.

Hi @dorisyan, you are right. This is my mistake

0 Likes