bheisler / RustaCUDA

Rusty wrapper for the CUDA Driver API
Apache License 2.0
758 stars 60 forks source link

Adding support for getting the UUID #55

Closed vmx closed 2 years ago

vmx commented 3 years ago

Currently there is no way to get the UUID of a device. I'd like to add this feature.

It's a matter of calling cuDeviceGetUuid(), which is already part of cuda-sys. There is also a cuDeviceGetUuid_v2(), but that's a very recent addition (CUDA 11.4), so I would ignore it for now as cuda-sys is on CUDA 10.2 anyway.

I would implement Device::uuid(), similarly to the existing Device::name().

Though cuDeviceGetUuid() is only available on cuda-driver-sys 0.3, which seems to be the successor of cuda-sys 0.2. Upgrading to it seems to work with minimal changes, I can also provide a PR for that (my current version of those changes is at https://github.com/vmx/RustaCUDA/tree/uuid).

bheisler commented 3 years ago

Hello! Thanks for the suggestion. Yes, a pull request would be welcome.