Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OneVPL dispatcher library path handling is non-standard / surprising to users #418

Open
eero-t opened this issue May 27, 2022 · 1 comment

Comments

@eero-t
Copy link

eero-t commented May 27, 2022

The problem

According to spec, both dispatcher library paths and their order is fixed, and can be changed only with an environment variable (either LD_LIBRARY_PATH, or ONEVPL_SEARCH_PATH) on Linux: https://spec.oneapi.io/versions/latest/elements/oneVPL/source/programming_guide/VPL_prg_session.html

Whereas user expectation is that libraries are automatically found from the paths they are installed.

For example, installing OneVPL media stack under standard /usr/local/ location, fails to work. Everything else installed there (e.g. 3d, compute and lower level media drivers), also work from there, but OneVPL does not. This is both non-standard and unexpected. It's also hard to debug, because OpenVPL dispatcher fails without even trying to load a single driver. See: intel/libvpl#56

Potential additional issues

Further issues from this design:

  • Intel discrete GPUs should be usable on multiple CPU architectures, for example both Intel and ARM. Is spec going add search paths for new architectures early enough that things keep working for these use-cases?

  • Typically driver stacks are all installed to the same location. Where libraries get loaded, is controlled by dynamic loader path order. OneVPL using it's own path search order means that it can load other backend than user intended, or be linked with wrong dependencies, unless same debugging override (=LD_LIBRARY_PATH) is used for both. While semantic versioning should protect from worst issues with that, smaller version differences can e.g. greatly harm bug reproduction and reliability of version info in bug reports

  • Environment variables are dropped at some security boundaries (e.g. sudo), which can cause mystery failures in production (things like LD_LIBRARY_PATH are meant for debugging & development, not really for production use)

  • (Linux distributions support multi-arch. I.e. there can be libraries for multiple partially compatible architectures, other than the host one, present in the standard system locations (e.g. 64-bit and 32-bit, or AVX512 and non-AVX512 for x86, and VFP and soft-FP for ARM). What if non-native VPL backends are loadable, but not fully working or with best performance, and use newer version numbers than the fully native ones?)

How more mature APIs deal with dispatching

There are more mature APIs with dispatchers than OneVPL, for example OpenGL, OpenCL and Vulkan.

Both of the above options fix the issues of:

  • Loader missing correct driver path for the host architecture
  • Drivers not being found when same install targets are given both to loader and drivers
  • Things stopping to work in situations where environment variables get dropped for security reasons
@MordragT
Copy link

I was rather surprised by this as well. I am trying to package the oneVPL for Nixos, but setting the rpath to the runtime is not working while LD_LIBRARY_PATH works fine. At least searching for the runtime in the directory where the library sits would be great. As it is now if i wanted to use oneVPL for another application in Nixos i would always need to specify the runtime with LD_LIBRARY_PATH, as nixos isn't using the FHS directories to package software.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants