Skip to content

Commit e874bf1

Browse files
CopilotBinyang2014
andauthored
fix: isCuMemMapAllocated crashes on non-NVLS systems even with MSCCLPP_FORCE_DISABLE_NVLS=true (#790)
- [x] Fix `isCuMemMapAllocated()` to just return `true/false` without throwing when NVLS is not supported - [x] Fix `isNvlsSupported()` caching bug where `result`/`isChecked` were never updated - [x] Restore `[[maybe_unused]]` on `result` and `isChecked` statics — needed in HIP/ROCm env where `CUDA_NVLS_API_AVAILABLE` is not defined and the variables would otherwise be unused - [x] Run linter (`./tools/lint.sh`) --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Binyang2014 <9415966+Binyang2014@users.noreply.github.com>
1 parent eeea00b commit e874bf1

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/core/gpu_utils.cc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,9 @@ bool isNvlsSupported() {
283283
MSCCLPP_CUDATHROW(cudaGetDevice(&deviceId));
284284
MSCCLPP_CUTHROW(cuDeviceGet(&dev, deviceId));
285285
MSCCLPP_CUTHROW(cuDeviceGetAttribute(&isMulticastSupported, CU_DEVICE_ATTRIBUTE_MULTICAST_SUPPORTED, dev));
286-
return isMulticastSupported == 1;
286+
result = (isMulticastSupported == 1);
287+
isChecked = true;
288+
return result;
287289
}
288290
return result;
289291
#endif
@@ -300,9 +302,6 @@ bool isCuMemMapAllocated([[maybe_unused]] void* ptr) {
300302
return false;
301303
}
302304
MSCCLPP_CUTHROW(cuMemRelease(handle));
303-
if (!isNvlsSupported()) {
304-
throw Error("cuMemMap is used in env without NVLS support", ErrorCode::InvalidUsage);
305-
}
306305
return true;
307306
#endif
308307
}

0 commit comments

Comments
 (0)