Skip to content
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

NVML: Handle Unsupported GPU Serial #17

Merged
merged 1 commit into from
Oct 11, 2018
Merged

Conversation

ax3l
Copy link
Member

@ax3l ax3l commented Oct 11, 2018

Catch errors if NVML can not query the device serial number, e.g. on Quadro, Mobile or other product lines.

Fix #16

Catch errors if NVML can not query the device serial number, e.g.
on Quadro, Mobile or other product lines.
@ax3l ax3l force-pushed the fix-nvmlUnsupportedDevice branch from 9499b0a to 86303be Compare October 11, 2018 10:52

unsigned int serialLength = NVML_DEVICE_SERIAL_BUFFER_SIZE;
NVML_CHECK(nvmlDeviceGetSerial( devHandle, serial, serialLength ));
unsigned int serialLength = NVML_DEVICE_SERIAL_BUFFER_SIZE;
Copy link
Member Author

@ax3l ax3l Oct 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

constant is 30

Safe std::strncpy used below with a string that is 28 chars and is therefore usually not cropped. Null-added manuall in case it gets cropped.

@ax3l ax3l changed the title NVML: Handle Unsupported GPU NVML: Handle Unsupported GPU Serial Oct 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants