Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HIP][CMDBUF] Require ROCm 5.5.1 for HIP command-buffers #1447

Merged
merged 1 commit into from
Mar 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 25 additions & 4 deletions source/adapters/hip/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down