Advertisement
Guest User

Untitled

a guest
Apr 20th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #include <nvml.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <iostream>
  5.  
  6. int main(){
  7. nvmlInit();
  8. unsigned int cnt = 0;
  9. nvmlReturn_enum res = nvmlDeviceGetCount(&cnt);
  10. std::cout << res << std::endl;
  11. for(unsigned int i= 0; i < cnt; i++){
  12. nvmlDevice_t dev;
  13. res = nvmlDeviceGetHandleByIndex(i, &dev);
  14. std::cout << res << std::endl;
  15. char UUID[128] = {0};
  16. res = nvmlDeviceGetUUID(dev, UUID, 128);
  17. std::cout << res << std::endl;
  18. std::cout << i << " -> " << UUID << std::endl;
  19. }
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement