From 975d61daf3dba32e40ee0427426d261e09632bbe Mon Sep 17 00:00:00 2001 From: Alaska Date: Sat, 5 Apr 2025 14:06:40 +0200 Subject: [PATCH] Cycles: Disable MNEE on RDNA4 GPUs At the moment MNEE locks up Cycles, or has rendering artifacts on RDNA4 GPUs on WIndows. This commit disables MNEE on that configuration until a fix is avaliable. Pull Request: https://projects.blender.org/blender/blender/pulls/136980 --- intern/cycles/device/hip/device.cpp | 9 ++++++++- intern/cycles/device/hip/util.h | 8 ++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/intern/cycles/device/hip/device.cpp b/intern/cycles/device/hip/device.cpp index 8086c1eb169..983d2e6ea24 100644 --- a/intern/cycles/device/hip/device.cpp +++ b/intern/cycles/device/hip/device.cpp @@ -170,8 +170,15 @@ void device_hip_info(vector &devices) const bool is_rdna2_or_newer = hipIsRDNA2OrNewer(num); - /* Disable on RDNA1 due to apparent bug in HIP SDK 6.3. */ + /* Disable MNEE on devices that don't work properly with it. + * Common symptoms are either rendering artifacts, + * or renders that get stuck in the MNEE kernel. + * These are most likely compiler bugs and can be re-enabled in the future. */ +# ifdef _WIN32 + info.has_mnee = is_rdna2_or_newer && !hipIsRDNA4OrNewer(num); +# else info.has_mnee = is_rdna2_or_newer; +# endif info.has_nanovdb = true; info.has_gpu_queue = true; diff --git a/intern/cycles/device/hip/util.h b/intern/cycles/device/hip/util.h index 7c4d776cc1d..1485335a424 100644 --- a/intern/cycles/device/hip/util.h +++ b/intern/cycles/device/hip/util.h @@ -77,6 +77,14 @@ static inline bool hipIsRDNA2OrNewer(const int hipDevId) return (major > 10 || (major == 10 && minor >= 3)); } +static inline bool hipIsRDNA4OrNewer(const int hipDevId) +{ + int major; + hipDeviceGetAttribute(&major, hipDeviceAttributeComputeCapabilityMajor, hipDevId); + + return (major >= 12); +} + static inline bool hipNeedPreciseMath(const std::string &arch) { # ifdef _WIN32