Skip to content

Commit 3b69212

Browse files
CLI: Fix GPU_TYPE detection for Jetson AGX Orin on JetPack 7.x (#1601)
## Issue JP7.2 transitions Jetson AGX Orin to SBSA compatibility (dGPU compute stack) but nvidia-smi still reports the GPU name as "Orin (nvgpu)", causing get_host_gpu() to incorrectly return "igpu". ## Updates Fix by adding a driver version check when the Orin nvgpu name is detected: driver < 580 (CUDA 12) maps to the JP6.x / IGX OS 1.x integrated GPU stack (igpu), while driver >= 580 (CUDA 13) maps to the JP7.x / IGX OS 2.x SBSA-compatible stack (dgpu). Adds unit tests covering the JP6/JP7 disambiguation and updates the get_cuda_tag() docstring to reflect the JP7.x platform mapping. ### Caveats - Strictly assumes the user is using default drivers with their Jetpack installation: R540 for Jetpack 6.x, R580 or R595 for Jetpack 7.x - Edge case: may fail if user attempts to install a custom driver, such as R580 on Jetpack 6.x. This is generally not supported and is OK to ignore for HoloHub CLI. ## Results Verified on Jetson AGX Orin with Jetpack 7.2 (R595): ```bash $ ./holohub build-container --dryrun No project provided, proceeding with default container 2026-06-06 14:26:25 [dryrun] $ docker build \ --build-arg BUILDKIT_INLINE_CACHE=1 \ --build-arg BASE_IMAGE=nvcr.io/nvidia/clara-holoscan/holoscan:v4.3.0-cuda13 \ --build-arg GPU_TYPE=dgpu \ # <---- fixed: previously "igpu" which is not reflective of Jetpack 7.2 stack --build-arg BASE_SDK_VERSION=4.3.0 \ --build-arg COMPUTE_CAPACITY=8.7 \ --build-arg CUDA_MAJOR=13 \ ... ``` On IGX Orin iGPU w/ IGX OS 1.1 (R540): ```bash $ ./holohub build-container --dryrun No project provided, proceeding with default container 2026-06-06 14:31:06 [dryrun] $ docker build \ --build-arg BUILDKIT_INLINE_CACHE=1 \ --build-arg BASE_IMAGE=nvcr.io/nvidia/clara-holoscan/holoscan:v4.3.0-cuda12-igpu \ --build-arg GPU_TYPE=igpu \ # <---- preserves "igpu" as expected --build-arg BASE_SDK_VERSION=4.3.0 \ --build-arg COMPUTE_CAPACITY=8.7 \ --build-arg CUDA_MAJOR=12 \ ... ``` Assisted-by: Claude:claude-sonnet-4-6 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved GPU type detection on Orin devices: integrated vs discrete GPU classification now depends on detected CUDA version. * **Documentation** * Clarified platform compatibility and CUDA-tag mapping for relevant Jetson and IGX OS combinations. * **Tests** * Added unit tests covering Orin and non-Orin GPU scenarios and the no-GPU default. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Tom Birdsong <tbirdsong@nvidia.com> Signed-off-by: Tom Birdsong <40648863+tbirdso@users.noreply.github.com> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
1 parent f7b9b80 commit 3b69212

2 files changed

Lines changed: 43 additions & 5 deletions

File tree

utilities/cli/tests/test_container.py

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@
2727
sys.path.append(str(Path(os.getcwd()) / "utilities"))
2828

2929
from utilities.cli.container import HoloHubContainer, _ContainerTerminationSignal
30-
from utilities.cli.util import get_cli_arg_value, get_cuda_tag, get_default_cuda_version
30+
from utilities.cli.util import (
31+
get_cli_arg_value,
32+
get_cuda_tag,
33+
get_default_cuda_version,
34+
get_host_gpu,
35+
)
3136

3237

3338
class TestHoloHubContainer(unittest.TestCase):
@@ -464,6 +469,36 @@ def test_get_ngc_options_no_default_without_api_key(self):
464469
options = self.container.get_ngc_options()
465470
self.assertListEqual([], options)
466471

472+
@patch("utilities.cli.util.get_default_cuda_version")
473+
@patch("utilities.cli.util.get_gpu_name")
474+
def test_get_host_gpu_orin_driver_disambiguation(self, mock_gpu_name, mock_cuda_version):
475+
"""Orin (nvgpu) maps to igpu on JP6.x (CUDA 12) and dgpu on JP7.x (CUDA 13)."""
476+
mock_gpu_name.return_value = "Orin (nvgpu)"
477+
478+
# JP6.x: driver < 580, CUDA 12 -> igpu
479+
mock_cuda_version.return_value = "12"
480+
self.assertEqual(get_host_gpu(), "igpu")
481+
482+
# JP7.x: driver >= 580, CUDA 13 -> dgpu (SBSA-compatible stack)
483+
mock_cuda_version.return_value = "13"
484+
self.assertEqual(get_host_gpu(), "dgpu")
485+
486+
# Unexpected/unknown CUDA version defaults to dgpu (treated as non-igpu)
487+
mock_cuda_version.return_value = None
488+
self.assertEqual(get_host_gpu(), "dgpu")
489+
490+
@patch("utilities.cli.util.get_gpu_name")
491+
def test_get_host_gpu_non_orin(self, mock_gpu_name):
492+
"""Non-Orin GPU names always map to dgpu regardless of driver."""
493+
mock_gpu_name.return_value = "NVIDIA RTX 4090"
494+
self.assertEqual(get_host_gpu(), "dgpu")
495+
496+
@patch("utilities.cli.util.get_gpu_name")
497+
def test_get_host_gpu_no_gpu(self, mock_gpu_name):
498+
"""No GPU detected defaults to dgpu."""
499+
mock_gpu_name.return_value = None
500+
self.assertEqual(get_host_gpu(), "dgpu")
501+
467502
@patch("utilities.cli.util.run_info_command")
468503
@patch("utilities.cli.util.shutil.which")
469504
def test_get_default_cuda_version(self, mock_which, mock_run_info_command):

utilities/cli/util.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -468,9 +468,12 @@ def get_host_gpu() -> str:
468468
)
469469
return "dgpu"
470470

