Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It would be great if Rust people learned how to properly load GPU libraries first.


Say more?


Rust 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/87ea628070561f576a...

https://github.com/gfx-rs/wgpu/blob/bf86ac3489614ed2b212ea2f...


Isn'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.


That's the point of ICDs. That's why you link to e.g. vulkan-loader instead of directly to the driver library.


Can you file a bug on rust-gpu? I'd love to look into it (I am unfamiliar with this area).



Where's the dumb hack?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: