Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HLSL SPIR-V source language rejected by Vulkan runtime debug layer #462

Closed
dankbaker opened this issue Aug 14, 2016 · 21 comments
Closed

HLSL SPIR-V source language rejected by Vulkan runtime debug layer #462

dankbaker opened this issue Aug 14, 2016 · 21 comments

Comments

@dankbaker
Copy link
Contributor

When I try to actually create a shader via VkCreateShaderModule, I get;

SC (ERROR): object: 0x0 type: 0 location: 8648 msgCode: 5: SPIR-V module not valid: Invalid source language operand: 5

Which seams like validator doesn't like the source language?

@johnkslang
Copy link
Member

Right. Maybe we have to avoid validation layers or lie about what the source language was.

Generally, we weren't trying to extend SPIR-V for this first round, and extending the source languages broke that, so should probably not be done.

@johnkslang johnkslang changed the title HLSL: Doesn't appear that generated SPIR-V files are accepted by Vulkan runtime debug layer HLSL SPIR-V source language rejected by Vulkan runtime debug layer Aug 15, 2016
@dankbaker
Copy link
Contributor Author

I hacked it up to use unknown as a language and got past that check. Should I do a Pr?

@johnkslang
Copy link
Member

Sure, a PR to move to Unknown is good. Thanks.

@serhii-rieznik
Copy link

Commit 6fa1764 (from 7.04) reverses this, but seems like "my" Vulkan still does not recognize HLSL, because after updating SDK (from LunarG) and glslang (from this repo) I receiving exactly the same error message from the validation layer.

@johnkslang
Copy link
Member

Validators need to be fixed to accept this, and old validators should get replaced with up-to-date validators. Can you submit bugs against whatever validator does not accept this?

@serhii-rieznik
Copy link

Since I'm using SDK 1.0.46.0 I assume it would be correct to submit bug directly to
https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers
Correct me if I'm wrong

@KarenGhavam-lunarG
Copy link

KarenGhavam-lunarG commented Apr 24, 2017 via email

@johnkslang
Copy link
Member

@KarenGhavam-lunarG that validator tracks the header changes very closely; it's almost automatic to keep it up to date. The problem is almost certainly something else that involves more manual changes or that latches-on to out-of-date copies. (Also, if you look at this GitHub discussion on the web page, it seems you are doing email, and might want to see how the discussion flows on the web page.)

@johnkslang
Copy link
Member

Addendum: It was reported elsewhere that SPIR-V tools was not the problem, but rather an out-of-date copy.

@ajaybedi
Copy link

ajaybedi commented Jun 26, 2017

I had created SPIRV files from HLSL. Its working fine on Windows but on Android its giving same error : "SPIR-V module not valid: Invalid source language operand: 5". Any clues for the reason here and how can we fix this on Android. To generate SPIRV from HLSL I used latest glslc in Vulkan SDK version 1.0.51. @johnkslang

@johnkslang johnkslang reopened this Jun 26, 2017
@johnkslang
Copy link
Member

@chrisforbes Do you have any information on this for android?

@chrisforbes
Copy link
Contributor

This looks like the android bits include a too-old spirv-tools. @ajaybedi where are you getting your layers from, for Android?

@ajaybedi
Copy link

@chrisforbes
I am using prebuilt validation layer binaries in android's r14b NDK.
I can give a try and use latest r15b binaries to see if that contains fix for this?
Or do you suggest building these validation layer binaries from latest source code?

@chrisforbes
Copy link
Contributor

You're probably better off building the layers from source. The layers are moving much faster than NDK at the moment...

@ajaybedi
Copy link

