[Bf-blender-cvs] [9f48de647ee] cycles_oneapi: Cycles oneAPI: filter to load only level_zero library

Xavier Hallade noreply at git.blender.org
Wed Jun 8 16:15:06 CEST 2022


Commit: 9f48de647ee0ce2a72d5c92ba6ade49642685b02
Author: Xavier Hallade
Date:   Wed Jun 8 16:09:55 2022 +0200
Branches: cycles_oneapi
https://developer.blender.org/rB9f48de647ee0ce2a72d5c92ba6ade49642685b02

Cycles oneAPI: filter to load only level_zero library

while we don't need nor ship pi_opencl.dll, users can still have one
version of it on their PATH and sycl will try to load it.
To play on the safe side, only what we ship is now allowed by default.
Users can still overwrite this by using SYCL_DEVICE_FILTER env variable.

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

M	intern/cycles/device/oneapi/device.cpp

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

diff --git a/intern/cycles/device/oneapi/device.cpp b/intern/cycles/device/oneapi/device.cpp
index 2473e7983a5..fb7ade1c240 100644
--- a/intern/cycles/device/oneapi/device.cpp
+++ b/intern/cycles/device/oneapi/device.cpp
@@ -86,12 +86,16 @@ bool device_oneapi_init()
   if (getenv("SYCL_CACHE_TRESHOLD") == nullptr) {
     _putenv_s("SYCL_CACHE_THRESHOLD", "0");
   }
+  if (getenv("SYCL_DEVICE_FILTER") == nullptr) {
+    _putenv_s("SYCL_DEVICE_FILTER", "host,level_zero");
+  }
   if (getenv("SYCL_PI_LEVEL_ZERO_USE_COPY_ENGINE_FOR_IN_ORDER_QUEUE") == nullptr) {
     _putenv_s("SYCL_PI_LEVEL_ZERO_USE_COPY_ENGINE_FOR_IN_ORDER_QUEUE", "0");
   }
 #  elif __linux__
   setenv("SYCL_CACHE_PERSISTENT", "1", false);
   setenv("SYCL_CACHE_THRESHOLD", "0", false);
+  setenv("SYCL_DEVICE_FILTER", "host,level_zero", false);
   setenv("SYCL_PI_LEVEL_ZERO_USE_COPY_ENGINE_FOR_IN_ORDER_QUEUE", "0", false);
 #  endif



More information about the Bf-blender-cvs mailing list