471-
# Check for iGPU (Orin integrated GPU)
471+
# Orin (nvgpu) appears on both JP6.x (integrated GPU stack, driver ~540)
472+
# and JP7.x (SBSA-compatible dGPU stack, driver >= 580). Use CUDA/driver
473+
# version to distinguish: JP6.x / IGX OS 1.x ship CUDA 12 (driver < 580);
474+
# JP7.x / IGX OS 2.x ship CUDA 13 (driver >= 580).
472475
if "Orin (nvgpu)" in gpu_name:
473-
return "igpu"
476+
return "igpu" if get_default_cuda_version() == "12" else "dgpu"
474477
return "dgpu"
475478

476479

@@ -520,9 +523,9 @@ def get_cuda_tag(cuda_version: Optional[Union[str, int]] = None, sdk_version: st
520523
- SDK < 3.6.1: Old format (dgpu/igpu)
521524
- SDK == 3.6.1: only cuda13-dgpu available
522525
- SDK >= 3.7.0: Full CUDA support
523-
- cuda13: CUDA 13 (x86_64, Jetson Thor)
526+
- cuda13: CUDA 13 (x86_64, Jetson AGX Orin w/ JP7.x, Jetson AGX Thor w/ JP7.x)
524527
- cuda12-dgpu: CUDA 12 dGPU (x86_64, IGX Orin dGPU, Clara AGX dGPU, GH200)
525-
- cuda12-igpu: CUDA 12 iGPU (Jetson Orin, IGX Orin iGPU, Clara AGX iGPU)
528+
- cuda12-igpu: CUDA 12 iGPU (Jetson AGX Orin w/ JP6.x, IGX Orin iGPU w/ IGX OS 1.x, Clara AGX iGPU)
526529
527530
Args:
528531
cuda_version: CUDA major version (e.g., 12, 13). If None, uses platform default.

0 commit comments

Comments
 (0)