From 057e99d6dfc3b2bed70be24ebe28724bc6dca7f2 Mon Sep 17 00:00:00 2001 From: Nikita Sirgienko Date: Thu, 13 Oct 2022 10:49:07 +0200 Subject: 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. --- intern/cycles/kernel/CMakeLists.txt | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) 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 -- cgit v1.2.3