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

Load NVML lib at runtime #12

Closed
Cldfire opened this issue May 19, 2020 · 4 comments · Fixed by #14
Closed

Load NVML lib at runtime #12

Cldfire opened this issue May 19, 2020 · 4 comments · Fixed by #14

Comments

@Cldfire
Copy link
Owner

Cldfire commented May 19, 2020

Right now this crate can only be used as an optional compile-time dependency on Linux and / or Windows. This makes it impossible both to build a binary that can be distributed cross-platform and to build a binary that can decide at runtime whether or not it is possible to get GPU info.

This crate needs to be moved to a dlopen-style approach where symbols are obtained at runtime, something that is unfortunately going to be a lot of work. It'll hopefully become somewhat tractable if and when this bindgen issue is resolved.

If I have the time and motivation + bindgen or some other tool makes the process more streamlined, I will invest the time into re-working the crate.

(Note that I may also end up dropping a lot of the more niche API surface upon making this migration in order to focus my time on supporting the more commonly-used functionality.)

@Cldfire Cldfire changed the title Dynamically load NVML library Load NVML lib at runtime Oct 27, 2020
@jgrund
Copy link

jgrund commented Nov 30, 2020

Looks like rust-lang/rust-bindgen#1541 has been resolved and is incorporated into the 0.5.6 release of bindgen

@Cldfire
Copy link
Owner Author

Cldfire commented Nov 30, 2020

Wonderful! Thanks for the heads up.

I'll give the new bindgen feature a poke tonight and see what using it looks like in practice.

@Cldfire Cldfire linked a pull request Dec 2, 2020 that will close this issue
@Cldfire
Copy link
Owner Author

Cldfire commented Dec 4, 2020

Support for loading the NVML library at runtime has landed in master; thanks to @RDruon for all their work in #14!

There are some things left for me to take care of before I can release 0.7.0, but it shouldn't be too long from now.

@Cldfire
Copy link
Owner Author

Cldfire commented Dec 7, 2020

0.7.0 has been published!

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

Successfully merging a pull request may close this issue.

2 participants