From 4dca3daa00462bc0bed1b9b59ced955b628b29c3 Mon Sep 17 00:00:00 2001 From: Rohan138 Date: Tue, 9 Sep 2025 16:17:54 -0500 Subject: [PATCH] fix product name on MI250,MI355, and other platforms --- src/madengine/core/context.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/madengine/core/context.py b/src/madengine/core/context.py index ee14dd8a..394208ed 100644 --- a/src/madengine/core/context.py +++ b/src/madengine/core/context.py @@ -276,7 +276,7 @@ def get_system_gpu_product_name(self) -> str: """Get system GPU product name. Returns: - str: The GPU product name (e.g., MI300, MI325). + str: The GPU product name (e.g., AMD Instinct MI300X, NVIDIA H100 80GB HBM3). Raises: RuntimeError: If the GPU vendor is not detected. @@ -288,11 +288,9 @@ def get_system_gpu_product_name(self) -> str: - AMD """ if self.ctx["docker_env_vars"]["MAD_GPU_VENDOR"] == "AMD": - return self.console.sh("amd-smi static -g 0 | grep PRODUCT_NAME: | cut -d ':' -f 2 | grep -o 'MI[0-9][0-9][0-9][A-Z]*' | head -1") + return self.console.sh("amd-smi static -g 0 | grep MARKET_NAME: | cut -d ':' -f 2") elif self.ctx["docker_env_vars"]["MAD_GPU_VENDOR"] == "NVIDIA": - return self.console.sh( - "nvidia-smi --query-gpu=name --format=csv,noheader,nounits | head -n1 | xargs" - ) + return self.console.sh("nvidia-smi --query-gpu=name --format=csv,noheader,nounits -i 0") else: raise RuntimeError("Unable to determine gpu product name.")