[Bf-blender-cvs] [057e99d6dfc] master: Cycles: use one instance of oneAPI gpu compiler by default

Nikita Sirgienko noreply at git.blender.org
Thu Oct 13 10:50:02 CEST 2022


Commit: 057e99d6dfc3b2bed70be24ebe28724bc6dca7f2
Author: Nikita Sirgienko
Date:   Thu Oct 13 10:49:07 2022 +0200
Branches: master
https://developer.blender.org/rB057e99d6dfc3b2bed70be24ebe28724bc6dca7f2

Cycles: use one instance of oneAPI gpu compiler by default

This change removes CMake code for automatic calculation of the number
of offline device compiler instances, to hand over control to developers
instead as it incurs a rather large memory usage with around 8GB per
instance at peak.
Use SYCL_OFFLINE_COMPILER_PARALLEL_JOBS CMake variable to configure it.

===================================================================

M	intern/cycles/kernel/CMakeLists.txt

===================================================================

diff --git a/intern/cycles/kernel/CMakeLists.txt b/intern/cycles/kernel/CMakeLists.txt
index 8f50c7586b8..36c8b23d983 100644
--- a/intern/cycles/kernel/CMakeLists.txt
+++ b/intern/cycles/kernel/CMakeLists.txt
@@ -727,16 +727,9 @@ if(WITH_CYCLES_DEVICE_ONEAPI)
     ${SRC_UTIL_HEADERS}
   )
 
-  set (ONEAPI_OFFLINE_COMPILER_PARALLEL_JOBS 1)
+  set (SYCL_OFFLINE_COMPILER_PARALLEL_JOBS 1 CACHE STRING "Number of parallel compiler instances to use for device binaries compilation (expect ~8GB peak memory usage per instance).")
   if (WITH_CYCLES_ONEAPI_BINARIES)
-    cmake_host_system_information(RESULT AVAILABLE_MEMORY_AMOUNT QUERY AVAILABLE_PHYSICAL_MEMORY)
-    # Conservative value of peak consumption here, just to be fully sure that other backend compilers will have enough memory as well
-    set(ONEAPI_GPU_COMPILER_MEMORY_AT_PEAK_MB 8150)
-    math(EXPR ONEAPI_OFFLINE_COMPILER_PARALLEL_JOBS "${AVAILABLE_MEMORY_AMOUNT} / ${ONEAPI_GPU_COMPILER_MEMORY_AT_PEAK_MB}")
-    if (ONEAPI_OFFLINE_COMPILER_PARALLEL_JOBS LESS 1)
-      set(ONEAPI_OFFLINE_COMPILER_PARALLEL_JOBS 1)
-    endif()
-    message(STATUS "${ONEAPI_OFFLINE_COMPILER_PARALLEL_JOBS} instance(s) of oneAPI offline compiler will be used.")
+    message(STATUS "${SYCL_OFFLINE_COMPILER_PARALLEL_JOBS} instance(s) of oneAPI offline compiler will be used.")
   endif()
   # SYCL_CPP_FLAGS is a variable that the user can set to pass extra compiler options
   set(sycl_compiler_flags
@@ -747,7 +740,7 @@ if(WITH_CYCLES_DEVICE_ONEAPI)
       -mllvm -inlinedefault-threshold=250
       -mllvm -inlinehint-threshold=350
       -fsycl-device-code-split=per_kernel
-      -fsycl-max-parallel-link-jobs=${ONEAPI_OFFLINE_COMPILER_PARALLEL_JOBS}
+      -fsycl-max-parallel-link-jobs=${SYCL_OFFLINE_COMPILER_PARALLEL_JOBS}
       -shared
       -DWITH_ONEAPI
       -ffast-math



More information about the Bf-blender-cvs mailing list