Skip to content

Commit 02b7655

Browse files
authored
Fix Linux Distro discovery paths (#402)
Signed-off-by: Neil R. Spruit <[email protected]>
1 parent c62a194 commit 02b7655

File tree

5 files changed

+67
-11
lines changed

5 files changed

+67
-11
lines changed

.github/workflows/build-quick.yml

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,62 @@ permissions: read-all
1010
jobs:
1111
build-linux:
1212
if: github.repository_owner == 'oneapi-src'
13-
runs-on: [ubuntu-latest]
13+
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
container:
18+
- ubuntu:22.04
19+
- ubuntu:24.04
20+
- redhat/ubi9:latest
21+
container:
22+
image: ${{ matrix.container }}
1423
steps:
24+
- name: Install dependencies
25+
run: |
26+
if [ -f /etc/redhat-release ]; then
27+
# RHEL/UBI-based system
28+
yum install -y gcc gcc-c++ cmake make git
29+
else
30+
# Ubuntu-based system
31+
apt-get update
32+
apt-get install -y build-essential cmake git
33+
fi
1534
- uses: actions/checkout@v3
16-
- uses: hendrikmuhs/ccache-action@v1
17-
- name: Build Loader on Latest Ubuntu
35+
- name: Build Loader on ${{ matrix.container }}
1836
run: |
1937
mkdir build
2038
cd build
2139
cmake \
22-
-D CMAKE_C_COMPILER_LAUNCHER=ccache \
23-
-D CMAKE_CXX_COMPILER_LAUNCHER=ccache \
2440
-D CMAKE_BUILD_TYPE=Release \
2541
-D BUILD_L0_LOADER_TESTS=1 \
42+
-D INSTALL_NULL_DRIVER=1 \
2643
..
2744
make -j$(nproc)
2845
- env:
2946
ZEL_LIBRARY_PATH: '${{ github.workspace }}/build/lib'
3047
working-directory: build
3148
run: ctest -V
32-
- working-directory: build
33-
run: sudo make install
49+
- name: Install loader and NULL driver
50+
working-directory: build
51+
run: make install
52+
- name: Update library cache
53+
run: ldconfig
54+
- name: Test installed loader with zello_world and NULL driver
55+
working-directory: build
56+
run: |
57+
58+
# Set up environment for NULL driver
59+
export ZE_ENABLE_NULL_DRIVER=1
60+
export ZE_ENABLE_LOADER_DEBUG_TRACE=1
61+
62+
# Run zello_world with NULL driver
63+
./bin/zello_world
64+
65+
echo "✓ zello_world ran successfully with installed loader and NULL driver"
66+
- name: Uninstall loader
67+
working-directory: build
68+
run: make uninstall || xargs rm -v < install_manifest.txt
3469

3570
build-windows:
3671
if: github.repository_owner == 'oneapi-src'

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Level zero loader changelog
2+
## v1.26.2
3+
* fix: fix Driver Search Paths for all Linux Distros
24
## v1.26.1
35
* fix: Init DDI Tables during constructor
46
## v1.26.0

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if(MSVC AND (MSVC_VERSION LESS 1900))
1313
endif()
1414

1515
# This project follows semantic versioning (https://semver.org/)
16-
project(level-zero VERSION 1.26.1)
16+
project(level-zero VERSION 1.26.2)
1717
include(GNUInstallDirs)
1818

1919
find_package(Git)

PRODUCT_GUID.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
1.26.1
2-
600ff616-cc9c-4f9e-b5f8-1dc04132c971
1+
1.26.2
2+
cf85b8de-e9c1-4d88-9f18-7164098e1c1e

source/loader/linux/driver_discovery_lin.cpp

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,29 @@ static std::vector<std::string> getLibrarySearchPaths() {
4646
auto split = splitPaths(ldLibPath);
4747
paths.insert(paths.end(), split.begin(), split.end());
4848
}
49-
// Standard locations
49+
// Standard locations - Common across all Linux distributions
5050
paths.push_back("/lib");
5151
paths.push_back("/usr/lib");
5252
paths.push_back("/usr/local/lib");
53+
54+
// Multi-arch paths for Ubuntu/Debian
55+
paths.push_back("/lib/x86_64-linux-gnu");
56+
paths.push_back("/usr/lib/x86_64-linux-gnu");
57+
paths.push_back("/lib/i386-linux-gnu");
58+
paths.push_back("/usr/lib/i386-linux-gnu");
59+
paths.push_back("/lib/aarch64-linux-gnu");
60+
paths.push_back("/usr/lib/aarch64-linux-gnu");
61+
62+
// 64-bit library paths for RHEL/CentOS/Fedora
63+
paths.push_back("/lib64");
64+
paths.push_back("/usr/lib64");
65+
paths.push_back("/usr/local/lib64");
66+
67+
// Flatpak/Snap paths for containerized applications
68+
paths.push_back("/var/lib/flatpak/runtime");
69+
paths.push_back("/snap/core/current/lib");
70+
paths.push_back("/snap/core/current/usr/lib");
71+
5372
// /etc/ld.so.conf and included files
5473
std::ifstream ldSoConf("/etc/ld.so.conf");
5574
if (ldSoConf) {

0 commit comments

Comments
 (0)