Documentation
¶
Index ¶
- Constants
- Variables
- func Init()
- func Wait()
- type Ethernet
- type Ethernet20
- type GPU
- func (g GPU) Architecture() (string, error)
- func (g GPU) ClockRate() (int64, error)
- func (g GPU) ComputeCapability() (float64, error)
- func (g GPU) InterconnectBandwidth() (float64, error)
- func (g GPU) InterconnectName() (string, error)
- func (v GPU) MarshalEasyJSON(w *jwriter.Writer)
- func (v GPU) MarshalJSON() ([]byte, error)
- func (g GPU) MemoryBandwidth() (float64, error)
- func (g GPU) NumCores() (int, error)
- func (g GPU) NumSMs() (int, error)
- func (g GPU) TheoreticalGFlops() (int64, error)
- func (v *GPU) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *GPU) UnmarshalJSON(data []byte) error
- type HBM2
- type HBM3
- type Infiniband
- type Interconnect
- type NVLink1
- type NVLink2
- type NvidiaGPU
- type NvidiaSmi
- type PCIe1
- type PCIe2
- type PCIe3
- type PCIe4
- type SXM2
Constants ¶
View Source
const ( GBps = float64(1) Gbps = float64(0.125) )
View Source
const (
BinaryName = "nvidia-smi"
)
Variables ¶
View Source
var ( NVIDIAGeForceRTX3090 = NvidiaGPU{ Name: "GeForce RTX 3090", NumSMs: 82, ComputeCapability: 8.6, Architecture: "Ampere", Interconnect: PCIe4{}, ClockRate: int64(1695), PeekGFlops: int64(35580), MemoryBandwidth: float64(936.2), } NVIDIARTX6000 = NvidiaGPU{ Name: "Quadro RTX 6000", NumSMs: 40, ComputeCapability: 7.5, Architecture: "Turing", Interconnect: PCIe3{}, ClockRate: int64(1770), PeekGFlops: int64(16300), MemoryBandwidth: float64(624), } NVIDIAT4 = NvidiaGPU{ Name: "Tesla T4", NumSMs: 40, ComputeCapability: 7.5, Architecture: "Volta", Interconnect: PCIe3{}, ClockRate: int64(1530), PeekGFlops: int64(8100), MemoryBandwidth: float64(300), } NVIDIATeslaV100SXM2 = NvidiaGPU{ Name: "Tesla V100-SXM2-16GB", NumSMs: 80, ComputeCapability: 7.0, Architecture: "Volta", Interconnect: NVLink2{}, ClockRate: int64(1530), PeekGFlops: int64(15700), MemoryBandwidth: float64(900), } NVIDIATeslaV100PCIe16GB = NvidiaGPU{ Name: "Tesla V100-PCIE-16GB", Architecture: "Volta", Interconnect: PCIe3{}, ClockRate: int64(1380), PeekGFlops: int64(14000), MemoryBandwidth: float64(900), } NVIDIATeslaV100PCIe32GB = NvidiaGPU{ Name: "Tesla V100-PCIE-32GB", Architecture: "Volta", Interconnect: PCIe3{}, ClockRate: int64(1380), PeekGFlops: int64(14000), MemoryBandwidth: float64(900), } // https://devblogs.nvidia.com/new-pascal-gpus-accelerate-inference-in-the-data-center/ NVIDIATeslaP4 = NvidiaGPU{ Name: "Tesla P4", NumSMs: 20, ComputeCapability: 6.1, Architecture: "Pascal", Interconnect: PCIe3{}, ClockRate: int64(1063), PeekGFlops: int64(5442), MemoryBandwidth: float64(192), } NVIDIATeslaP40 = NvidiaGPU{ Name: "Tesla P40", NumSMs: 30, ComputeCapability: 6.1, Architecture: "Pascal", Interconnect: PCIe3{}, ClockRate: int64(1531), PeekGFlops: int64(11758), MemoryBandwidth: float64(346), } NVIDIATeslaP100PCIe16GB = NvidiaGPU{ Name: "Tesla P100-PCIE-16GB", Architecture: "Pascal", ComputeCapability: 6.0, NumSMs: 80, Interconnect: PCIe3{}, ClockRate: int64(1380), PeekGFlops: int64(9300), MemoryBandwidth: float64(732), } NVIDIATitanXP = NvidiaGPU{ Name: "TITAN Xp", Architecture: "Maxwell", Interconnect: PCIe2{}, ClockRate: int64(1582), PeekGFlops: int64(12100), MemoryBandwidth: float64(547.7), } NVIDIATitanX = NvidiaGPU{ Name: "TITAN X", Architecture: "Maxwell", Interconnect: PCIe2{}, ClockRate: int64(1000), PeekGFlops: int64(6144), MemoryBandwidth: float64(336.5), } // https://www.microway.com/knowledge-center-articles/in-depth-comparison-of-nvidia-tesla-maxwell-gpu-accelerators/ NVIDIAM60 = NvidiaGPU{ Name: "Tesla M60", Architecture: "Maxwell", Interconnect: PCIe3{}, NumSMs: 16, ClockRate: int64(1178), PeekGFlops: int64(9640), MemoryBandwidth: float64(320), } // https://www.microway.com/knowledge-center-articles/in-depth-comparison-of-nvidia-tesla-kepler-gpu-accelerators/ NVIDIAK80 = NvidiaGPU{ Name: "Tesla K80", Architecture: "Kepler", Interconnect: PCIe3{}, NumSMs: 26, ClockRate: int64(875), PeekGFlops: int64(8730), MemoryBandwidth: float64(480), } NVIDIAK40 = NvidiaGPU{ Name: "Tesla K40", Architecture: "Kepler", Interconnect: PCIe3{}, NumSMs: 15, ClockRate: int64(875), PeekGFlops: int64(5040), MemoryBandwidth: float64(288), } NVIDIAK20X = NvidiaGPU{ Name: "Tesla K20X", Architecture: "Kepler", Interconnect: PCIe2{}, ClockRate: int64(784), PeekGFlops: int64(3935), MemoryBandwidth: float64(250), } NVIDIAK20 = NvidiaGPU{ Name: "Tesla K20", Architecture: "Kepler", Interconnect: PCIe2{}, ClockRate: int64(705), PeekGFlops: int64(3520), MemoryBandwidth: float64(208), } NvidiaGPUs = []NvidiaGPU{ NVIDIAGeForceRTX3090, NVIDIARTX6000, NVIDIATeslaV100SXM2, NVIDIATeslaV100PCIe16GB, NVIDIATeslaV100PCIe32GB, NVIDIATeslaP4, NVIDIATeslaP40, NVIDIATeslaP100PCIe16GB, NVIDIATitanXP, NVIDIATitanX, NVIDIAM60, NVIDIAK20, NVIDIAK20X, NVIDIAK40, NVIDIAK80, } )
View Source
var ( Info *NvidiaSmi HasGPU bool = false GPUCount = 0 HyperQSize = 32 )
Functions ¶
Types ¶
type Ethernet20 ¶
type Ethernet20 struct {
}
func (Ethernet20) Bandwidth ¶
func (Ethernet20) Bandwidth() float64
func (Ethernet20) Name ¶
func (Ethernet20) Name() string
type GPU ¶
type GPU struct {
ID string `xml:"id,attr" json:"id"`
MemClockClocksGpu string `xml:"clocks>mem_clock" json:"mem_clock_clocks_gpu"`
L1Cache string `xml:"ecc_errors>volatile>single_bit>l1_cache" json:"l_1_cache"`
ProductName string `xml:"product_name" json:"product_name"`
FreeFbMemoryUsageGpu string `xml:"fb_memory_usage>free" json:"free_fb_memory_usage_gpu"`
PowerState string `xml:"power_readings>power_state" json:"power_state"`
Free string `xml:"bar1_memory_usage>free" json:"free"`
RetiredCountDoubleBitRetirementRetiredPagesGpu string `xml:"retired_pages>double_bit_retirement>retired_count" json:"retired_count_double_bit_retirement_retired_pages_gpu"`
ClocksThrottleReasonUnknown string `xml:"clocks_throttle_reasons>clocks_throttle_reason_unknown" json:"clocks_throttle_reason_unknown"`
ClocksThrottleReasonApplicationsClocksSetting string `` /* 138-byte string literal not displayed */
Processes string `xml:"processes" json:"processes"`
MemClockApplicationsClocksGpu string `xml:"applications_clocks>mem_clock" json:"mem_clock_applications_clocks_gpu"`
L2CacheSingleBitAggregateEccErrorsGpu string `xml:"ecc_errors>aggregate>single_bit>l2_cache" json:"l_2_cache_single_bit_aggregate_ecc_errors_gpu"`
CurrentLinkGen string `xml:"pci>pci_gpu_link_info>pcie_gen>current_link_gen" json:"current_link_gen"`
TotalSingleBitVolatileEccErrorsGpu string `xml:"ecc_errors>volatile>single_bit>total" json:"total_single_bit_volatile_ecc_errors_gpu"`
TextureMemoryDoubleBitVolatileEccErrorsGpu string `xml:"ecc_errors>volatile>double_bit>texture_memory" json:"texture_memory_double_bit_volatile_ecc_errors_gpu"`
L1CacheSingleBitAggregateEccErrorsGpu string `xml:"ecc_errors>aggregate>single_bit>l1_cache" json:"l_1_cache_single_bit_aggregate_ecc_errors_gpu"`
PendingGom string `xml:"gpu_operation_mode>pending_gom" json:"pending_gom"`
AutoBoostDefault string `xml:"clock_policy>auto_boost_default" json:"auto_boost_default"`
GraphicsClockApplicationsClocksGpu string `xml:"applications_clocks>graphics_clock" json:"graphics_clock_applications_clocks_gpu"`
PciBusID string `xml:"pci>pci_bus_id" json:"pci_bus_id"`
PowerManagement string `xml:"power_readings>power_management" json:"power_management"`
DeviceMemoryDoubleBitAggregateEccErrorsGpu string `xml:"ecc_errors>aggregate>double_bit>device_memory" json:"device_memory_double_bit_aggregate_ecc_errors_gpu"`
BoardID string `xml:"board_id" json:"board_id"`
DeviceMemoryDoubleBitVolatileEccErrorsGpu string `xml:"ecc_errors>volatile>double_bit>device_memory" json:"device_memory_double_bit_volatile_ecc_errors_gpu"`
SupportedGraphicsClock []string `xml:"supported_clocks>supported_mem_clock>supported_graphics_clock" json:"supported_graphics_clock"`
PersistenceMode string `xml:"persistence_mode" json:"persistence_mode"`
MemClock string `xml:"max_clocks>mem_clock" json:"mem_clock"`
GraphicsClockClocksGpu string `xml:"clocks>graphics_clock" json:"graphics_clock_clocks_gpu"`
Used string `xml:"bar1_memory_usage>used" json:"used"`
ImgVersion string `xml:"inforom_version>img_version" json:"img_version"`
UsedFbMemoryUsageGpu string `xml:"fb_memory_usage>used" json:"used_fb_memory_usage_gpu"`
TotalDoubleBitAggregateEccErrorsGpu string `xml:"ecc_errors>aggregate>double_bit>total" json:"total_double_bit_aggregate_ecc_errors_gpu"`
MinorNumber string `xml:"minor_number" json:"minor_number"`
ProductBrand string `xml:"product_brand" json:"product_brand"`
GraphicsClockDefaultApplicationsClocksGpu string `xml:"default_applications_clocks>graphics_clock" json:"graphics_clock_default_applications_clocks_gpu"`
TotalFbMemoryUsageGpu string `xml:"fb_memory_usage>total" json:"total_fb_memory_usage_gpu"`
RegisterFileDoubleBitVolatileEccErrorsGpu string `xml:"ecc_errors>volatile>double_bit>register_file" json:"register_file_double_bit_volatile_ecc_errors_gpu"`
MinPowerLimit string `xml:"power_readings>min_power_limit" json:"min_power_limit"`
TxUtil string `xml:"pci>tx_util" json:"tx_util"`
TextureMemory string `xml:"ecc_errors>volatile>single_bit>texture_memory" json:"texture_memory"`
RegisterFileDoubleBitAggregateEccErrorsGpu string `xml:"ecc_errors>aggregate>double_bit>register_file" json:"register_file_double_bit_aggregate_ecc_errors_gpu"`
PerformanceState string `xml:"performance_state" json:"performance_state"`
CurrentDm string `xml:"driver_model>current_dm" json:"current_dm"`
PciDeviceID string `xml:"pci>pci_device_id" json:"pci_device_id"`
AccountedProcesses string `xml:"accounted_processes" json:"accounted_processes"`
PendingRetirement string `xml:"retired_pages>pending_retirement" json:"pending_retirement"`
TotalDoubleBitVolatileEccErrorsGpu string `xml:"ecc_errors>volatile>double_bit>total" json:"total_double_bit_volatile_ecc_errors_gpu"`
UUID string `xml:"uuid" json:"uuid"`
PowerLimit string `xml:"power_readings>power_limit" json:"power_limit"`
ClocksThrottleReasonHwSlowdown string `xml:"clocks_throttle_reasons>clocks_throttle_reason_hw_slowdown" json:"clocks_throttle_reason_hw_slowdown"`
BridgeChipFw string `xml:"pci>pci_bridge_chip>bridge_chip_fw" json:"bridge_chip_fw"`
ReplayCounter string `xml:"pci>replay_counter" json:"replay_counter"`
L2CacheDoubleBitAggregateEccErrorsGpu string `xml:"ecc_errors>aggregate>double_bit>l2_cache" json:"l_2_cache_double_bit_aggregate_ecc_errors_gpu"`
ComputeMode string `xml:"compute_mode" json:"compute_mode"`
FanSpeed string `xml:"fan_speed" json:"fan_speed"`
Total string `xml:"bar1_memory_usage>total" json:"total"`
SmClock string `xml:"max_clocks>sm_clock" json:"sm_clock"`
RxUtil string `xml:"pci>rx_util" json:"rx_util"`
GraphicsClock string `xml:"max_clocks>graphics_clock" json:"graphics_clock"`
PwrObject string `xml:"inforom_version>pwr_object" json:"pwr_object"`
PciBus string `xml:"pci>pci_bus" json:"pci_bus"`
DecoderUtil string `xml:"utilization>decoder_util" json:"decoder_util"`
PciSubSystemID string `xml:"pci>pci_sub_system_id" json:"pci_sub_system_id"`
MaxLinkGen string `xml:"pci>pci_gpu_link_info>pcie_gen>max_link_gen" json:"max_link_gen"`
BridgeChipType string `xml:"pci>pci_bridge_chip>bridge_chip_type" json:"bridge_chip_type"`
SmClockClocksGpu string `xml:"clocks>sm_clock" json:"sm_clock_clocks_gpu"`
CurrentEcc string `xml:"ecc_mode>current_ecc" json:"current_ecc"`
PowerDraw string `xml:"power_readings>power_draw" json:"power_draw"`
CurrentLinkWidth string `xml:"pci>pci_gpu_link_info>link_widths>current_link_width" json:"current_link_width"`
AutoBoost string `xml:"clock_policy>auto_boost" json:"auto_boost"`
GpuUtil string `xml:"utilization>gpu_util" json:"gpu_util"`
PciDevice string `xml:"pci>pci_device" json:"pci_device"`
RegisterFile string `xml:"ecc_errors>volatile>single_bit>register_file" json:"register_file"`
L2Cache string `xml:"ecc_errors>volatile>single_bit>l2_cache" json:"l_2_cache"`
L1CacheDoubleBitAggregateEccErrorsGpu string `xml:"ecc_errors>aggregate>double_bit>l1_cache" json:"l_1_cache_double_bit_aggregate_ecc_errors_gpu"`
RetiredCount string `xml:"retired_pages>multiple_single_bit_retirement>retired_count" json:"retired_count"`
PendingDm string `xml:"driver_model>pending_dm" json:"pending_dm"`
AccountingModeBufferSize string `xml:"accounting_mode_buffer_size" json:"accounting_mode_buffer_size"`
GpuTempSlowThreshold string `xml:"temperature>gpu_temp_slow_threshold" json:"gpu_temp_slow_threshold"`
OemObject string `xml:"inforom_version>oem_object" json:"oem_object"`
TextureMemorySingleBitAggregateEccErrorsGpu string `xml:"ecc_errors>aggregate>single_bit>texture_memory" json:"texture_memory_single_bit_aggregate_ecc_errors_gpu"`
RegisterFileSingleBitAggregateEccErrorsGpu string `xml:"ecc_errors>aggregate>single_bit>register_file" json:"register_file_single_bit_aggregate_ecc_errors_gpu"`
MaxLinkWidth string `xml:"pci>pci_gpu_link_info>link_widths>max_link_width" json:"max_link_width"`
TextureMemoryDoubleBitAggregateEccErrorsGpu string `xml:"ecc_errors>aggregate>double_bit>texture_memory" json:"texture_memory_double_bit_aggregate_ecc_errors_gpu"`
ClocksThrottleReasonGpuIdle string `xml:"clocks_throttle_reasons>clocks_throttle_reason_gpu_idle" json:"clocks_throttle_reason_gpu_idle"`
MultigpuBoard string `xml:"multigpu_board" json:"multigpu_board"`
GpuTempMaxThreshold string `xml:"temperature>gpu_temp_max_threshold" json:"gpu_temp_max_threshold"`
MaxPowerLimit string `xml:"power_readings>max_power_limit" json:"max_power_limit"`
L2CacheDoubleBitVolatileEccErrorsGpu string `xml:"ecc_errors>volatile>double_bit>l2_cache" json:"l_2_cache_double_bit_volatile_ecc_errors_gpu"`
PciDomain string `xml:"pci>pci_domain" json:"pci_domain"`
MemClockDefaultApplicationsClocksGpu string `xml:"default_applications_clocks>mem_clock" json:"mem_clock_default_applications_clocks_gpu"`
VbiosVersion string `xml:"vbios_version" json:"vbios_version"`
RetiredPageAddresses string `xml:"retired_pages>multiple_single_bit_retirement>retired_page_addresses" json:"retired_page_addresses"`
GpuTemp string `xml:"temperature>gpu_temp" json:"gpu_temp"`
AccountingMode string `xml:"accounting_mode" json:"accounting_mode"`
L1CacheDoubleBitVolatileEccErrorsGpu string `xml:"ecc_errors>volatile>double_bit>l1_cache" json:"l_1_cache_double_bit_volatile_ecc_errors_gpu"`
DeviceMemorySingleBitAggregateEccErrorsGpu string `xml:"ecc_errors>aggregate>single_bit>device_memory" json:"device_memory_single_bit_aggregate_ecc_errors_gpu"`
DisplayActive string `xml:"display_active" json:"display_active"`
DefaultPowerLimit string `xml:"power_readings>default_power_limit" json:"default_power_limit"`
EncoderUtil string `xml:"utilization>encoder_util" json:"encoder_util"`
Serial string `xml:"serial" json:"serial"`
EnforcedPowerLimit string `xml:"power_readings>enforced_power_limit" json:"enforced_power_limit"`
RetiredPageAddressesDoubleBitRetirementRetiredPagesGpu string `` /* 134-byte string literal not displayed */
EccObject string `xml:"inforom_version>ecc_object" json:"ecc_object"`
Value []string `xml:"supported_clocks>supported_mem_clock>value" json:"value"`
DisplayMode string `xml:"display_mode" json:"display_mode"`
DeviceMemory string `xml:"ecc_errors>volatile>single_bit>device_memory" json:"device_memory"`
PendingEcc string `xml:"ecc_mode>pending_ecc" json:"pending_ecc"`
ClocksThrottleReasonSwPowerCap string `xml:"clocks_throttle_reasons>clocks_throttle_reason_sw_power_cap" json:"clocks_throttle_reason_sw_power_cap"`
TotalSingleBitAggregateEccErrorsGpu string `xml:"ecc_errors>aggregate>single_bit>total" json:"total_single_bit_aggregate_ecc_errors_gpu"`
CurrentGom string `xml:"gpu_operation_mode>current_gom" json:"current_gom"`
MemoryUtil string `xml:"utilization>memory_util" json:"memory_util"`
}
func (GPU) Architecture ¶
func (GPU) ComputeCapability ¶
func (GPU) InterconnectBandwidth ¶
func (GPU) InterconnectName ¶
func (GPU) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (GPU) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (GPU) MemoryBandwidth ¶
func (GPU) TheoreticalGFlops ¶
func (*GPU) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*GPU) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type Infiniband ¶
type Infiniband struct {
}
func (Infiniband) Bandwidth ¶
func (Infiniband) Bandwidth() float64
func (Infiniband) Name ¶
func (Infiniband) Name() string
type Interconnect ¶
type NvidiaGPU ¶
type NvidiaGPU struct {
Name string `json:"name,omitempty"`
NumSMs int `json:"num_sms,omitempty"`
ComputeCapability float64 `json:"compute_capability,omitempty"`
Architecture string `json:"architecture,omitempty"`
Interconnect Interconnect `json:"interconnect,omitempty"`
ClockRate int64 `json:"clock_rate,omitempty"`
PeekGFlops int64 `json:"peek_gflops,omitempty"`
MemoryBandwidth float64 `json:"memory_bandwidth,omitempty"`
}
type NvidiaSmi ¶
type NvidiaSmi struct {
Timestamp string `xml:"timestamp" json:"timestamp"`
DriverVersion string `xml:"driver_version" json:"driver_version"`
AttachedGpus string `xml:"attached_gpus" json:"attached_gpus"`
GPUS []GPU `xml:"gpu" json:"gpus"`
}
func (NvidiaSmi) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (NvidiaSmi) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*NvidiaSmi) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*NvidiaSmi) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type PCIe1 ¶
type PCIe1 struct {
}
Here we assume PCIe x16. PCIe 1.0: 150MB/s per lane per direction.
type PCIe2 ¶
type PCIe2 struct {
}
Here we assume PCIe x16. PCIe 1.0: 500MB/s per lane per direction.
Click to show internal directories.
Click to hide internal directories.