NVIDIA / go-nvml

Go Bindings for the NVIDIA Management Library (NVML)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

check GetMemoryInfo_v2 support

zxldev opened this issue · comments

When get memory information, how can I determine whether to use GetMemoryInfo_v2 or GetMemoryInfo?

Can the lib.Lookup() method be made public? This way, I can use lib.Lookup("nvmlDeviceGetMemoryInfo_v2") to check if v2 is supported.

or, mark it in Init method as public var,

The choice between the two depends on whether you need the additional info that the v2 struct provides. Note that running GetLibrary().Lookup("nvmlDeviceGetMemoryInfo_v2") should do what you wanted.

Note that because the function signatures are not equivalent, we cannot alias GetMemoryInfo to the different versions based on availability.