diff options
author | Xavier Hallade <xavier.hallade@intel.com> | 2022-06-08 17:09:55 +0300 |
---|---|---|
committer | Xavier Hallade <xavier.hallade@intel.com> | 2022-06-08 17:09:55 +0300 |
commit | 9f48de647ee0ce2a72d5c92ba6ade49642685b02 (patch) | |
tree | 30b3af5cddebfee61a2cacee4011a799ba2f0acb /intern/cycles | |
parent | e0ae2d042dd659f5651e0dc528581fb9b872656d (diff) |
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.
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/device/oneapi/device.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
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 |