lib/60614: Assert in gallium llvmpipe on Ryzen 9 7900

"[email protected] via gnats" <[email protected]>
Newsgroups gmane.os.netbsd.bugs
Message-ID <[email protected]>
>Number:         60614
>Category:       lib
>Synopsis:       Assert in gallium llvmpipe on Ryzen 9 7900
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 17 12:20:00 +0000 2026
>Originator:     Paul Ripke
>Release:        NetBSD 11.0_STABLE 20260816
>Organization:
Paul Ripke
"Great minds discuss ideas, average minds discuss events, small minds
 discuss people."
-- Disputed: Often attributed to Eleanor Roosevelt. 1948.
>Environment:
System: NetBSD slave 11.0_STABLE NetBSD 11.0_STABLE (SLAVE) #0: Sat Aug 15 09:42:47 AEST 2026 stix@slave:/home/netbsd/netbsd-11/obj.amd64/home/netbsd/netbsd-11/src/sys/arch/amd64/compile/SLAVE amd64
Architecture: x86_64
Machine: amd64
>Description:

I am using llvmpipe due to lack of support. In netbsd-10, this worked without
issues. After upgrading to netbsd-11, some apps started failing, including
prusaslicer, freecad, xroar, etc. Failed assertions like:

libEGL warning: DRI2: failed to authenticate                                                                                                                                                                                                                                                                               
DefIdx 1 exceeds machine model writes for early-clobber renamable $ymm5, dead early-clobber renamable $ymm0 = VPGATHERDDYrm killed renamable $ymm5(tied-def 0), renamable $rcx, 1, killed renamable $ymm1, 0, $noreg, killed renamable $ymm0(tied-def 1) :: (load 32, align 1)                                             
 (Try with MCSchedModel.CompleteModel set to false)incomplete machine model                                                                                                                                                                                                                                                
UNREACHABLE executed at /home/netbsd/netbsd-11/src/external/apache2/llvm/librt/libLLVMCodeGen/../../lib/../dist/llvm/lib/CodeGen/TargetSchedule.cpp:246!                                                                                                                                                                   
Abort (core dumped)                                                                                                                                                                                                                                                                                                        

Some apps are still fine with OpenGL, e.g. chromium with webglsamples.

Additionally, starting apps with 'GALLIUM_DRIVER=softpipe' also works, but is
unusably slow.

>How-To-Repeat:

Start OpenGL app using llvmpipe. Likely only applies to Zen3 or Zen4
architectures, based on the patch below.
	
>Fix:

The following avoids the specific assertion above; I had also tried defining
NDEBUG, which just resulted in other assertions elsewhere, or build failures.

diff --git a/external/apache2/llvm/dist/llvm/lib/Target/X86/X86ScheduleZnver3.td b/external/apache2/llvm/dist/llvm/lib/Target/X86/X86ScheduleZnver3.td
index fae9b1b51ef1..1229f68760a5 100644
--- a/external/apache2/llvm/dist/llvm/lib/Target/X86/X86ScheduleZnver3.td
+++ b/external/apache2/llvm/dist/llvm/lib/Target/X86/X86ScheduleZnver3.td
@@ -60,7 +60,7 @@ def Znver3Model : SchedMachineModel {
 
   let PostRAScheduler = 1; // Enable Post RegAlloc Scheduler pass.
 
-  let CompleteModel = 1;
+  let CompleteModel = 0;
 }
 
 let SchedModel = Znver3Model in {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.