Skip to content

the type of nvmlDeviceGetPciInfo(handle).busId is "bytes" not "str" #23

@WangKunLoveReading

Description

@WangKunLoveReading

When I call nvmlDeviceGetPciInfo(handle) function the "busId" is "bytes" not "str"

 handle = nvmlDeviceGetHandleByIndex(i)
 devId = nvmlDeviceGetPciInfo(handle).busId

The whole nvmlPciInfo_t is:

nvmlPciInfo_t(busId: b'0000:00:0A.0', domain: 0x0000, bus: 0x00, device: 0x0A, pciDeviceId: 0x1EB810DE, pciSubSystemId: 0x12A210DE, reserved0: 0, reserved1: 0, reserved2: 0, reserved3: 0)

This line converts c_info to "str", but "busId" is "bytes"
https://github.com/fbcotter/py3nvml/blob/master/py3nvml/py3nvml.py#L2646

Is it expected output?

My test environment is python3.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions