[aco] problem compiling compute pipeline
Description
I'm having some issues compiling a compute pipeline in aco. In release it doesn't segfault but it crashes with "Failed to disassemble program:" in radv_shader_variant_compile
-> aco_compile_shader
. I get this output from a debug mesa build:
In file ../src/amd/compiler/aco_validate.cpp:91
Wrong base format for instruction: v1: %7 = v_mul_hi_u32_u24 %5, %6
ACO ERROR:
In file ../src/amd/compiler/aco_validate.cpp:91
Wrong base format for instruction: v1: %7 = v_mul_hi_u32_u24 %5, %6
../src/amd/compiler/aco_interface.cpp:52: void validate(aco::Program*): Assertion `is_valid' failed.
The compute shader itself is a converted vertex shader for RenderDoc's mesh output view. Up to date spirv-val doesn't list any issues with the SPIR-V.
When I set RADV_DEBUG=llvm
there's no such crash. I noticed it didn't happen on mesa 20.2.1 even with aco, so I bisected down to this commit: 57c152af
Reproduction Steps
I've attached a fossilize database here: repro.foz which can be replayed with fossilize-replay repro.foz
which asserts as above in a debug build. It doesn't fail immediately in release, I think possibly because the release failure only happens when RenderDoc enables extensions for fetching disassembly. If I set RADV_DEBUG=hang
that seems to trigger the same failure condition as RenderDoc.
System information
System: Host: lupino Kernel: 5.4.0-53-generic x86_64 bits: 64 compiler: gcc v: 9.3.0 Desktop: Fluxbox 1.3.5 dm: GDM3
Distro: Ubuntu 20.04.1 LTS (Focal Fossa)
CPU: Topology: 8-Core model: AMD Ryzen 7 1700X bits: 64 type: MT MCP arch: Zen rev: 1 L2 cache: 4096 KiB
flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm bogomips: 108794
Speed: 1888 MHz min/max: 2200/3400 MHz Core speeds (MHz): 1: 1896 2: 1896 3: 1885 4: 1886 5: 1887 6: 1887 7: 1886
8: 1887 9: 1886 10: 1886 11: 1892 12: 2056 13: 1891 14: 1887 15: 1886 16: 1886
Graphics: Device-1: Advanced Micro Devices [AMD/ATI] Ellesmere [Radeon RX 470/480/570/570X/580/580X/590]
vendor: PC Partner Limited driver: amdgpu v: kernel bus ID: 24:00.0 chip ID: 1002:67df
Device-2: NVIDIA TU102 [GeForce RTX 2080 Ti Rev. A] driver: N/A bus ID: 25:00.0 chip ID: 10de:1e07
Display: x11 server: X.Org 1.20.8 driver: ati,modesetting unloaded: fbdev,radeon,vesa resolution: 1920x1080~60Hz
OpenGL: renderer: AMD Radeon RX 480 Graphics (POLARIS10 DRM 3.35.0 5.4.0-53-generic LLVM 10.0.1)
v: 4.6 Mesa 21.0.0-devel (git-7f223a2329) direct render: Yes