Fix the bug that some functions do not populate the Version field, resulting in failure of the call.#130
Fix the bug that some functions do not populate the Version field, resulting in failure of the call.#130xxsoul wants to merge 3 commits intoNVIDIA:mainfrom
Conversation
…ed a value(must be nvmlProcessDetailList_v1) when calling the underlying nvmlDeviceGetRunningProcessDetailList function.
pkg/nvml/nvml.go
Outdated
| // nvmlDeviceGetRunningProcessDetailList function as declared in nvml/nvml.h | ||
| func nvmlDeviceGetRunningProcessDetailList(nvmlDevice nvmlDevice, Plist *ProcessDetailList) Return { | ||
| cnvmlDevice, _ := *(*C.nvmlDevice_t)(unsafe.Pointer(&nvmlDevice)), cgoAllocsUnknown | ||
| Plist.Version = C.nvmlProcessDetailList_v1 |
There was a problem hiding this comment.
This should not be set here. This is generated code. It needs to be set in the wrapper passed into this function.
There was a problem hiding this comment.
Is it possible to add logic to set the version in file "device.go"? I noticed from nvml.h that nvmlProcessDetailList_v1 is actually calculated by the macro definition (size_of(nvmlProcessDetailList_v1_t) | (1 << 24)), and it looks like we need to define some constants to hold such kind of values.
There was a problem hiding this comment.
I imagine it can be done the same as here: https://github.com/NVIDIA/go-nvml/blob/main/pkg/nvml/device.go#L826
There was a problem hiding this comment.
Ingenious way, I reworked my submission as in code :-)
…ed a value(must be nvmlEccSramErrorStatus_v1) when calling the underlying nvmlDeviceGetSramEccErrorStatus function.
…sulting in failure of the call.
|
@xxsoul could you please sign-off your contributions as required by the DCO? |
|
Alternatively I will re-implement this in a follow-up. |
Fix the bug that the Version field of ProcessDetailList is not assigned a value(must be nvmlProcessDetailList_v1) when calling the underlying nvmlDeviceGetRunningProcessDetailList function.
If the value is not populated (default is 0), the function will return nvmlReturn_t=25(Argument version mismatch)