From: "Gary Guo" <gary@garyguo.net>
To: <airlied@redhat.com>, "Lyude Paul" <lyude@redhat.com>,
"Danilo Krummrich" <dakr@kernel.org>,
"Alexandre Courbot" <acourbot@nvidia.com>
Cc: <dri-devel@lists.freedesktop.org>,
<nouveau@lists.freedesktop.org>, <nova-gpu@lists.linux.dev>
Subject: Re: [PATCH v3 2/2] nova-core: only bind to GPUs when explicitly requested
Date: Tue, 24 Nov 2026 14:25:49 +0000 [thread overview]
Message-ID: <DN3IDZ94G4NN.1FUTSE7B4G1ZK@garyguo.net> (raw)
In-Reply-To: <20261124-nova-nouveau-gsp-v3-2-e1440479ded6@redhat.com>
On Tue Nov 24, 2026 at 5:50 AM GMT, Dave Airlie via B4 Relay wrote:
> From: Dave Airlie <airlied@redhat.com>
>
> nova-core currently binds to every NVIDIA GPU it supports
> (GSP-capable, Turing and later GPUs), competing with nouveau for the
> same devices.
>
> Add the NOVA_CORE_BIND_GSP Kconfig option (default n) and a bind_gsp
> module parameter, defaulting to the Kconfig value and able to override
> it in both directions. Unless one of them requests binding, probe()
> rejects the GPU with -ENODEV and leaves the device to other drivers,
> such as nouveau. The PCI driver still registers, so module autoloading
> via modalias keeps working when binding is disabled.
>
> Signed-off-by: Dave Airlie <airlied@redhat.com>
> ---
> drivers/gpu/nova-core/Kconfig | 21 +++++++++++++++++++++
> drivers/gpu/nova-core/driver.rs | 4 ++++
> drivers/gpu/nova-core/nova_core.rs | 23 +++++++++++++++++++++++
> 3 files changed, 48 insertions(+)
>
> diff --git a/drivers/gpu/nova-core/Kconfig b/drivers/gpu/nova-core/Kconfig
> index 2e11e46c99c7..058742d50692 100644
> --- a/drivers/gpu/nova-core/Kconfig
> +++ b/drivers/gpu/nova-core/Kconfig
> @@ -30,3 +30,24 @@ config NOVA_CORE_SELFTESTS
> logs its failure and lets the probe continue.
>
> If unsure, say N.
> +
> +config NOVA_CORE_BIND_GSP
> + bool "Make nova-core the default driver for GSP-capable GPUs"
> + depends on NOVA_CORE
> + default n
Quite a few distros have script that automatically select Y regardless defaults.
What about just using !NOUVEAU_CORE_BIND_GSP?
> + help
> + Make nova-core bind to all NVIDIA GPUs it supports by default.
> +
> + By default nova-core does not bind to any GPU and leaves NVIDIA
> + GPUs to other drivers, such as nouveau. Say Y here, or boot with
> + nova-core.bind_gsp=1, to make nova-core claim NVIDIA GPUs
> + instead.
> +
> + nova-core is work in progress and may not be functional, so this
> + is intended for nova developers and testers only. When enabled,
> + nouveau must not bind to the same (GSP-capable) GPUs, i.e.
> + CONFIG_DRM_NOUVEAU_BIND_GSP=N or nouveau.bind_gsp=0 is required.
> + Otherwise both drivers compete for the same devices and
> + whichever is loaded first wins.
> +
> + If unsure, say N.
> diff --git a/drivers/gpu/nova-core/driver.rs b/drivers/gpu/nova-core/driver.rs
> index d6bc972d47c7..e89967ef0cd5 100644
> --- a/drivers/gpu/nova-core/driver.rs
> +++ b/drivers/gpu/nova-core/driver.rs
> @@ -105,6 +105,10 @@ fn probe<'bound>(
> dev_dbg!(pdev, "Probe Nova Core GPU driver.\n");
>
> try_pin_init!(NovaCore {
> + _: {
> + crate::NovaCoreModule::check_bind_allowed(pdev)?;
> + },
> +
> _: {
> pdev.enable_device_mem()?;
> pdev.set_master();
> diff --git a/drivers/gpu/nova-core/nova_core.rs b/drivers/gpu/nova-core/nova_core.rs
> index 84f777844592..483e5c1d427b 100644
> --- a/drivers/gpu/nova-core/nova_core.rs
> +++ b/drivers/gpu/nova-core/nova_core.rs
> @@ -68,6 +68,25 @@ pub(crate) fn debugfs_data<'a>(_dev: &'a device::Device<device::Bound>) -> &'a D
> }
> }
>
> +impl NovaCoreModule {
> + /// Check whether nova-core is allowed to bind to GPUs.
> + ///
> + /// Binding needs to be requested explicitly, either through the
> + /// NOVA_CORE_BIND_GSP Kconfig option or the `bind_gsp` module parameter.
> + /// Otherwise, NVIDIA GPUs are left to other drivers, such as nouveau.
> + pub(crate) fn check_bind_allowed(pdev: &pci::Device<device::Core<'_>>) -> Result {
> + if crate::module_parameters::bind_gsp.value() {
> + return Ok(());
> + }
This will reject binding via sysfs, which I think should still be allowed
despite CONFIG_NOVA_CORE_BIND_GSP. I wonder if we can support such cases just by
setting ID table to override_only if the config option is set?
If module parameter is set, then we can pci_add_dynid to add a match without
override_only being set.
Best,
Gary
> +
> + dev_info!(
> + pdev,
> + "Not binding to GPU; enable with CONFIG_NOVA_CORE_BIND_GSP=y or nova-core.bind_gsp=1\n"
> + );
> + Err(ENODEV)
> + }
> +}
> +
> impl InPlaceModule for NovaCoreModule {
> fn init(module: &'static kernel::ThisModule) -> impl PinInit<Self, Error> {
> try_pin_init!(Self {
> @@ -97,6 +116,10 @@ fn init(module: &'static kernel::ThisModule) -> impl PinInit<Self, Error> {
> default: false,
> description: "Keep the GSP-RM log buffers in debugfs after their GPU is unbound",
> },
> + bind_gsp: bool {
> + default: cfg!(CONFIG_NOVA_CORE_BIND_GSP),
> + description: "Bind to GSP-capable GPUs, making nova-core the default NVIDIA driver",
> + },
> },
> }
>
next prev parent reply other threads:[~2026-11-24 14:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 5:50 [PATCH v3 0/2] nova/nouveau: add configs/module options to control binding behaviour (v2) Dave Airlie via B4 Relay
2026-11-24 5:50 ` [PATCH v3 1/2] drm/nouveau: add option to leave GSP-capable GPUs to other drivers Dave Airlie via B4 Relay
2026-11-24 5:50 ` [PATCH v3 2/2] nova-core: only bind to GPUs when explicitly requested Dave Airlie via B4 Relay
2026-11-24 11:59 ` Danilo Krummrich
2026-11-24 14:25 ` Gary Guo [this message]
2026-11-24 14:27 ` [PATCH v3 0/2] nova/nouveau: add configs/module options to control binding behaviour (v2) Gary Guo
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=DN3IDZ94G4NN.1FUTSE7B4G1ZK@garyguo.net \
--to=gary@garyguo.net \
--cc=acourbot@nvidia.com \
--cc=airlied@redhat.com \
--cc=dakr@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=lyude@redhat.com \
--cc=nouveau@lists.freedesktop.org \
--cc=nova-gpu@lists.linux.dev \
/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