Skip to content

Commit

Permalink
On Windows, CUDA virtual memory is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
hcho3 committed Oct 23, 2024
1 parent 7fc10d3 commit fa844e1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/cpp/common/test_device_vector.cu
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "../../../src/common/device_helpers.cuh" // for CachingThrustPolicy, PinnedMemory
#include "../../../src/common/device_vector.cuh"
#include "xgboost/global_config.h" // for GlobalConfigThreadLocalStore
#include "xgboost/windefs.h" // for xgboost_IS_WIN

namespace dh {
TEST(DeviceUVector, Basic) {
Expand Down Expand Up @@ -109,10 +110,14 @@ TEST(TestVirtualMem, Version) {
xgboost::curt::DrVersion(&major, &minor);
LOG(INFO) << "Latest supported CUDA version by the driver:" << major << "." << minor;
PinnedMemory pinned;
#if defined(xgboost_IS_WIN)
ASSERT_FALSE(pinned.IsVm());
#else // defined(xgboost_IS_WIN)
if (major >= 12 && minor >= 5) {
ASSERT_TRUE(pinned.IsVm());
} else {
ASSERT_FALSE(pinned.IsVm());
}
#endif // defined(xgboost_IS_WIN)
}
} // namespace dh

0 comments on commit fa844e1

Please sign in to comment.