Skip to content

Don't extend LD_LIBRARY_PATH with the NEO directory - #789

Merged
maleadt merged 1 commit into
mainfrom
ld_library
Dec 3, 2026
Merged

maleadt merged 1 commit into
mainfrom
ld_library

Conversation

@maleadt

@maleadt maleadt commented Dec 2, 2026

Copy link
Copy Markdown
Member

__init__ prepended the NEO driver's directory to LD_LIBRARY_PATH. That has no effect on the running process, since glibc reads the variable at startup; in-process discovery of the driver (for libsycl's bundled Level Zero loader) is handled by dlopen'ing NEO by full path, added in #574. Child processes did inherit the variable, though. With NEO_jll pointed at a system driver, e.g. in /lib64, that directory then took precedence over every JLL's RUNPATH in precompile workers and Pkg.test, so bundled libraries resolved their dependencies against older system copies:

could not load library ".../lib/libSPIRV-Tools-diff.so"
/usr/lib/libSPIRV-Tools-opt.so: undefined symbol: _ZNK8spvtools5utils9BitVectoreqERKS1_
during initialization of module SPIRV_Tools_jll

This removes the LD_LIBRARY_PATH change instead of limiting it to the artifact driver: a child process that needs NEO loads oneAPI.jl and performs the same dlopen itself, so the variable serves no purpose there either. A test checks that the driver directory isn't on LD_LIBRARY_PATH after loading.

Tested locally on an Arc A770 with the bundled NEO, and with NEO_jll/libigc_jll preferences pointing at the system driver in /usr/lib (which reproduced the error above before this change).

Fixes #778.

The variable has no effect on the running process, since glibc reads it
at startup, and the in-process driver discovery it was meant for is now
handled by dlopen'ing NEO by full path. Child processes did inherit it,
though. With NEO_jll pointed at a system driver in e.g. /usr/lib64, that
directory took precedence over every JLL's RUNPATH in precompile workers
and Pkg.test, so bundled libraries such as SPIRV_Tools_jll resolved their
dependencies against older system copies and failed to load. Children
that need NEO load oneAPI.jl and perform the same dlopen themselves.

Fixes #778.
@codecov

codecov Bot commented Dec 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.90%. Comparing base (78d070d) to head (a62c25e).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #789      +/-   ##
==========================================
- Coverage   86.90%   86.90%   -0.01%     
==========================================
  Files          55       55              
  Lines        5103     5093      -10     
==========================================
- Hits         4435     4426       -9     
+ Misses        668      667       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@maleadt
maleadt merged commit 81fc9ea into main Dec 3, 2026
10 checks passed
@maleadt
maleadt deleted the ld_library branch December 3, 2026 05:40
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

Successfully merging this pull request may close these issues.

With a system NEO in /lib64, the LD_LIBRARY_PATH change in __init__ breaks precompilation in child processes

1 participant