diff --git a/projects/hip-tests/catch/hipTestMain/config/config_amd_linux b/projects/hip-tests/catch/hipTestMain/config/config_amd_linux index e3c7bc6c3b..73ec536866 100644 --- a/projects/hip-tests/catch/hipTestMain/config/config_amd_linux +++ b/projects/hip-tests/catch/hipTestMain/config/config_amd_linux @@ -897,7 +897,6 @@ "Unit_hipExtLaunchKernelGGL_Functional", "=== Following tests disabled due to SWDEV-483110", "Unit_UUID_setEnv_Thread", - "Unit_UUID_setEnv_Thread_Lock", "====================================================", #endif #if defined gfx1200 || defined gfx1201 diff --git a/projects/hip-tests/catch/unit/device/hipDeviceGetUuid.cc b/projects/hip-tests/catch/unit/device/hipDeviceGetUuid.cc index 6094ffcc36..83ac79637f 100644 --- a/projects/hip-tests/catch/unit/device/hipDeviceGetUuid.cc +++ b/projects/hip-tests/catch/unit/device/hipDeviceGetUuid.cc @@ -494,27 +494,6 @@ void setEnv() { HipTest::HIP_SKIP_TEST("Skipping because this machine has total GPUs < 2"); // NOLINT } } - -std::mutex setLock; -void setEnvLock() { - setLock.lock(); - std::map> uuid_map; - #ifdef __linux__ - uuid_map = getUUIDlistFromRocmInfo(); - #else - uuid_map = getUUIDlistWithoutRocmInfo(); - #endif - if (uuid_map.size() >= 2) { - std::string uuid = uuid_map[1].data(); - std::string uuidEnv = uuid.substr(0, 20); - unsetenv("HIP_VISIBLE_DEVICES"); - setenv("HIP_VISIBLE_DEVICES", uuidEnv.c_str(), 1); - } else { - tState = 2; - HipTest::HIP_SKIP_TEST("Skipping because this machine has total GPUs < 2"); // NOLINT - } - setLock.unlock(); -} /** * Test Description * ------------------------ @@ -538,35 +517,6 @@ TEST_CASE("Unit_UUID_setEnv_Thread") { t2.join(); REQUIRE(tState != 0); } -/** - * Test Description - * ------------------------ - * - Multi thread scenario. - * - Set Env var HIP_VISIBLE_DEVICES in one thread - * - Meanwhile hold the second thread. Release the 2nd thread. - * - Verify the followed by functionality in another thread - * Test source - * ------------------------ - * - unit/device/hipDeviceGetUuid.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 6.2 - */ - -TEST_CASE("Unit_UUID_setEnv_Thread_Lock") { - // Create Thread one - std::thread t1(setEnvLock); -#ifdef __linux__ - sleep(2); -#else - _sleep(2); -#endif - // Create Thread two - std::thread t2(ChkUUID); - t2.join(); - t1.join(); - REQUIRE(tState != 0); -} #endif /** * End doxygen group DriverTest. diff --git a/projects/hip-tests/catch/unit/device/uuidList.cc b/projects/hip-tests/catch/unit/device/uuidList.cc index e2c7c12ac0..a46a68ce58 100644 --- a/projects/hip-tests/catch/unit/device/uuidList.cc +++ b/projects/hip-tests/catch/unit/device/uuidList.cc @@ -23,33 +23,35 @@ THE SOFTWARE. int main() { hipDevice_t device; - int devCount; + int devCount = 0; hipError_t localError; localError = hipGetDeviceCount(&devCount); - if (localError == hipSuccess) { - printf("HIP Api returned hipSuccess"); + if (localError != hipSuccess) { + printf("hipGetDeviceCount is failed."); + return 1; } - std::string uuid; + std::string uuid = ""; for (int i = 0; i < devCount; i++) { localError = hipSetDevice(i); - if (localError == hipSuccess) { - printf("HIP Api returned hipSuccess"); + if (localError != hipSuccess) { + printf("hipSetDevice is failed."); + return 1; } localError = hipDeviceGet(&device, i); - if (localError == hipSuccess) { - printf("HIP Api returned hipSuccess"); + if (localError != hipSuccess) { + printf("hipDeviceGet is failed."); + return 1; } hipUUID d_uuid{0}; localError = hipDeviceGetUuid(&d_uuid, device); - if (localError == hipSuccess) { - printf("HIP Api returned hipSuccess"); + if (localError != hipSuccess) { + printf("hipDeviceGetUuid is failed."); + return 1; } - char preStr[16] = "GPU-"; - strcat(preStr, d_uuid.bytes); if (i == devCount - 1) { - uuid = uuid + preStr; + uuid = uuid + "GPU-" + d_uuid.bytes; } else { - uuid = uuid + preStr + ","; + uuid = uuid + "GPU-" + d_uuid.bytes + ","; } } std::cout<< uuid;