From: Alistair Popple <apopple@nvidia.com>
To: Danilo Krummrich <dakr@kernel.org>
Cc: nova-gpu <nova-gpu@lists.linux.dev>,
M Henning <mhenning@darkrefraction.com>,
Alice Ryhl <aliceryhl@google.com>,
David Airlie <airlied@gmail.com>,
Alexandre Courbot <acourbot@nvidia.com>,
Benno Lossin <lossin@kernel.org>, Gary Guo <gary@garyguo.net>,
Eliot Courtney <ecourtney@nvidia.com>,
John Hubbard <jhubbard@nvidia.com>,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
rust-for-linux@vger.kernel.org
Subject: Re: [PATCH v5 05/11] drm: nova: Add an info ioctl
Date: Fri, 4 Sep 2026 17:49:16 +1000 [thread overview]
Message-ID: <appc5-0MRW1XwsMh@nvdebian.thelocal> (raw)
In-Reply-To: <DL5MA26KZEF9.3KHKQXZ4JD2G6@kernel.org>
On 2026-09-03 at 20:42 +1000, Danilo Krummrich <dakr@kernel.org> wrote...
> On Thu Sep 3, 2026 at 3:12 AM CEST, Alistair Popple wrote:
> > Originally I thought the point of providing the decoded arch rather than
> > chip-id
>
> I think there never was a "rather than". The point was that if userspace has
> conditionals based on the architecture it shouldn't have to figure it out based
> on the chipid, as this has been done by the kernel already.
I see. Maybe that was a bad assumption on my behalf, because I assumed that if
you make a precise hardware description available (chip-id) there'd be no point
making an imprecise subset of that description (arch) available as it isn't
particularly useful if you can't use it in isolation for any generic purpose.
Which is to say it's unclear what generic properties users are allowed to derive
from the kernel saying "this is a Hopper GPU". It's clearer for a chip-id as it
represents an (almost) exact piece of HW with the exact properties of that HW,
so userspace can derive everything from that.
Anyway guess I will just leave it in, time will tell what use it has, even
though I think it would be better to know that use upfront.
> > because as you rightfully point out the kernel doesn't (currently at least)
> > care much about the implementation
>
> I still don't see how that value will ever be meaningful, there is no such thing
> as "all GPUs of a certain implementation regardless of architecture" have
> something in common, is it?
>
> But since you say "currently at least", are there any plans to give this value
> some meaning beyond being a unique counter for chips within a certain
> architecture?
Oh I just meant AFAIK the kernel isn't currently looking at the implementation
because everything it cares about (like the HAL) can be keyed off the
architecture and that's been my experience with most of our GPU kernel drivers.
Or IOW, at the moment, from a kernel perspective the kernel doesn't care about
implementation beyond needing to encode that into a type. So supporting for
example GB203 instead of GB202 amounts to just adding the encoding for that.
If we didn't need to add the encoding the kernel could say claim support for all
Blackwell implementations.
Of course whether this remains true generally requires a fair bit of
co-operation from the HW, and I'm not sure we're actually there yet although I
think there has been some discussions in the past.
But it would be a nice place to be - having dealt with similar problems in
the past on the CPU side it all becomes a bit of a pain constantly backporting
patches to a bunch of distros just to allow a +1 on your minor HW version that
the kernel doesn't actually care about anyway.
But we already agreed this isn't something we can or want to solve here and now,
so this is really just an aside. Maybe one day we can get there, but not now.
> If so, I think that'd be a horrible way to encode some chip commonality.
>
> > But we agreed that wasn't desirable, so now I'm still left figuring out why we
> > need to provide an arch value? The chip-id already entirely encapsulates the
> > concept, so what can/should user-space use the arch value for?
>
> Because userspace otherwise has to figure out the architecture itself based on
> the chipid, while the kernel already did derive this information.
That wasn't my question. My question wasn't where should userspace get the
arch, it is what can user-space use the arch value for? Again, architecture
alone isn't entirely sufficient for user-space. There isn't for example a neat
mapping of arch to sm version for code generation once you start looking at all
our GPUs.
> There's many ways userspace could do this, and I don't want to incentivise any
> of them.
>
> For instance, you previously showed how userspace derives the SM value from the
> chipid with sm_for_chipset() in mesa with its own lookup table.
>
> Then in NAK (src/nouveau/compiler/nak/ir.rs), there's this code.
>
> fn is_turing(&self) -> bool {
> self.sm() >= 73 && self.sm() < 80
> }
>
> fn is_ampere(&self) -> bool {
> self.sm() >= 80 && self.sm() < 89
> }
>
> fn is_ada(&self) -> bool {
> self.sm() == 89
> }
>
> #[allow(dead_code)]
> fn is_hopper(&self) -> bool {
> self.sm() >= 90 && self.sm() < 100
> }
>
> fn is_blackwell_a(&self) -> bool {
> self.sm() >= 100 && self.sm() < 110
> }
>
> fn is_blackwell_b(&self) -> bool {
> self.sm() >= 120 && self.sm() < 130
> }
>
> fn is_blackwell(&self) -> bool {
> self.is_blackwell_a() || self.is_blackwell_b()
> }
>
> That's two unnecessary indirections for something the kernel already has
> available.
Again though is what the kernel provides in the form of an arch actually useful
to user-space? Obviously the code above makes it look nice and simple like that,
but as I have been saying more complete implementations can't just rely on arch
alone and so are still going to have lookup tables both for SM and for other
info the kernel can't provide.
Anyway at this point I'll just leave chipset and arch in. Clearly you think
there is some value in providing it separately, and I suppose it doesn't make
much difference just to have it there.
> > It really boils down to how much static config info we want to encode into
> > kernel lookup tables vs. user-space lookup tables. I don't this we should be
> > filling the kernel with a bunch of static struct lookups just to ship those
> > struct definitions to user-space. It seems more reasonable to put that in
> > user-space, unless of course the kernel needs it.
> >
> > So I think your "does the kernel need this" is a reasonable benchmark for
> > deciding this.
> >
> > As I think you're hinting at it would be ideal if GSP or some other firmware
> > table could just provide everything in some nice static config table, but I
> > don't think that's currently possible and looking at other user-space drivers
> > we're certainly not alone there.
>
> Yeah, although if SM is correctly reported by the GSP, I'd rather have it
> exported in an info structure than have userspace create its own lookup table.
Yeah, although that would need to be a contract between HW and GSP and GSP and
user-space. That's fine, and can could probably do it one day, it just doesn't
currently exist AFAICT.
- Alistair
next prev parent reply other threads:[~2026-09-04 7:49 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-28 3:35 [PATCH v5 00/11] gpu: nova: Export parameters from nova-core to nova-drm Alistair Popple
2026-08-28 3:35 ` [PATCH v5 01/11] gpu: nova-core: Add public driver API to nova-core Alistair Popple
2026-08-31 20:08 ` Danilo Krummrich
2026-08-31 20:42 ` Gary Guo
2026-09-01 7:07 ` Alistair Popple
2026-09-01 7:14 ` Danilo Krummrich
2026-09-01 9:13 ` Alistair Popple
2026-09-01 9:21 ` Danilo Krummrich
2026-09-01 10:27 ` Danilo Krummrich
2026-09-01 11:35 ` Gary Guo
2026-09-01 3:53 ` Alistair Popple
2026-09-02 6:57 ` Alistair Popple
2026-09-02 19:30 ` Danilo Krummrich
2026-08-28 3:35 ` [PATCH v5 02/11] drm: nova: Add DRM registration data Alistair Popple
2026-08-28 3:35 ` [PATCH v5 03/11] drm: nova: Add GPU architecture enum to nova-drm UAPI Alistair Popple
2026-08-28 3:35 ` [PATCH v5 04/11] rust: uaccess: add UserSliceWriter::write_truncated() Alistair Popple
2026-08-28 3:35 ` [PATCH v5 05/11] drm: nova: Add an info ioctl Alistair Popple
2026-08-31 4:58 ` Alistair Popple
2026-08-31 14:23 ` Danilo Krummrich
2026-09-01 3:47 ` Alistair Popple
2026-09-01 4:50 ` Dave Airlie
2026-09-01 5:09 ` Alistair Popple
2026-09-01 7:29 ` Danilo Krummrich
2026-09-02 5:21 ` Alistair Popple
2026-09-02 7:05 ` Alistair Popple
2026-09-02 19:26 ` Danilo Krummrich
2026-09-02 19:38 ` Dave Airlie
2026-09-02 19:42 ` Danilo Krummrich
2026-09-01 4:53 ` Dave Airlie
2026-09-01 5:24 ` Alistair Popple
2026-09-01 10:38 ` Danilo Krummrich
2026-09-01 17:01 ` Danilo Krummrich
2026-09-02 2:38 ` Alistair Popple
2026-09-02 9:40 ` Danilo Krummrich
2026-09-03 1:12 ` Alistair Popple
2026-09-03 10:42 ` Danilo Krummrich
2026-09-04 7:49 ` Alistair Popple [this message]
2026-09-04 9:34 ` Danilo Krummrich
2026-09-04 11:13 ` Gary Guo
2026-09-04 12:08 ` Danilo Krummrich
2026-08-28 3:35 ` [PATCH v5 06/11] drm: nova: Add usable VRAM size to GPU info Alistair Popple
2026-08-28 3:35 ` [PATCH v5 07/11] drm: nova: Use nova-core to read VRAM_BAR_SIZE parameter Alistair Popple
2026-08-28 3:35 ` [PATCH v5 08/11] drm: nova: Expose a render node Alistair Popple
2026-08-28 3:35 ` [PATCH v5 09/11] drm: nova: Report GPU name in GPU info Alistair Popple
2026-08-31 14:33 ` Danilo Krummrich
2026-09-01 3:09 ` Alistair Popple
2026-08-28 3:35 ` [PATCH v5 10/11] drm: nova: Report GPU short " Alistair Popple
2026-08-31 14:41 ` Danilo Krummrich
2026-09-01 3:10 ` Alistair Popple
2026-08-28 3:35 ` [PATCH v5 11/11] drm: nova: Report GPU GID " Alistair Popple
2026-08-28 6:04 ` [PATCH v5 00/11] gpu: nova: Export parameters from nova-core to nova-drm Alistair Popple
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=appc5-0MRW1XwsMh@nvdebian.thelocal \
--to=apopple@nvidia.com \
--cc=acourbot@nvidia.com \
--cc=airlied@gmail.com \
--cc=aliceryhl@google.com \
--cc=dakr@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=ecourtney@nvidia.com \
--cc=gary@garyguo.net \
--cc=jhubbard@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=mhenning@darkrefraction.com \
--cc=nova-gpu@lists.linux.dev \
--cc=rust-for-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox