[Bf-blender-cvs] [41a3e98c11c] cycles_oneapi: Cycles: don't preload sycl library
Xavier Hallade
noreply at git.blender.org
Tue May 31 20:56:51 CEST 2022
Commit: 41a3e98c11cf878f4e5298de205b786247ad5bab
Author: Xavier Hallade
Date: Tue May 31 20:25:31 2022 +0200
Branches: cycles_oneapi
https://developer.blender.org/rB41a3e98c11cf878f4e5298de205b786247ad5bab
Cycles: don't preload sycl library
it's already a dependency of the kernel library and path issues are
fixed on both linux and windows.
===================================================================
M intern/cycles/device/oneapi/device.cpp
===================================================================
diff --git a/intern/cycles/device/oneapi/device.cpp b/intern/cycles/device/oneapi/device.cpp
index 88d91d12ecd..2db86e30d07 100644
--- a/intern/cycles/device/oneapi/device.cpp
+++ b/intern/cycles/device/oneapi/device.cpp
@@ -24,12 +24,10 @@ static OneAPIDLLInterface oneapi_dll;
#endif
#ifdef _WIN32
-# define LOAD_SYCL_SHARED_LIBRARY() (void *)(LoadLibrary(TEXT("sycl.dll")))
# define LOAD_ONEAPI_SHARED_LIBRARY(path) (void *)(LoadLibrary(path))
# define FREE_SHARED_LIBRARY(handle) FreeLibrary((HMODULE)handle)
# define GET_SHARED_LIBRARY_SYMBOL(handle, name) GetProcAddress((HMODULE)handle, name)
#elif __linux__
-# define LOAD_SYCL_SHARED_LIBRARY() dlopen("libsycl.so", RTLD_LAZY)
# define LOAD_ONEAPI_SHARED_LIBRARY(path) dlopen(path, RTLD_NOW)
# define FREE_SHARED_LIBRARY(handle) dlclose(handle)
# define GET_SHARED_LIBRARY_SYMBOL(handle, name) dlsym(handle, name)
@@ -40,15 +38,6 @@ bool device_oneapi_init()
#if !defined(WITH_ONEAPI)
return false;
#else
- void *lib_handle = LOAD_SYCL_SHARED_LIBRARY();
-
- // If sycl shared library can't be found, then disable oneAPI rendering completely
- if (lib_handle == NULL) {
- VLOG(1) << "oneAPI shared library has not been found, so oneAPI rendering will be disabled";
- return false;
- }
-
- FREE_SHARED_LIBRARY(lib_handle);
string lib_path = path_get("lib");
# ifdef _WIN32
@@ -56,7 +45,7 @@ bool device_oneapi_init()
# else
lib_path = path_join(lib_path, "cycles_kernel_oneapi.so");
# endif
- lib_handle = LOAD_ONEAPI_SHARED_LIBRARY(lib_path.c_str());
+ void *lib_handle = LOAD_ONEAPI_SHARED_LIBRARY(lib_path.c_str());
// This shouldn't happens, but still make sense to have a branch for this
if (lib_handle == NULL) {
More information about the Bf-blender-cvs
mailing list