Skip to content

Commit 68058ce

Browse files
authored
Merge pull request #87 from dims/fix/addressing-mode-hassymbol-guard
device: add hasSymbol guard to GetAddressingModeAsString
2 parents d0c20b7 + 3c44080 commit 68058ce

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

pkg/nvlib/device/device.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,11 @@ func (d *device) GetBrandAsString() (string, error) {
149149

150150
// GetAddressingModeAsString returns the Device addressing mode as a string.
151151
func (d *device) GetAddressingModeAsString() (string, error) {
152-
mode, ret := d.GetAddressingMode()
152+
if !d.lib.hasSymbol("nvmlDeviceGetAddressingMode") {
153+
return "", nil
154+
}
155+
156+
mode, ret := nvml.Device(d).GetAddressingMode()
153157

154158
switch ret {
155159
case nvml.SUCCESS:

0 commit comments

Comments
 (0)