From a433e6f48d1c05460b1d5b2d4be908c2c88d8a61 Mon Sep 17 00:00:00 2001 From: Flora Cui Date: Tue, 21 Oct 2025 11:15:44 +0800 Subject: [PATCH] rocminfo: early detect absence of unsupported GPU in wsl (#1317) Add an early check in WSL to detect when no supported GPU is available. otherwise rocm_agent_enumerator will keep retrying rocminfo for one minute, causing unnecessary delay. Signed-off-by: Flora Cui Co-authored-by: harkgill-amd --- projects/rocminfo/rocminfo.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/projects/rocminfo/rocminfo.cc b/projects/rocminfo/rocminfo.cc index 5ea248e954..a16a9badca 100644 --- a/projects/rocminfo/rocminfo.cc +++ b/projects/rocminfo/rocminfo.cc @@ -1321,6 +1321,11 @@ int main() { return 1; } err = hsa_init(); + if (wsl_env && (err != HSA_STATUS_SUCCESS)) { + printf("%shsa_init Failed, possibly no supported GPU devices%s\n", + COL_RED, COL_RESET); + return 1; + } RET_IF_HSA_ERR(err) // Acquire and display system information