r600/TURKS: NIR Shader related errors on CLI with the game "A Hat in Time" and Gallium Nine
Summary
Okay, this might be becoming now somehow annoying, - really sorry for that.
After installing latest Mesa 23.1.0-devel (git-65b62db0 2023-02-25 jammy-oibaf-ppa) which includes fix !21516 (merged) for previous bug #8350 (closed) I am getting at the CLI several NIR shader related error messages like:
EE ../src/gallium/drivers/r600/r600_shader.c:248 r600_pipe_shader_create - translation from NIR failed !
EE ../src/gallium/drivers/r600/r600_state_common.c:961 r600_shader_select - Failed to build shader variant (type=4) -1
EE ../src/gallium/drivers/r600/sfn/sfn_nir.cpp:1043 r600_shader_from_nir - r600_shader_from_nir: Lowering to assembly failed
FS
or
--Failed shader--------------------------------------------------
--NIR --------------------------------------------------------
shader: MESA_SHADER_FRAGMENT
source_sha1: {0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000}
name: TTN
stage: 4
next_stage: 0
num_textures: 9
num_ubos: 1
inputs_read: 1-2,4,8-9,11,41
outputs_written: 4
textures_used: 0x00000000'00000000'00000000'000001ff
samplers_used: 0x000001ff
subgroup_size: 1
first_ubo_is_default_ubo: true
separate_shader: true
uses_discard: true
origin_upper_left: true
untyped_color_outputs: true
inputs: 7
outputs: 1
uniforms: 76
More information can be found in the CLI log: AHiT_NIRbug_25022023.txt
Edit (02.26.2023): I was able to reproduce in the affected "level 2" also with the TGSI path a problem:
radeon: The kernel rejected CS, see dmesg for more information (-22).
01cc:fixme:dbghelp_dwarf:dwarf2_get_cie wrong CIE pointer at 0 from FDE 17d6c
01cc:fixme:faultrep:ReportFault 00007FDCEE77E940 0x0 stub
0138:fixme:msvcrt:_set_abort_behavior _WRITE_CALL_REPORTFAULT unhandled
And in dmesg
there is written (when TGSI is used):
[137004.966583] [drm:radeon_cs_packet_next_reloc [radeon]] *ERROR* Relocs at 0 after relocations chunk end 0 !
[137004.966635] [drm] ib[299]=0xC0001000
[137004.966637] [drm] ib[300]=0x00000000
[137004.966640] radeon 0000:01:00.0: bad SET_CONTEXT_REG 0x28C60
[137004.966642] [drm:radeon_cs_ioctl [radeon]] *ERROR* Invalid command stream !
The game seems to run via NIR otherwise as it should, I don't see any graphical glitches. However, there is some stuttering present which may or may not be related to the errors on the CLI.
This was tested with Wine devel 8.2.
And also here, the below listed apitraces are those from bug #7878 (closed).
Edit (02.26.2023): I have removed all the previous apitraces and uploaded a new one. It contains a short sequence of the second game level where the mentioned NIR shader errors are occurring.
System information
inxi -b
System:
Host: iMac-test Kernel: 5.15.0-60-generic x86_64 bits: 64
Desktop: KDE Plasma 5.24.7 Distro: Ubuntu 22.04.2 LTS (Jammy Jellyfish)
Machine:
Type: Desktop System: Apple product: iMac12,2 v: 1.0
serial: <superuser required>
Mobo: Apple model: Mac-942B59F58194171B v: iMac12,2
serial: <superuser required> UEFI: Apple v: IM121.88Z.004F.B00.1804101150
date: 04/10/18
CPU:
Info: quad core Intel Core i5-2400 [MCP] speed (MHz): avg: 1600
min/max: 1600/3400
Graphics:
Device-1: Intel 2nd Generation Core Processor Family Integrated Graphics
driver: i915 v: kernel
Device-2: AMD Whistler [Radeon HD 6730M/6770M/7690M XT] driver: radeon
v: kernel
Device-3: Apple FaceTime HD Camera (Built-in) type: USB driver: uvcvideo
Display: x11 server: X.Org v: 1.21.1.3 driver: X:
loaded: ati,modesetting,radeon unloaded: fbdev,vesa gpu: radeon
resolution: 2560x1440~60Hz
OpenGL: renderer: AMD TURKS (DRM 2.50.0 / 5.15.0-60-generic LLVM 15.0.6)
v: 4.5 Mesa 23.1.0-devel (git-65b62db 2023-02-25 jammy-oibaf-ppa)
Network:
Device-1: Broadcom NetXtreme BCM57765 Gigabit Ethernet PCIe driver: tg3
Device-2: Qualcomm Atheros AR93xx Wireless Network Adapter driver: ath9k
Drives:
Local Storage: total: 961.01 GiB used: 142.39 GiB (14.8%)
Info:
Processes: 226 Uptime: 2d 4h 21m Memory: 15.6 GiB used: 3.73 GiB (23.9%)
Shell: Bash inxi: 3.3.13
If applicable
- Wine version: 8.2
Regression
This doesn't happens with the R600_DEBUG=use_tgsi
option.
Nope, TGSI seems also affected.
Log files as attachment
A Hat in Time trace NIR, mostly working, (02.26.2023):
AHiT_d3d9.trace_26022023.tar.gz
Any extra information would be greatly appreciated
Note, as default the Precache Shaders option in the game is disabled. This improves the loading time of a level and also the time to go in-game. But since the "NIR serialization" shader feature the difference is no longer as large.