Skip to content

Commit f66287c

Browse files
johnhubbardGnurou
authored andcommitted
gpu: nova-core: Hopper/Blackwell: larger WPR2 (GSP) heap
The GSP-RM boot working memory portion of the WPR2 heap must be larger on Hopper and later GPUs than on Turing, Ampere, and Ada. Select the larger value for those generations. Signed-off-by: John Hubbard <jhubbard@nvidia.com> Reviewed-by: Eliot Courtney <ecourtney@nvidia.com> Link: https://patch.msgid.link/20260602032111.224790-6-jhubbard@nvidia.com Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
1 parent fcdd74a commit f66287c

2 files changed

Lines changed: 15 additions & 6 deletions

File tree

drivers/gpu/nova-core/gsp/fw.rs

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// SPDX-License-Identifier: GPL-2.0
2+
// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
23

34
pub(crate) mod commands;
45
mod r570_144;
@@ -29,7 +30,10 @@ use kernel::{
2930
use crate::{
3031
fb::FbLayout,
3132
firmware::gsp::GspFirmware,
32-
gpu::Chipset,
33+
gpu::{
34+
Architecture,
35+
Chipset, //
36+
},
3337
gsp::{
3438
cmdq::Cmdq, //
3539
GSP_PAGE_SIZE,
@@ -106,11 +110,15 @@ const GSP_HEAP_ALIGNMENT: Alignment = Alignment::new::<{ 1 << 20 }>();
106110
impl GspFwHeapParams {
107111
/// Returns the amount of GSP-RM heap memory used during GSP-RM boot and initialization (up to
108112
/// and including the first client subdevice allocation).
109-
fn base_rm_size(_chipset: Chipset) -> u64 {
110-
// TODO: this needs to be updated to return the correct value for Hopper+ once support for
111-
// them is added:
112-
// u64::from(bindings::GSP_FW_HEAP_PARAM_BASE_RM_SIZE_GH100)
113-
u64::from(bindings::GSP_FW_HEAP_PARAM_BASE_RM_SIZE_TU10X)
113+
fn base_rm_size(chipset: Chipset) -> u64 {
114+
match chipset.arch() {
115+
Architecture::Turing | Architecture::Ampere | Architecture::Ada => {
116+
u64::from(bindings::GSP_FW_HEAP_PARAM_BASE_RM_SIZE_TU10X)
117+
}
118+
Architecture::Hopper | Architecture::BlackwellGB10x | Architecture::BlackwellGB20x => {
119+
u64::from(bindings::GSP_FW_HEAP_PARAM_BASE_RM_SIZE_GH100)
120+
}
121+
}
114122
}
115123

116124
/// Returns the amount of heap memory required to support a single channel allocation.

drivers/gpu/nova-core/gsp/fw/r570_144/bindings.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ pub const NV_VGPU_MSG_SIGNATURE_VALID: u32 = 1129337430;
3737
pub const GSP_FW_HEAP_PARAM_OS_SIZE_LIBOS2: u32 = 0;
3838
pub const GSP_FW_HEAP_PARAM_OS_SIZE_LIBOS3_BAREMETAL: u32 = 23068672;
3939
pub const GSP_FW_HEAP_PARAM_BASE_RM_SIZE_TU10X: u32 = 8388608;
40+
pub const GSP_FW_HEAP_PARAM_BASE_RM_SIZE_GH100: u32 = 14680064;
4041
pub const GSP_FW_HEAP_PARAM_SIZE_PER_GB_FB: u32 = 98304;
4142
pub const GSP_FW_HEAP_PARAM_CLIENT_ALLOC_SIZE: u32 = 100663296;
4243
pub const GSP_FW_HEAP_SIZE_OVERRIDE_LIBOS2_MIN_MB: u32 = 64;

0 commit comments

Comments
 (0)