@@ -539,8 +539,20 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
539
539
// native asserts are in progress
540
540
std::string SupportedExtensions = " " ;
541
541
SupportedExtensions += " pi_ext_intel_devicelib_assert " ;
542
- // Return supported for the UR command-buffer experimental feature
543
- SupportedExtensions += " ur_exp_command_buffer " ;
542
+
543
+ int RuntimeVersion = 0 ;
544
+ UR_CHECK_ERROR (hipRuntimeGetVersion (&RuntimeVersion));
545
+
546
+ // Return supported for the UR command-buffer experimental feature on
547
+ // ROCM 5.5.1 and later. This is to workaround HIP driver bug
548
+ // https://github.com/ROCm/HIP/issues/2450 in older versions.
549
+ //
550
+ // The version is returned as (10000000 major + 1000000 minor + patch).
551
+ const int CmdBufDriverMinVersion = 50530202 ; // ROCM 5.5.1
552
+ if (RuntimeVersion >= CmdBufDriverMinVersion) {
553
+ SupportedExtensions += " ur_exp_command_buffer " ;
554
+ }
555
+
544
556
SupportedExtensions += " " ;
545
557
546
558
hipDeviceProp_t Props;
@@ -844,9 +856,18 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
844
856
return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
845
857
846
858
case UR_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP:
847
- case UR_DEVICE_INFO_COMMAND_BUFFER_UPDATE_SUPPORT_EXP:
848
- return ReturnValue (true );
859
+ case UR_DEVICE_INFO_COMMAND_BUFFER_UPDATE_SUPPORT_EXP: {
860
+ int DriverVersion = 0 ;
861
+ UR_CHECK_ERROR (hipDriverGetVersion (&DriverVersion));
849
862
863
+ // Return supported for the UR command-buffer experimental feature on
864
+ // ROCM 5.5.1 and later. This is to workaround HIP driver bug
865
+ // https://github.com/ROCm/HIP/issues/2450 in older versions.
866
+ //
867
+ // The version is returned as (10000000 major + 1000000 minor + patch).
868
+ const int CmdBufDriverMinVersion = 50530202 ; // ROCM 5.5.1
869
+ return ReturnValue (DriverVersion >= CmdBufDriverMinVersion);
870
+ }
850
871
default :
851
872
break ;
852
873
}
0 commit comments