From f26cf5633dd21ae67f3348b4c26f166ecd73ed77 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Wed, 26 Mar 2025 17:39:10 -0500 Subject: [PATCH] nak: Turing starts at SM73 The low-end Turing cards (TU117 for sure) are SM73, not SM75. These are the cards on which we have tensor cores but they're so slow as to be almost useless. We're not back-porting this because nouveau currently returns 75 for these cards and because Volta binaries work fine on Turing so they'll just be a little slower. We have, however, seen this advertised by NVRM so we want our handling of shader models to be correct. Part-of: --- src/nouveau/compiler/nak/sm70.rs | 4 ++-- src/nouveau/compiler/nak/sph.rs | 2 +- src/nouveau/compiler/nak_nir.c | 2 +- src/nouveau/compiler/nak_nir_algebraic.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/nouveau/compiler/nak/sm70.rs b/src/nouveau/compiler/nak/sm70.rs index 1177052f7db..9e6716a33af 100644 --- a/src/nouveau/compiler/nak/sm70.rs +++ b/src/nouveau/compiler/nak/sm70.rs @@ -22,7 +22,7 @@ impl ShaderModel70 { } fn has_uniform_alu(&self) -> bool { - self.sm >= 75 + self.sm >= 73 } } @@ -161,7 +161,7 @@ impl SM70Encoder<'_> { } fn set_ureg(&mut self, range: Range, reg: RegRef) { - assert!(self.sm.sm >= 75); + assert!(self.sm.sm >= 73); assert!(range.len() == 8); assert!(reg.file() == RegFile::UGPR); assert!(reg.base_idx() <= 63); diff --git a/src/nouveau/compiler/nak/sph.rs b/src/nouveau/compiler/nak/sph.rs index a9e38082a01..3c0e76d595a 100644 --- a/src/nouveau/compiler/nak/sph.rs +++ b/src/nouveau/compiler/nak/sph.rs @@ -110,7 +110,7 @@ impl ShaderProgramHeader { SPHV3_T1_SPH_TYPE_TYPE_01_VTG }; - let sph_version = if sm >= 75 { 4 } else { 3 }; + let sph_version = if sm >= 73 { 4 } else { 3 }; res.set_sph_type(sph_type, sph_version); res.set_shader_type(shader_type); diff --git a/src/nouveau/compiler/nak_nir.c b/src/nouveau/compiler/nak_nir.c index 18b9429356c..66b5ce824e2 100644 --- a/src/nouveau/compiler/nak_nir.c +++ b/src/nouveau/compiler/nak_nir.c @@ -1073,7 +1073,7 @@ nak_postprocess_nir(nir_shader *nir, bool lcssa_progress = nir_convert_to_lcssa(nir, false, false); - if (nak->sm >= 75) { + if (nak->sm >= 73) { if (lcssa_progress) { OPT(nir, nak_nir_mark_lcssa_invariants); } diff --git a/src/nouveau/compiler/nak_nir_algebraic.py b/src/nouveau/compiler/nak_nir_algebraic.py index f1c58247c35..87a6ece3a9e 100644 --- a/src/nouveau/compiler/nak_nir_algebraic.py +++ b/src/nouveau/compiler/nak_nir_algebraic.py @@ -30,7 +30,7 @@ c = 'c' s = 's' # common conditions to improve readability -volta = 'nak->sm >= 70 && nak->sm < 75' +volta = 'nak->sm >= 70 && nak->sm < 73' algebraic_lowering = [ # Volta doesn't have `IMNMX`