wonnx icon indicating copy to clipboard operation
wonnx copied to clipboard

Validation error spew on Vulkan

Open SludgePhD opened this issue 1 year ago • 4 comments

The shaders created by wonnx apparently run into naga/wgpu bugs that cause a lot of validation errors on Vulkan:

[2023-04-18T00:42:44Z ERROR wgpu_hal::vulkan::instance] VALIDATION [UNASSIGNED-CoreValidation-Shader-InconsistentSpirv (0x6bbb14)]
        Validation Error: [ UNASSIGNED-CoreValidation-Shader-InconsistentSpirv ] Object 0: handle = 0x7f1894544910, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x6bbb14 | SPIR-V module not valid: [VUID-StandaloneSpirv-OpTypeRuntimeArray-04680] Vulkan, OpTypeStruct containing an OpTypeRuntimeArray must be decorated with Block or BufferBlock.
      %ArrayVector = OpTypeStruct %_runtimearr_Vec4
    
[2023-04-18T00:42:44Z ERROR wgpu_hal::vulkan::instance]         objects: (type: DEVICE, hndl: 0x7f1894544910, name: ?)
[2023-04-18T00:42:44Z ERROR wgpu_hal::vulkan::instance] VALIDATION [UNASSIGNED-CoreValidation-Shader-InconsistentSpirv (0x6bbb14)]
        Validation Error: [ UNASSIGNED-CoreValidation-Shader-InconsistentSpirv ] Object 0: handle = 0x7f1894544910, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x6bbb14 | SPIR-V module not valid: [VUID-StandaloneSpirv-OpTypeRuntimeArray-04680] Vulkan, OpTypeStruct containing an OpTypeRuntimeArray must be decorated with Block or BufferBlock.
      %ArrayVector = OpTypeStruct %_runtimearr_Vec4
    
[2023-04-18T00:42:44Z ERROR wgpu_hal::vulkan::instance]         objects: (type: DEVICE, hndl: 0x7f1894544910, name: ?)

Not really caused by wonnx, but virtually every shader it creates causes an error like this, so I figured I'd document the issue here so people know about it.

SludgePhD avatar Apr 18 '23 00:04 SludgePhD

You might try upgrading wgpu - maybe that fixes it. We are using an old version (can't update just yet because of an issue with wgpu on the web - see https://github.com/webonnx/wonnx/pull/140, but I guess wgpu@master should work with the minor changes in the PR applied).

pixelspark avatar Apr 18 '23 14:04 pixelspark

Could you test again with v0.5.0?

pixelspark avatar Apr 20 '23 20:04 pixelspark

Same error happens on v0.5.0

SludgePhD avatar Apr 21 '23 23:04 SludgePhD

Filed https://github.com/gfx-rs/naga/issues/2322 upstream

SludgePhD avatar Apr 27 '23 19:04 SludgePhD