Cycles: oneAPI: explicitly enable/disable SYSMAN

ZES_ENABLE_SYSMAN is supposed to be set for free_memory queries to be
available.
These queries are then optionally used since
759bb6c76879042ee15f9c26c820433611764988, for the host memory fallback
feature.
Setting SYCL_ENABLE_PCI was leading ZES_ENABLE_SYSMAN to be set by DPCPP
2022-12 but it's not used by newer versions of DPCPP.

We however temporarily disable SYSMAN by default on Linux as builds with
JEMALLOC enabled currently lead to driver runtime issues. These can be
worked around by using LD_PRELOAD=libigsc.so.
This commit is contained in:
Xavier Hallade 2024-05-30 11:51:24 +02:00
parent 0be9540775
commit db8021d61a

@ -50,8 +50,9 @@ bool device_oneapi_init()
_putenv_s("ONEAPI_DEVICE_SELECTOR", "!opencl:*");
}
}
if (getenv("SYCL_ENABLE_PCI") == nullptr) {
_putenv_s("SYCL_ENABLE_PCI", "1");
/* SYSMAN is needed for free_memory queries. */
if (getenv("ZES_ENABLE_SYSMAN") == nullptr) {
_putenv_s("ZES_ENABLE_SYSMAN", "1");
}
if (getenv("SYCL_PI_LEVEL_ZERO_USE_COPY_ENGINE") == nullptr) {
_putenv_s("SYCL_PI_LEVEL_ZERO_USE_COPY_ENGINE", "0");
@ -65,7 +66,9 @@ bool device_oneapi_init()
else {
setenv("ONEAPI_DEVICE_SELECTOR", "!opencl:*", false);
}
setenv("SYCL_ENABLE_PCI", "1", false);
/* SYSMAN is needed for free_memory queries. However, it leads to runtime driver issues on Linux
* when using it with JEMALLOC, so we set it to 0 by default until it's fixed. */
setenv("ZES_ENABLE_SYSMAN", "0", false);
setenv("SYCL_PI_LEVEL_ZERO_USE_COPY_ENGINE", "0", false);
# endif