Commit Graph

21 Commits

Author SHA1 Message Date
Fabian Zwoliński ea5b586c37 fix: move pathExists out of sys calls and do not mock it
Moved pathExists from SysCalls to path.h.
In ULTs, use unchanged pathExists and mock stat, getFileAttributesA instead.
Add Windows and Linux ULTs for pathExists.

Signed-off-by: Fabian Zwoliński <fabian.zwolinski@intel.com>
2024-09-10 19:24:45 +02:00
Fabian Zwolinski 52430762ac fix: cl_cache L0 env vars + refactor code structure
Added support for new Compiler Cache
environment variables in Level Zero.

Moved
`opencl/source/compiler_interface/default_cache_config.cpp`
`level_zero/core/source/compiler_interface/default_cache_config.cpp`
to shared directory
`source/compiler_interface/default_cache_config.cpp`

Switched enabling cache by default from per OS to per API.
Changed default state of cl_cache in Level Zero to disabled.

Related-To: NEO-10045
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
2024-03-01 17:35:08 +01:00
Fabian Zwolinski ee53bf0839 fix: linux cl_cache eviction mechanism
Fixed and refactored eviction mechanism works as follows:
- eviction is needed only if
total size of cache binaries + size of the new binary exceed cache limit
- single evition call removes files with a summed size of 1/3 of the cache limit
- if new binary can not fit in the cache size limit
even after eviction, it will not be saved
- cache limit applies only to
files in cache directory with .cl_cache/.l0_cache extension.
Only these files are counted and only these files are removed

Minor:
- rename variables for better readability
- add `const` where possible

Related-To: NEO-4262
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
2023-12-05 09:35:48 +01:00
Mateusz Jablonski c9664e6bad refactor: rename global debug manager to debugManager
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2023-11-30 13:00:59 +01:00
Compute-Runtime-Validation 1395a2cb38 Revert "refactor: linux cl_cache eviction mechanism"
This reverts commit a02ac1c140.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2023-11-28 08:51:36 +01:00
Fabian Zwolinski a02ac1c140 refactor: linux cl_cache eviction mechanism
Refactored eviction mechanism works as follows:
- eviction is needed only if
total size of cache binaries + size of the new binary exceed cache limit
- single evition call removes files with a summed size of 1/3 of the cache limit
- if new binary can not fit in the cache size limit
even after eviction, it will not be saved
- cache limit applies only to
files in cache directory with .cl_cache/.l0_cache extension.
Only these files are counted and only these files are removed

Minor:
- rename variables for better readability
- add `const` where possible

Related-To: NEO-4262
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
2023-11-27 18:20:41 +01:00
Compute-Runtime-Validation a8d404f859 Revert "refactor: linux cl_cache eviction mechanism"
This reverts commit 2aa0ae0eca.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2023-11-18 01:13:12 +01:00
Fabian Zwolinski 2aa0ae0eca refactor: linux cl_cache eviction mechanism
Refactored eviction mechanism works as follows:
- eviction is needed only if
total size of cache binaries + size of the new binary exceed cache limit
- single evition call removes files with a summed size of 1/3 of the cache limit
- if new binary can not fit in the cache size limit
even after eviction, it will not be saved
- cache limit applies only to
files in cache directory with .cl_cache/.l0_cache extension.
Only these files are counted and only these files are removed

Minor:
- rename variables for better readability
- add `const` where possible

Related-To: NEO-4262
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
2023-11-17 09:48:42 +01:00
Fabian Zwolinski 1f1af5bb36 refactor: windows cl_cache eviction mechanism
Refactored eviction mechanism works as follows:
- eviction is needed only if
total size of cache binaries + size of the new binary exceed cache limit
- single evition call removes files with a summed size of 1/3 of the cache limit
- if new binary can not fit in the cache size limit
even after eviction, it will not be saved
- cache limit applies only to
files in cache directory with .cl_cache/.l0_cache extension.
Only these files are counted and only these files are removed

Related-To: NEO-8092
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
2023-10-03 16:20:28 +02:00
Fabian Zwolinski e96dd344c3 feature: add new environment variables for compiler cache on Windows
Changes:
- replaced registry keys with environment variables
for cl_cache in OCL
- added compiler cache helpers
- implemented support for new env vars on Windows
- added tests

