4 ms·
It would be great if Rust people learned how to properly load GPU libraries first.
by max-privatevoid 1y ago
It would be great if Rust people learned how to properly load GPU libraries first.
- zbentley 1y agoSay more?
- max-privatevoid 1y agoRust GPU libraries such as wgpu and ash rely on external libraries such as vulkan-loader to load the actual ICDs, but for some reason Rust people really love dlopening them instead of linking to them normally. Then it's up to the consumer to configure their linker flags correctly so RPATH gets set correctly when needed, but because most people don't know how to use their linker, they usually end up with dumb hacks like these instead: https://github.com/Rust-GPU/rust-gpu/blob/87ea628070561f576aeef84c92a0e3e3c25d63ff/default.nix#L17-L24 https://github.com/Rust-GPU/rust-gpu/blob/87ea628070561f576a... https://github.com/gfx-rs/wgpu/blob/bf86ac3489614ed2b212ea2ff361dbf302c127dc/shell.nix#L64 https://github.com/gfx-rs/wgpu/blob/bf86ac3489614ed2b212ea2f...
- LegNeato 1y agoCan you file a bug on rust-gpu? I'd love to look into it (I am unfamiliar with this area).
- max-privatevoid 1y agoDone. https://github.com/Rust-GPU/rust-gpu/issues/351 https://github.com/Rust-GPU/rust-gpu/issues/351
- guipsp 1y agoWhere's the dumb hack?
- viraptor 1y agoIsn't it typically done with Vulkan, because apps don't know which library you wanted to use later? On a multi-gpu system you may want to switch (for example) Intel/NVIDIA implementation at runtime rather than linking directly.
- max-privatevoid 1y agoThat's the point of ICDs. That's why you link to e.g. vulkan-loader instead of directly to the driver library.