Skip to content
Merged
Changes from 2 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
11 changes: 5 additions & 6 deletions src/core/gpu_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,8 @@ bool isNvlsSupported() {
if (env()->forceDisableNvls) {
return false;
}
[[maybe_unused]] static bool result = false;
[[maybe_unused]] static bool isChecked = false;
static bool result = false;
Comment thread
Binyang2014 marked this conversation as resolved.
Outdated
static bool isChecked = false;
#if (CUDA_NVLS_API_AVAILABLE)
if (!isChecked) {
int deviceId;
Expand All @@ -283,7 +283,9 @@ bool isNvlsSupported() {
MSCCLPP_CUDATHROW(cudaGetDevice(&deviceId));
MSCCLPP_CUTHROW(cuDeviceGet(&dev, deviceId));
MSCCLPP_CUTHROW(cuDeviceGetAttribute(&isMulticastSupported, CU_DEVICE_ATTRIBUTE_MULTICAST_SUPPORTED, dev));
return isMulticastSupported == 1;
result = (isMulticastSupported == 1);
isChecked = true;
return result;
}
return result;
#endif
Expand All @@ -300,9 +302,6 @@ bool isCuMemMapAllocated([[maybe_unused]] void* ptr) {
return false;
}
MSCCLPP_CUTHROW(cuMemRelease(handle));
if (!isNvlsSupported()) {
Comment thread
Binyang2014 marked this conversation as resolved.
throw Error("cuMemMap is used in env without NVLS support", ErrorCode::InvalidUsage);
}
return true;
#endif
}
Expand Down
Loading