Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <nvml.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <iostream>
- int main(){
- nvmlInit();
- unsigned int cnt = 0;
- nvmlReturn_enum res = nvmlDeviceGetCount(&cnt);
- std::cout << res << std::endl;
- for(unsigned int i= 0; i < cnt; i++){
- nvmlDevice_t dev;
- res = nvmlDeviceGetHandleByIndex(i, &dev);
- std::cout << res << std::endl;
- char UUID[128] = {0};
- res = nvmlDeviceGetUUID(dev, UUID, 128);
- std::cout << res << std::endl;
- std::cout << i << " -> " << UUID << std::endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement