Skip to content
Merged
Show file tree
Hide file tree
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
22 changes: 11 additions & 11 deletions projects/clr/rocclr/device/pal/paldevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,14 +352,14 @@ void NullDevice::fillDeviceInfo(const Pal::DeviceProperties& palProp,
info_.globalMemSize_ = (static_cast<uint64_t>(std::min(GPU_MAX_HEAP_SIZE, 100u)) *
static_cast<uint64_t>(localRAM) / 100u);

uint uswcPercentAvailable =
((static_cast<uint64_t>(heaps[Pal::GpuHeapGartUswc].logicalSize) / Mi) > 1536 && IS_WINDOWS)
? 75
: 50;
const uint64_t gartSize = static_cast<uint64_t>(heaps[Pal::GpuHeapGartUswc].logicalSize);

// The aperture is host DRAM the GPU addresses directly, so discount it by at most
// 25%, capped at 4 GiB, rather than the 50/75% heuristic. Applies to every APU.
const uint64_t gartCredit = gartSize - std::min<uint64_t>(gartSize / 4, 4 * Gi);

if (settings().apuSystem_) {
info_.globalMemSize_ +=
(static_cast<uint64_t>(heaps[Pal::GpuHeapGartUswc].logicalSize) * uswcPercentAvailable) /
100;
info_.globalMemSize_ += gartCredit;
}

// Find the largest heap form FB memory
Expand All @@ -373,10 +373,10 @@ void NullDevice::fillDeviceInfo(const Pal::DeviceProperties& palProp,

#if IS_WINDOWS
if (settings().apuSystem_) {
info_.maxMemAllocSize_ = std::max(
(static_cast<uint64_t>(heaps[Pal::GpuHeapGartUswc].logicalSize) * uswcPercentAvailable) /
100,
info_.maxMemAllocSize_);
// One allocation is not confined to a single heap, so the ceiling is the whole pool:
// carve-out plus aperture. Measured on gfx1151 at 100 GiB across a carve-out split
// 64 GiB visible plus 32 GiB invisible.
info_.maxMemAllocSize_ = info_.globalMemSize_;
}
#endif
info_.maxMemAllocSize_ =
Expand Down
4 changes: 3 additions & 1 deletion projects/clr/rocclr/device/pal/palsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,9 @@ bool Settings::create(const Pal::DeviceProperties& palProp,
supportDepthsRGB_ = true;
}
if (use64BitPtr_) {
maxAllocSize_ = 64ULL * Gi;
// Unified memory APUs address the carve-out and the aperture as one pool, which
// already exceeds 64 GiB on shipping parts.
maxAllocSize_ = 256ULL * Gi;
} else {
maxAllocSize_ = 3ULL * Gi;
}
Expand Down
Loading