Importing pyzes fails because _LoadZeLibrary() hardcodes /usr/lib/x86_64-linux-gnu/lib

Open Beginner friendly
#485 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
python

Research direction

Search for _LoadZeLibrary() and the hardcoded libName construction shown in the issue. Start by reading how pyzes imports the Level Zero loader, then verify that library discovery works without assuming /usr/lib/x86_64-linux-gnu; done means importing pyzes succeeds on systems where the loader is installed elsewhere.

Written by the indexing model from the issue text.

Description

Current code:
libName = "/usr/lib/x86_64-linux-gnu/lib" + libName + ".so.1"

Results in this:

OSError: /usr/lib/x86_64-linux-gnu/libze_loader.so.1:
cannot open shared object file

Replacing the hardcoded path with something like:

from ctypes.util import find_library
libName = find_library("ze_loader")

fixes the issue.

Dominant language
C++
Stars
335
Forks
140
Avg merge
12h 32m
Merged PRs (30d)
5

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from oneapi-src/level-zero

All issues in oneapi-src/level-zero

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.