Skip to content

[UR][CUDA] Use different throttle reasons API based on CUDA version #17719

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

Merged
merged 1 commit into from
Mar 31, 2025
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
5 changes: 5 additions & 0 deletions unified-runtime/source/adapters/cuda/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1089,8 +1089,13 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
case UR_DEVICE_INFO_CURRENT_CLOCK_THROTTLE_REASONS: {
unsigned long long ClocksEventReasons;
#if (CUDA_VERSION >= 12060)
UR_CHECK_ERROR(nvmlDeviceGetCurrentClocksEventReasons(hDevice->getNVML(),
&ClocksEventReasons));
#else
UR_CHECK_ERROR(nvmlDeviceGetCurrentClocksThrottleReasons(
hDevice->getNVML(), &ClocksEventReasons));
#endif
ur_device_throttle_reasons_flags_t ThrottleReasons = 0;
constexpr unsigned long long NVMLThrottleFlags[] = {
nvmlClocksThrottleReasonSwPowerCap,
Expand Down
Loading