From b551c77fbe78b615e8008c09260371c493ac95f5 Mon Sep 17 00:00:00 2001 From: Ewan Crawford Date: Fri, 15 Mar 2024 10:22:39 +0000 Subject: [PATCH] [HIP][CMDBUF] Require ROCm 5.5.1 for HIP command-buffers An issue using the command-buffer experimental feature was discovered using HIP version 5.4.3 - https://github.com/ROCm/HIP/issues/2450 Set the minimum supported version as ROCm 5.5.1 to avoid this bug, as this is the next ROCm available version after 5.4.3 we have have available for testing and can confirm passes the SYCL-Graph tests. Note: The ROCm version tested by DPC++ GitHub CI is currently 6.0.0. --- source/adapters/hip/device.cpp | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/source/adapters/hip/device.cpp b/source/adapters/hip/device.cpp index 7c9142f3c7..ae4dbe159e 100644 --- a/source/adapters/hip/device.cpp +++ b/source/adapters/hip/device.cpp @@ -539,8 +539,20 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, // native asserts are in progress std::string SupportedExtensions = ""; SupportedExtensions += "pi_ext_intel_devicelib_assert "; - // Return supported for the UR command-buffer experimental feature - SupportedExtensions += "ur_exp_command_buffer "; + + int RuntimeVersion = 0; + UR_CHECK_ERROR(hipRuntimeGetVersion(&RuntimeVersion)); + + // Return supported for the UR command-buffer experimental feature on + // ROCM 5.5.1 and later. This is to workaround HIP driver bug + // https://github.com/ROCm/HIP/issues/2450 in older versions. + // + // The version is returned as (10000000 major + 1000000 minor + patch). + const int CmdBufDriverMinVersion = 50530202; // ROCM 5.5.1 + if (RuntimeVersion >= CmdBufDriverMinVersion) { + SupportedExtensions += "ur_exp_command_buffer "; + } + SupportedExtensions += " "; hipDeviceProp_t Props; @@ -844,9 +856,18 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; case UR_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP: - case UR_DEVICE_INFO_COMMAND_BUFFER_UPDATE_SUPPORT_EXP: - return ReturnValue(true); + case UR_DEVICE_INFO_COMMAND_BUFFER_UPDATE_SUPPORT_EXP: { + int DriverVersion = 0; + UR_CHECK_ERROR(hipDriverGetVersion(&DriverVersion)); + // Return supported for the UR command-buffer experimental feature on + // ROCM 5.5.1 and later. This is to workaround HIP driver bug + // https://github.com/ROCm/HIP/issues/2450 in older versions. + // + // The version is returned as (10000000 major + 1000000 minor + patch). + const int CmdBufDriverMinVersion = 50530202; // ROCM 5.5.1 + return ReturnValue(DriverVersion >= CmdBufDriverMinVersion); + } default: break; }