From 8ee8d0171117a736fdee14935c4095f028cca771 Mon Sep 17 00:00:00 2001 From: Nikita Sirgienko Date: Wed, 29 May 2024 21:56:42 +0200 Subject: [PATCH] Cycles: oneAPI: Fix Out-Of-Memory errors on some integrated GPUs --- intern/cycles/device/oneapi/device_impl.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/intern/cycles/device/oneapi/device_impl.cpp b/intern/cycles/device/oneapi/device_impl.cpp index c1081e428b5..a80c2cf3c1c 100644 --- a/intern/cycles/device/oneapi/device_impl.cpp +++ b/intern/cycles/device/oneapi/device_impl.cpp @@ -207,9 +207,13 @@ void OneapiDevice::build_bvh(BVH *bvh, Progress &progress, bool refit) size_t OneapiDevice::get_free_mem() const { - /* Accurate: Use device info. */ + /* Accurate: Use device info, which is practically useful only on dGPU. + * This is because for non-discrete GPUs, all GPU memory allocations would + * be in the RAM, thus having the same performance for device and host pointers, + * so there is no need to be very accurate about what would end where. */ const sycl::device &device = reinterpret_cast(device_queue_)->get_device(); - if (device.has(sycl::aspect::ext_intel_free_memory)) { + const bool is_integrated_gpu = device.get_info(); + if (device.has(sycl::aspect::ext_intel_free_memory) && is_integrated_gpu == false) { return device.get_info(); } /* Estimate: Capacity - in use. */