From eded1f3529a50c0ec31c9f9977fd9b06ca30a72e Mon Sep 17 00:00:00 2001 From: Apurv Mishra Date: Wed, 5 Nov 2025 11:36:38 -0500 Subject: [PATCH] rocrtst: Add check for SVM support in Runtime (#1687) Signed-off-by: Apurv Mishra Approved-by: David Yat Sin --- .../rocrtst/suites/functional/svm_memory.cc | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/projects/rocr-runtime/rocrtst/suites/functional/svm_memory.cc b/projects/rocr-runtime/rocrtst/suites/functional/svm_memory.cc index 245f358969..5c6695d23d 100644 --- a/projects/rocr-runtime/rocrtst/suites/functional/svm_memory.cc +++ b/projects/rocr-runtime/rocrtst/suites/functional/svm_memory.cc @@ -301,6 +301,16 @@ void SvmMemoryTestBasic::TestCreateDestroy(hsa_agent_t agent, hsa_amd_memory_poo void SvmMemoryTestBasic::TestCreateDestroy(void) { hsa_status_t err; + + // Check if SVM is supported by the ROCr runtime + bool svm_supported = false; + err = hsa_system_get_info(HSA_AMD_SYSTEM_INFO_SVM_SUPPORTED, &svm_supported); + + if (err != HSA_STATUS_SUCCESS || !svm_supported) { + std::cout << " *** SVM is not supported - skipping CreateDestroy test ***" << std::endl; + return; + } + std::vector> agent_pools; if (verbosity() > 0) { @@ -324,6 +334,16 @@ void SvmMemoryTestBasic::TestCreateDestroy(void) { void SvmMemoryTestBasic::TestSVMPrefetch(void) { hsa_status_t err; + + // Check if SVM is supported by the ROCr runtime + bool svm_supported = false; + err = hsa_system_get_info(HSA_AMD_SYSTEM_INFO_SVM_SUPPORTED, &svm_supported); + + if (err != HSA_STATUS_SUCCESS || !svm_supported) { + std::cout << " *** SVM is not supported - skipping SVMPrefetch test ***" << std::endl; + return; + } + std::vector> agent_pools; if (verbosity() > 0) {