Skip to content

Commit

Permalink
Merge branch 'upstream-fix-nvlink-bug' into 'master'
Browse files Browse the repository at this point in the history
Add check for INVALID_ARGUMENT in NvLink checks

See merge request nvidia/container-toolkit/gpu-monitoring-tools!27
  • Loading branch information
klueska committed Jul 17, 2020
2 parents 0e03b6a + cb5a78f commit f7f1d83
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bindings/go/nvml/bindings.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ func (h handle) deviceGetNvLinkState(link uint) (*uint, error) {
var isActive C.nvmlEnableState_t

r := C.nvmlDeviceGetNvLinkState(h.dev, C.uint(link), &isActive)
if r == C.NVML_ERROR_NOT_SUPPORTED {
if r == C.NVML_ERROR_NOT_SUPPORTED || r == C.NVML_ERROR_INVALID_ARGUMENT {
return nil, nil
}

Expand All @@ -330,7 +330,7 @@ func (h handle) deviceGetNvLinkRemotePciInfo(link uint) (*string, error) {
var pci C.nvmlPciInfo_t

r := C.nvmlDeviceGetNvLinkRemotePciInfo(h.dev, C.uint(link), &pci)
if r == C.NVML_ERROR_NOT_SUPPORTED {
if r == C.NVML_ERROR_NOT_SUPPORTED || r == C.NVML_ERROR_INVALID_ARGUMENT {
return nil, nil
}

Expand Down

0 comments on commit f7f1d83

Please sign in to comment.