@chrisforbes
I built layer from latest source code and the validation errors are gone. But its crashing in vkcreateGraphicsPipelines for the same SPIRV which is running fine on windows.
I also tried running VulkanLayerValidationTests.apk build with latest source and it also crashed with same stack trace:
Any clues are appreciated: Thanks
00 pc 00000000004715e8 /system/vendor/lib64/egl/libGLES_mali.so
06-30 20:43:43.965 25235 25235 F DEBUG : #1 pc 0000000000471ffc /system/vendor/lib64/egl/libGLES_mali.so (vkCreateGraphicsPipelines+496)
06-30 20:43:43.965 25235 25235 F DEBUG : #2 pc 000000000004639c /data/app/com.example.VulkanLayerValidationTests-1/lib/arm64/libVkLayer_unique_objects.so
06-30 20:43:43.965 25235 25235 F DEBUG : #3 pc 00000000000b1070 /data/app/com.example.VulkanLayerValidationTests-1/lib/arm64/libVkLayer_core_validation.so
06-30 20:43:43.965 25235 25235 F DEBUG : #4 pc 000000000003f0e8 /data/app/com.example.VulkanLayerValidationTests-1/lib/arm64/libVkLayer_object_tracker.so
06-30 20:43:43.965 25235 25235 F DEBUG : #5 pc 000000000004ad2c /data/app/com.example.VulkanLayerValidationTests-1/lib/arm64/libVkLayer_parameter_validation.so
06-30 20:43:43.965 25235 25235 F DEBUG : #6 pc 0000000000014730 /data/app/com.example.VulkanLayerValidationTests-1/lib/arm64/libVkLayer_threading.so
06-30 20:43:43.966 25235 25235 F DEBUG : #7 pc 0000000000012788 /system/lib64/libvulkan.so
06-30 20:43:43.966 25235 25235 F DEBUG : #8 pc 00000000001036f4 /data/app/com.example.VulkanLayerValidationTests-1/lib/arm64/libVulkanLayerValidationTests.so
06-30 20:43:43.966 25235 25235 F DEBUG : #9 pc 00000000002a5398 /data/app/com.example.VulkanLayerValidationTests-1/lib/arm64/libVulkanLayerValidationTests.so (_ZN7testing4Test3RunEv+424)
06-30 20:43:43.966 25235 25235 F DEBUG : #10 pc 00000000002a6138 /data/app/com.example.VulkanLayerValidationTests-1/lib/arm64/libVulkanLayerValidationTests.so (_ZN7testing8TestInfo3RunEv+416)
06-30 20:43:43.966 25235 25235 F DEBUG : #11 pc 00000000002a6710 /data/app/com.example.VulkanLayerValidationTests-1/lib/arm64/libVulkanLayerValidationTests.so (_ZN7testing8TestCase3RunEv+260)
06-30 20:43:43.966 25235 25235 F DEBUG : #12 pc 00000000002ae6f0 /data/app/com.example.VulkanLayerValidationTests-1/lib/arm64/libVulkanLayerValidationTests.so (_ZN7testing8internal12UnitTestImpl11RunAllTestsEv+1148)
06-30 20:43:43.966 25235 25235 F DEBUG : #13 pc 00000000002ae25c /data/app/com.example.VulkanLayerValidationTests-1/lib/arm64/libVulkanLayerValidationTests.so (_ZN7testing8UnitTest3RunEv+40)
06-30 20:43:43.966 25235 25235 F DEBUG : #14 pc 0000000000183db0 /data/app/com.example.VulkanLayerValidationTests-1/lib/arm64/libVulkanLayerValidationTests.so
06-30 20:43:43.966 25235 25235 F DEBUG : #15 pc 000000000019e4b8 /data/app/com.example.VulkanLayerValidationTests-1/lib/arm64/libVulkanLayerValidationTests.so
06-30 20:43:43.966 25235 25235 F DEBUG : #16 pc 00000000000696bc /system/lib64/libc.so (_ZL15__pthread_startPv+196)

@chrisforbes
Copy link
Contributor

@ajaybedi what device is this running on?

@ajaybedi
Copy link

ajaybedi commented Jul 1, 2017

@chrisforbes its Samsung S7 with Mali GPU. Samsung S7 has two versions: one with Mali and one with Adreno. This stack trace is with Mali.
I also tried Pixel XL and I got crash there also. Its with latest source code.

@ajaybedi
Copy link

@chrisforbes @johnkslang Any update on this? Is this fixed? We are still getting same issue. Now tried with Huwei P9 (Mali G72) and still same issue.

@johnkslang
Copy link
Member

To be clear, are you saying something is complaining about the OpSource being 5? It's a long established enumerant, implying either something is old or thinking a particular version is not allowed to accept that.

@krishna0808
Copy link

@chrisforbes @johnkslang : I am also seeing this error from validation layers: "SPIR-V module not valid: Invalid source language operand: 5". This happens when we try to create shader module.

ShaderModuleCreateInfo shaderInfo ({},
functionImpl.fBytes,
functionImpl.fShaderCode);
UniqueShaderModule shaderModule;

ThrowIfFailed (shaderModule = std::move (vkDevice->createShaderModuleUnique (shaderInfo)));

The original shaders are in HLSL and we use glslangValidator to create the SPIR-V file. This works fine on desktop.
Is there a workaround that we can try? If you know a place where we can raise this issue, please let us know.

@arcady-lunarg
Copy link
Contributor

This has been fixed in SPIRV-Tools a long time ago. If there are still issues with a source language enumerant being 5, please open a new issue against the appropriate repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants