From: "Danilo Krummrich" <dakr@kernel.org>
To: "M Henning" <mhenning@darkrefraction.com>
Cc: "Alistair Popple" <apopple@nvidia.com>,
"nova-gpu" <nova-gpu@lists.linux.dev>,
"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: Tue, 08 Sep 2026 18:57:04 +0200 [thread overview]
Message-ID: <DLA3DUADGEQX.1Z2G7Z4TYFK1@kernel.org> (raw)
In-Reply-To: <CAAgWFh2iPJzQ5PJfFpPBTdgZ=GFjy7Eoz5C0e1WwFMuOuyJSTQ@mail.gmail.com>
On Tue Sep 8, 2026 at 4:48 PM CEST, M Henning wrote:
> On Thu, Sep 3, 2026 at 6:42 AM Danilo Krummrich <dakr@kernel.org> wrote:
>> Because userspace otherwise has to figure out the architecture itself based on
>> the chipid, while the kernel already did derive this information.
>>
>> 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.
>
> Userspace mostly uses sm id and engine id for feature checks, and I'd
> like to keep it that way.
Please note that I did not ask to change any of that in the context of
chipset/architecture enums.
What I said is that I don't want to incentivise userspace to derive the
architecture of a chip on its own, given that the kernel already does this. (If
it is never needed, that's fine too, then we don't need to export it. :)
Of course, architecture and engine class id can't be used interchangeably. The
engine class id is more fine grained. For instance, the engine class id is
different for GA100 compared to all other Ampere chips.
At a quick glance the code above looked to me as if it doesn't care about the
engine class id, because the granularity is architecture granularity and not
engine class id granularity. But at a second glance, I think you are actually
deriving the engine class id and it just happens that the code does not need to
consider e.g. AMPERE_A vs. AMPERE_B, which is why you don't have an
is_ampere_{a,b}() accessor I suppose.
That said, nova can easily export the engine class id information instead of the
architecture; the kernel will likely need the engine class id anyway. (Although
it depends a bit on the GSP-RM API, I think technically it could get away
without the driver passing it in.)
>> 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.
>
> As others have stated, the sm ids reported by firmware don't always
> match the sm ids documented in cuda-related materials. and nvk follows
> the cuda conventions here.
Yes, Alistair confirmed this too:
Yes, I did look into this. Unfortunately the SM version GSP currently
reports is different from the SM userspace code generation tools need (I
have no idea why, there appear to be way too many SM versions).
However, I don't think we have to just give up on all this. We have NVIDIA
people working on the project and firmware changes are made specifically for the
project already. So, ultimately I think it would be great to understand why that
is and possibly provide the correct information.
next prev parent reply other threads:[~2026-09-08 16:57 UTC|newest]
Thread overview: 57+ 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
2026-09-04 9:34 ` Danilo Krummrich
2026-09-08 6:47 ` Alistair Popple
2026-09-04 11:13 ` Gary Guo
2026-09-04 12:08 ` Danilo Krummrich
2026-09-08 7:11 ` Alistair Popple
2026-09-08 7:59 ` Dave Airlie
2026-09-08 14:48 ` M Henning
2026-09-08 16:57 ` Danilo Krummrich [this message]
2026-09-08 21:20 ` M Henning
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=DLA3DUADGEQX.1Z2G7Z4TYFK1@kernel.org \
--to=dakr@kernel.org \
--cc=acourbot@nvidia.com \
--cc=airlied@gmail.com \
--cc=aliceryhl@google.com \
--cc=apopple@nvidia.com \
--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
all inboxes | Powered by JetHome®