New env vars mechanism works as follows:
If `PERSISTENT_CACHE` is set,
driver checks if `NEO_CACHE_DIR` is set.
If `NEO_CACHE_DIR` is not set,
driver uses `%LocalAppData%\NEO\neo_compiler_cache`
as `cl_cache` destination folder.
If `NEO_CACHE_DIR` is not set and `%LocalAppData%`
path could not be obtained,
compiler cache is disabled.

In the current Windows implementation,
special characters in the folder path are not supported.

Related-To: NEO-8092
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
2023-09-21 12:40:48 +02:00
Fabian Zwolinski 0538f0524a refactor: make os_handle.h non os specific
Use the same file `os_handle.h` on both
Linux and Windows.
Change implementation of `HandleType` -> `UnifiedHandle` to
`std::variant<int, void *>`
use `int` on Linux
use `void *` on Windows

Related-To: NEO-8092
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
2023-09-15 15:53:41 +02:00
Fabian Zwolinski 0dd40b8616 refactor: Split compiler interface between OSs
Create new file:
`os_handle.h` which contains OS specific Handle type.
Add `shared/source/os_interface/<windows/linux>`
include directory to level_zero.

Related-To: NEO-8092
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
2023-09-12 15:56:53 +02:00
Fabian Zwolinski 10675134e1 feature: Add process safety to Windows compiler cache
Related-To: NEO-8092

Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
Co-authored-by: Diedrich, Kamil <kamil.diedrich@intel.com>
2023-09-06 15:34:15 +02:00
Kacper Kasper 269cba1659 feature: enable cl_cache by default on Linux
Resolves: NEO-4262

Signed-off-by: Kacper Kasper <kacper.k.kasper@intel.com>
2023-09-01 15:13:13 +02:00
Compute-Runtime-Validation 377d886c77 Revert "feature: enable cl_cache by default on Linux"
This reverts commit eeb8a5e1fb.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2023-09-01 04:58:52 +02:00
Kacper Kasper eeb8a5e1fb feature: enable cl_cache by default on Linux
Resolves: NEO-4262

Signed-off-by: Kacper Kasper <kacper.k.kasper@intel.com>
2023-08-31 15:52:11 +02:00
Kacper Kasper ba4867c3d0 fix: compiler cache file extension and path creation
* When env variables did not have trailing slash, directory creation
could fail.
* If .cache in $HOME did not exist cache would have been disabled.

Signed-off-by: Kacper Kasper <kacper.k.kasper@intel.com>
2023-08-31 13:44:19 +02:00
Kacper Kasper 996c261430 fix: OclocIgcFacade->getIgcRevision() could return nullptr
* Make sure igcRevision is always initialized.
* Improve coverage.

Signed-off-by: Kacper Kasper <kacper.k.kasper@intel.com>
2023-08-31 12:57:27 +02:00
Kacper Kasper 991febcdf4 fix: extend cache hash with compiler commit sha, lib size and mtime
Related-To: NEO-4262

Signed-off-by: Kacper Kasper <kacper.k.kasper@intel.com>
2023-08-22 15:28:57 +02:00
Diedrich, Kamil 5a4a2ab8ab feature: Add new environment variables for compiler cache
This patch add new environment variables to control compiler cache.
Works as follow: If persistent cache is set driver check if NEO_CACHE_DIR
is set. If not then driver checks XDG_CACHE_HOME - If exists
then driver create neo_compiler_cache folder, if
not then driver checks HOME directory. If each NEO_CACHE_DIR,
XDG_CACHE_HOME and HOME are not set then compiler cache is disabled.
Current support is for Linux only.

Signed-off-by: Diedrich, Kamil <kamil.diedrich@intel.com>

Related-To: NEO-4262
2023-05-12 10:21:27 +02:00
Diedrich, Kamil 26ca64bb28 Add process safety to cl_cache on Linux
Current flow will be to have one synchronization point
config.file. Read remains unblocking, only write(caching)
operation will be blocking (lock on config.file)

Related-To: NEO-4262

Signed-off-by: Diedrich, Kamil <kamil.diedrich@intel.com>
2023-04-25 17:35:40 +02:00