From eff4fe24cf2fcd5f09c2a061005aeb61119ea8e1 Mon Sep 17 00:00:00 2001 From: Alaska Date: Tue, 9 Apr 2024 16:19:24 +0200 Subject: [PATCH] Cycles: Properly default to Metal-RT off unless GPU is a M3 or newer Ever since commit [1], `use_metalrt_by_default` will be True if the GPU being used is not a M1 or M2 based system. The intention of this was to enable MetalRT by default for M3 and newer devices that have hardware for ray traversal. However the side effect of this change was that all AMD GPUs would have `use_metalrt_by_default` set to True. Which appears to be the main culprit causing crashes on older AMD GPUs in #120126. Since these GPUs don't support MetalRT. This commit fixes this issue by only setting `use_metalrt_by_default` to True if the GPU is not M1 or M2 based, and the GPU is Apple Silicon based. Which equates to M3 or newer. Which is the original intent of this code. This resolves the issue where AMD GPUs were being told to use MetalRT by default, when they shouldn't be. [1] 322a2f7b12bba610a70df3af90e236d0c0ef03f6 Pull Request: https://projects.blender.org/blender/blender/pulls/120299 --- intern/cycles/device/metal/device.mm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/intern/cycles/device/metal/device.mm b/intern/cycles/device/metal/device.mm index 1922932b453..a98011a3c85 100644 --- a/intern/cycles/device/metal/device.mm +++ b/intern/cycles/device/metal/device.mm @@ -77,8 +77,12 @@ void device_metal_info(vector &devices) if (@available(macos 14.0, *)) { info.use_hardware_raytracing = device.supportsRaytracing; - /* Use hardware raytracing for faster rendering on architectures that support it. */ - info.use_metalrt_by_default = (MetalInfo::get_apple_gpu_architecture(device) >= APPLE_M3); + info.use_metalrt_by_default = false; + if (vendor == METAL_GPU_APPLE) { + /* Use hardware raytracing for faster rendering on architectures that support it. */ + info.use_metalrt_by_default = (MetalInfo::get_apple_gpu_architecture(device) >= + APPLE_M3); + } } } # endif