Documentation
¶
Index ¶
- func GetDevIdsFromTopology(fs FileSystem, topoRootParam ...string) map[int]string
- func GetUniqueIdToDeviceIndexMap() (map[string][]int, error)
- func GetUniqueIdToDeviceIndexMapWithFS(fs FileSystem) (map[string][]int, error)
- func ParseTopologyProperties(fs FileSystem, path string, re *regexp.Regexp) (int64, error)
- func ParseTopologyPropertiesString(fs FileSystem, path string, re *regexp.Regexp) (string, error)
- type AMDGPU
- type DefaultFS
- type DeviceInfo
- type FileSystem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDevIdsFromTopology ¶ added in v1.1.1
func GetDevIdsFromTopology(fs FileSystem, topoRootParam ...string) map[int]string
GetDevIdsFromTopology returns a map of render minor numbers to unique_ids
func GetUniqueIdToDeviceIndexMap ¶ added in v1.2.0
GetUniqueIdToDeviceIndexMap returns a map of unique_id (as hex string) to device indices
func GetUniqueIdToDeviceIndexMapWithFS ¶ added in v1.2.0
func GetUniqueIdToDeviceIndexMapWithFS(fs FileSystem) (map[string][]int, error)
GetUniqueIdToDeviceIndexMapWithFS creates a mapping from unique_id (hex format) to device indices
func ParseTopologyProperties ¶ added in v1.1.1
ParseTopologyProperties parses for a property value in kfd topology file as int64 The format is usually one entry per line <name> <value>.
func ParseTopologyPropertiesString ¶ added in v1.1.1
ParseTopologyPropertiesString parses for a property value in kfd topology file as string The format is usually one entry per line <name> <value>.
Types ¶
type AMDGPU ¶
type AMDGPU struct {
Path string
Major int64
Minor int64
FileMode os.FileMode
Gid uint32
Uid uint32
Allow bool
DevType string
Access string
}
AMDGPU collects device information of GPU
func GetAMDGPUWithFS ¶ added in v1.1.1
func GetAMDGPUWithFS(fs FileSystem, dev string) (AMDGPU, error)
type DefaultFS ¶ added in v1.1.1
type DefaultFS struct{}
DefaultFS implements FileSystem using actual filesystem operations
func (*DefaultFS) GetDeviceStat ¶ added in v1.1.1
type DeviceInfo ¶ added in v1.2.0
func GetAMDGPUs ¶
func GetAMDGPUs() ([]DeviceInfo, error)
GetAMDGPUs returns the lists of all the GPU devices on the system. All devices under the same "pci:amdgpu/[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]:*" directory are in a single list. There are as many such lists as the number of gpu directories under "pci:amdgpu/".
func GetAMDGPUsWithFS ¶ added in v1.1.1
func GetAMDGPUsWithFS(fs FileSystem) ([]DeviceInfo, error)
GetAMDGPUsWithFS is the internal implementation that takes a FileSystem interface. This split allows for better testability by enabling mock filesystem operations in unit tests, while keeping the public API simple with GetAMDGPUs.