-
-
Notifications
You must be signed in to change notification settings - Fork 65
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
Add functions to interact with external memory #152
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great to me. I'm inclined to merge this. Left a few questions.
Also this seems kind of like a mmap functionality in cuda? Am I interpreting this right? In llama-dfdx I've been experimenting with using mmap on CPU to not actually allocate on heap. Could this functionality be used to do something similar with cuda?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice addition, thanks for the contribution 👍
crate::driver::result
in a newexternal_memory
module which wrap raw bindings for interacting with external memory.ExternalMemory
andMappedBuffer
which abstract away interactions with external memory and to manage cleanup on drop.I did not add any tests because I don't yet know how to get a valid file descriptor using only CUDA. At least I confirmed that this interface works with a file descriptor exported from Vulkan (via
vulkano
crate). The code exists in my repo https://github.com/ViliamVadocz/nvidia-video-codec-sdk on thecudarc-external-memory
branch (very experimental and unorganized).