webonnx / wonnx

A WebGPU-accelerated ONNX inference run-time written 100% in Rust, ready for native and the web
Other
1.61k stars 59 forks source link

Validation error spew on Vulkan #161

Open SludgePhD opened 1 year ago

SludgePhD commented 1 year ago

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.

pixelspark commented 1 year ago

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 commented 1 year ago

Could you test again with v0.5.0?

SludgePhD commented 1 year ago

Same error happens on v0.5.0

SludgePhD commented 1 year ago

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