LockerGnomeTech news and nostalgia for today's technology professionals
Subscribe

Search

Software

Chimera Linux fixed an NVIDIA hang by moving a lock’s type information

A borrowed graphics card exposed a subtle binary mismatch after the loader errors had already been cleared.

Chris uses tongs to move a glowing pin into the right slot of a giant padlock.
Illustration: LockerGnome

The borrowed GTX 980 Ti finally reached the test bench, and anything graphical hung. The driver could load far enough to look promising. Then a lock locked its own caller out. Very exclusive.

Chimera Linux’s November 6 development account follows the work needed to run NVIDIA’s proprietary user-space driver on a distribution built around musl. NVIDIA ships those binaries for glibc, a different C library. Sharing a Linux kernel doesn’t magically give two libraries the same internal furniture.

The developer had assembled a machine around a girlfriend’s old graphics card to test the integration. A debugger traced the hang into a mutex operation. The code was entering a lock it already held, which should work when that lock is configured as recursive.

The two libraries understood the relevant type value but put it in different places. In the layout shown in the post, glibc’s static initializer populated a later integer field. Musl read the first. That is the software equivalent of an address label arriving in the contents of the envelope: the information made the trip, and the recipient still couldn’t use it.

The repair adds a shim that checks the unused field and atomically copies the type into musl’s expected location when needed. The packaged driver libraries are redirected through the shim for the affected lock operations. No need to persuade the graphics card to become less recursive.

The lock fix came after several other obstacles. Dependency rewriting, missing compatibility symbols and dynamic-linker behavior had already needed attention. That sequence matters if you’re tempted to read the headline as a single clever patch that makes every musl installation an NVIDIA workstation by dinnertime.

A binary boundary can fail before entry, during initialization or only after a specific call. Each successful stage narrows the remaining problem; it doesn’t certify the stages that haven’t run yet. Anyone maintaining packages can recognize the temptation to celebrate when the loader finally shuts up (a moving occasion).

The source captures that temptation with “That means we’re done, right?” More work followed. The account is useful precisely because the author records what the apparently clean checks failed to establish, rather than presenting the successful screenshot as the whole development process.

The packaging remains unfinished, with more refinement and testing called for in the post. The developer reports a working legacy-card test, while newer-driver and AArch64 results include reports from others. Those boundaries belong beside the success, especially for anyone deciding which computer to entrust to it.

More GPU generations and application paths could expose another assumption after this one. The immediate win is tangible, though: a driver expecting a recursive lock finally gets the type information it was already carrying. Compatibility sometimes comes down to opening the right drawer.

The borrowed card finally drew something.

More Software

Every Software story →