You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like nvmlDeviceGetPciInfo is returning an instance of nvmlPciInfo_t, which has a busId field that is a bytes object. This is the expected behavior, as the busId field represents the PCI bus identifier of the device and it is typically stored as a string of hexadecimal digits.
If you want to convert the busId field to a string, you can use the decode method of the bytes object. For example:
This will convert the busId field to a string encoded in UTF-8. You can use a different encoding if necessary.
It looks like the code you provided is trying to convert the entire nvmlPciInfo_t object to a string, but this may not work as expected because the nvmlPciInfo_t object contains fields of different types (e.g. busId is bytes, domain is an integer, etc.). It might be better to manually extract the individual fields of the nvmlPciInfo_t object and convert them to strings as needed.
When I call nvmlDeviceGetPciInfo(handle) function the "busId" is "bytes" not "str"
The whole nvmlPciInfo_t is:
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
The text was updated successfully, but these errors were encountered: