vgpu apis - #130
Conversation
f3f0229 to
970027b
Compare
FreeMasen
left a comment
There was a problem hiding this comment.
I believe this is ready for an initial review to make sure I am not doing anything that goes against the goals of this project. I need to dig a little deeper into how testing works for this project to add additional test for these additions.
I am going to leave the Draft status until I can get through tests, any feedback would be welcome!
|
I'm happy to review this once it is ready. Once you're happy with it lmk. |
afce533 to
c6b1acb
Compare
|
I believe this is ready for review. I have tried to comment on any of the places where I wasn't quite sure about how something should be implemented. |
|
Thanks for the extensive work here — this is a high-quality contribution and I'd like to land it. I checked out the branch, merged current One real bug and a few smaller items before merge: Bug:
|
|
Thank you very much for your detailed review! I will address your comments as soon as I can |
|
I just pushed a fixup commit with the changes, let me know if I've covered it all and I can squash that commit |
|
Thanks for turning this around so quickly! I re-reviewed the two fixup commits against the branch locally. Note: this review was AI-assisted. I've verified the findings below myself — everything I claim about compilation, warnings, and formatting comes from actually building the branch. Fixed
Still to fix1.
|
|
Another fixup commit this morning for your review, let me know and I will rebase and force push for the merge |
|
Thanks! Looks good to me. Happy to merge after the rebase/force push. |
a776852 to
a7e7904
Compare
|
Rebased and pushed and CI has passed |
- instance_type() now takes &self instead of &'dev self, so calling it no longer borrows the VgpuInstance for the rest of the device's lifetime (e.g. iterating active_vgpus() and querying each instance's type now compiles) - active_vgpus() drops the unnecessary <'a> ... where 'a: 'nvml clause and returns VgpuInstance<'_> tied to the device borrow - VgpuInstance::new is now public with docs, mirroring VgpuType::new; this also removes the dead-code warning on non-Linux builds where the Linux-gated active_vgpus() was its only caller Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FVPWxFN8rioYb8JhreYQmJ
fix: vGPU borrow-ergonomics follow-ups from #130
This PR is an attempt to fully cover the vGPU APIs defined by nvml. To achieve this I've followed the patterns defined for
DeviceandVgpuTypeto cover all functions in theunwrapped_functions.txtfile that are namednvmlVgpu*The one exception here was
nvmlVgpuInstanceGetLicenseStatuswhich is deprecated and not documented at this time, if you'd like me to dig through older versions of the docs, I can find the documentation for how that API works.Please let me know if I've misunderstood any of the patterns I've tried to emulate and/or the API documentation, I would be happy to follow up with additional changes as needed.
Note: this is currently marked as a draft because I based these changes on #129 and will rebase once that merges or is declined