< GeeXLab Reference Guide />
> Back to Reference Guide Index
gh_gml library
Description
gh_gml is the GPU monitoring module. It is available for Windows, Linux, macOS and monitors NVIDIA GeForce/Quadro and AMD Radeon graphics cards.
Number of functions: 30
- gh_gml.geforce_logo_get_illumination ()
- gh_gml.geforce_logo_is_illumination_supported ()
- gh_gml.geforce_logo_set_illumination ()
- gh_gml.get_all_limiting_policies ()
- gh_gml.get_clocks ()
- gh_gml.get_fan_speed ()
- gh_gml.get_gpu_codename ()
- gh_gml.get_gpu_config ()
- gh_gml.get_gpu_cores ()
- gh_gml.get_gpu_driver ()
- gh_gml.get_gpu_eus ()
- gh_gml.get_gpu_fullname ()
- gh_gml.get_num_gpus ()
- gh_gml.get_pci_identifiers ()
- gh_gml.get_revision_id ()
- gh_gml.get_temperatures ()
- gh_gml.get_usages ()
- gh_gml.gpu_power_get_current_value ()
- gh_gml.gpu_power_get_power_limit ()
- gh_gml.amd_get_overdrive_version ()
- gh_gml.get_vram_usage ()
- gh_gml.gpu_power_get_current_value ()
- gh_gml.gpu_power_get_current_value_v2 ()
- gh_gml.amd_get_temperatures_rdna ()
- gh_gml.amd_get_power_rdna ()
- gh_gml.get_gpu_architecture ()
- gh_gml.amd_ags_get_gpu_info ()
- gh_gml.get_gpu_driver_v2 ()
- gh_gml.get_memory_info_v2 ()
- gh_gml.get_gpu_rt_tensor_cores ()
geforce_logo_get_illumination
Description
GTX 600/700: gets the current illumination value of the GeForce GTX LED logo.
Syntax
illum_value = gh_gml.geforce_logo_get_illumination(
gpu_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU in the range (0 … num_gpus - 1)
Return Values
- illum_value [REAL]: logo illumination value
Code sample
illum_value = gh_gml.geforce_logo_get_illumination(0)
geforce_logo_is_illumination_supported
Description
GTX 600/700: checks whether the GeForce GTX LED logo is supported.
Syntax
is_supported = gh_gml.geforce_logo_is_illumination_supported(
gpu_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU in the range (0 … num_gpus - 1)
Return Values
- is_supported [BOOLEAN]: supported: 1 (true) or 0 (false)
Code sample
is_supported = gh_gml.geforce_logo_is_illumination_supported(0)
geforce_logo_set_illumination
Description
GTX 600/700: sets the current illumination value of the GeForce GTX LED logo.
Syntax
gh_gml.geforce_logo_set_illumination(
gpu_index,
illum_value
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU in the range (0 … num_gpus - 1)
- illum_value [REAL]: logo illumination value
Return Values
This function has no return value(s).
Code sample
gh_gml.geforce_logo_set_illumination(0, illum_value)
get_all_limiting_policies
Description
Gets all policies that limits the GPU power (NVIDIA GPUs).
Syntax
power, temperature, voltage, overvoltage = gh_gml.get_all_limiting_policies(
gpu_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU in the range (0 … num_gpus - 1)
Return Values
- power, temperature, voltage, overvoltage [BOOLEAN]: limited: 1 (true) or 0 (false)
Code sample
power, temperature, voltage, overvoltage = gh_gml.get_all_limiting_policies(0)
if (temperature == 1) then
print("Limiting policy: temperature")
end
get_clocks
Description
Gets the GPU core and memory clock speeds.
Syntax
core_clock, mem_clock = gh_gml.get_clocks(
gpu_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU in the range (0 … num_gpus - 1)
Return Values
- core_clock, mem_clock [INTEGER]: clock speeds
Code sample
core_clock, mem_clock = gh_gml.get_clocks(0)
get_fan_speed
Description
Gets the GPU fan speed.
Syntax
percent, rpm = gh_gml.get_fan_speed(
gpu_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU in the range (0 … num_gpus - 1)
Return Values
- percent, rpm [INTEGER]: speed in percent and RPM
Code sample
percent, rpm = gh_gml.get_fan_speed(0)
get_gpu_codename
Description
Gets the GPU codename.
Syntax
name = gh_gml.get_gpu_codename(
gpu_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU in the range (0 … num_gpus - 1)
Return Values
- name [STRING]: codename of the GPU, ex: GK110
Code sample
codename = gh_gml.get_gpu_codename(0)
get_gpu_config
Description
Gets the GPU config: cores, TMUs and ROPs.
Syntax
cores, tmus, rops = gh_gml.get_gpu_config(
gpu_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU in the range (0 … num_gpus - 1)
Return Values
- cores, tmus, rops [INTEGER]: GPU config.
Code sample
cores, tmus, rops = gh_gml.get_gpu_config(gpu_index)
get_gpu_cores
Description
Gets the shader cores of the GPU.
Syntax
num_cores = gh_gml.get_gpu_cores(
gpu_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU in the range (0 … num_gpus - 1)
Return Values
- num_cores [INTEGER]: number of cores
Code sample
cores = gh_gml.get_gpu_cores(0)
get_gpu_driver
Description
Gets the GPU driver.
Syntax
name = gh_gml.get_gpu_driver(
gpu_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU in the range (0 … num_gpus - 1)
Return Values
- name [STRING]: driver name
Code sample
driver_name = gh_gml.get_gpu_driver(0)
get_gpu_eus
Description
Gets the number of EUs (execution units) for Intel Arc GPUs.
Syntax
num_eus = gh_gml.get_gpu_eus(
gpu_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU in the range (0 … num_gpus - 1)
Return Values
- num_eus [INTEGER]: number of EUs
Code sample
eus = gh_gml.get_gpu_eus(0)
get_gpu_fullname
Description
Gets the GPU name.
Syntax
name = gh_gml.get_gpu_fullname(
gpu_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU in the range (0 … num_gpus - 1)
Return Values
- name [STRING]: name of the GPU, ex: GeForce GTX 780
Code sample
gpu_name = gh_gml.get_gpu_fullname(0)
get_num_gpus
Description
Returns the number of GPUs.
Syntax
num_gpus = gh_gml.get_num_gpus()
Languages
Parameters
This function has no input parameter(s).
Return Values
- num_gpus [INTEGER]: number of GPUs
Code sample
num_gpus = gh_gml.get_num_gpus()
get_pci_identifiers
Description
Gets the PCI identifiers of the GPU (device and subdevice IDs).
Syntax
vendorID, deviceID, subvendorID, subdeviceID = gh_gml.get_pci_identifiers(
gpu_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU in the range (0 … num_gpus - 1)
Return Values
- vendorID, deviceID, subvendorID, subdeviceID [INTEGER]: PCI identifiers
Code sample
vendorID, deviceID, subvendorID, subdeviceID = gh_gml.get_pci_identifiers(0)
get_revision_id
Description
Gets the revision ID of the GPU.
Syntax
revID = gh_gml.get_revision_id(
gpu_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU in the range (0 … num_gpus - 1)
Return Values
- revID [INTEGER]: PCI identifiers
Code sample
revID = gh_gml.get_revision_id(0)
get_temperatures
Description
Gets the GPU core, mem, board and VRM temperatures if available.
Syntax
gpu, mem, pcb, vrm = gh_gml.get_temperatures(
gpu_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU in the range (0 … num_gpus - 1)
Return Values
- gpu, mem, pcb, vrm [INTEGER]: temperatures in degrees
Code sample
gpu, mem, pcb, vrm = gh_gml.get_temperatures(0)
get_usages
Description
Gets the GPU core and memory usages.
Syntax
core_usage, mem_usage = gh_gml.get_usages(
gpu_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU in the range (0 … num_gpus - 1)
Return Values
- core_usage, mem_usage [INTEGER]: usages
Code sample
core_usage, mem_usage = gh_gml.get_usages(0)
gpu_power_get_current_value
Description
GTX 600/700: returns the current GPU power.
Syntax
power = gh_gml.gpu_power_get_current_value(
gpu_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU in the range (0 … num_gpus - 1)
Return Values
- power [INTEGER]: power in percent
Code sample
power = gh_gml.gpu_power_get_current_value(0)
gpu_power_get_power_limit
Description
GTX 600/700: returns the power limit (or power target) of the GPU.
Syntax
power = gh_gml.gpu_power_get_power_limit(
gpu_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU in the range (0 … num_gpus - 1)
Return Values
- power [INTEGER]: power in percent
Code sample
power_target = gh_gml.gpu_power_get_power_limit(0)
amd_get_overdrive_version
Description
Returns the overdrive version. For example, the overdrive is 8 for Navi GPUs.
Syntax
ver = gh_gml.amd_get_overdrive_version(
gpu_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU in the range (0 … num_gpus - 1)
Return Values
- ver [INTEGER]: overdrive version
Code sample
ver = gh_gml.amd_get_overdrive_version(gpu_index)
get_vram_usage
Description
Returns the size and usage of the graphics memory.
Syntax
vram_size_mb, vram_usage_mb = gh_gml.get_vram_usage(
gpu_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU in the range (0 … num_gpus - 1)
Return Values
- vram_size_mb [INTEGER]: size of the VRAM in MB
- vram_usage_mb [INTEGER]: amount of VRAM in use in MB
Code sample
vram_size_mb, vram_usage_mb = gh_gml.get_vram_usage(gpu_index)
gpu_power_get_current_value
Description
Returns the size and usage of the graphics memory.
Syntax
gpu_power_percent, gpu_power_watts = gh_gml.gpu_power_get_current_value(
gpu_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU in the range (0 … num_gpus - 1)
Return Values
- gpu_power_percent [REAL]: GPU power draw in percent
- gpu_power_watts [REAL]: GPU power draw in Watts
Code sample
gpu_power_percent, gpu_power_watts = gh_gml.gpu_power_get_current_value(gpu_index)
gpu_power_get_current_value_v2
Description
Returns the size and usage of the graphics memory.
Syntax
total_board_power_watts, chip_power_watts = gh_gml.gpu_power_get_current_value_v2(
gpu_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU in the range (0 … num_gpus - 1)
Return Values
- total_board_power_watts [REAL]: total board power draw in Watts
- chip_power_watts [REAL]: GPU power draw in Watts
Code sample
total_board_power_watts, chip_power_watts = gh_gml.gpu_power_get_current_value_v2(gpu_index)
amd_get_temperatures_rdna
Description
Returns the temperatures of a Navi / RDNA graphics card.
Syntax
gpu, mem, hotstop = gh_gml.amd_get_temperatures_rdna(
gpu_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU in the range (0 … num_gpus - 1)
Return Values
- gpu, mem, hotstop [INTEGER]: temperature of GPU, memory and hotstop/junction
Code sample
gpu, mem, hotstop = gh_gml.amd_get_temperatures_rdna(gpu_index)
amd_get_power_rdna
Description
Returns the power consumption in Watts of a Navi / RDNA graphics card.
Syntax
asic, soc = gh_gml.amd_get_power_rdna(
gpu_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU in the range (0 … num_gpus - 1)
Return Values
- asic, soc [INTEGER]: power: ASIC and SoC
Code sample
asic, soc = gh_gml.amd_get_power_rdna(gpu_index)
get_gpu_architecture
Description
Returns the GPU architecture for recent graphics cards (NVIDIA or AMD). For example: Maxwell, Turing, GCN1, Vega or RDNA.
Syntax
arch = gh_gml.get_gpu_architecture(
gpu_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU in the range (0 … num_gpus - 1)
Return Values
- arch [STRING]: architecture
Code sample
arch = gh_gml.get_gpu_architecture(gpu_index)
amd_ags_get_gpu_info
Description
Returns some GPU information for AMD Radeon GPUs.
Syntax
num_cus, num_wgps, num_rops, core_clock, mem_clock = gh_gml.amd_ags_get_gpu_info(
gpu_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU in the range (0 … num_gpus - 1)
Return Values
- num_cus [INTEGER]: number of compute units
- num_wgps [INTEGER]: number of RDNA work group processors
- num_rops [INTEGER]: number of render output units
- core_clock [INTEGER]: core clock speed at 100% power in MHz
- mem_clock [INTEGER]: memory clock speed at 100% power in MHz
Code sample
num_cus, num_wgps, num_rops, core_clock, mem_clock = gh_gml.amd_ags_get_gpu_info(gpu_index)
get_gpu_driver_v2
Description
Gets graphics driver information.
Syntax
driver_name, driver_version = gh_gml.get_gpu_driver_v2(
gpu_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU in the range (0 … num_gpus - 1)
Return Values
- driver_name [STRING]: name of the driver (AMD: Adrenalin 2020 for example, nothin with NVIDIA)
- driver_version [STRING]: version of the driver (AMD: 20.2.1, NVIDIA: 442.37...)
Code sample
driver_name, driver_version = gh_gml.get_gpu_driver_v2(gpu_index)
get_memory_info_v2
Description
Gets memory size information. Currently on NVIDIA only.
Syntax
memory_size_mb, cur_available_memory_size_mb = gh_gml.get_memory_info_v2(
gpu_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU in the range (0 … num_gpus - 1)
Return Values
- memory_size_mb [INTEGER]: total memory size in MB
- cur_available_memory_size_mb [INTEGER]: current available memory size in MB
Code sample
memory_size_mb, cur_available_memory_size_mb = gh_gml.get_memory_info_v2(gpu_index)
get_gpu_rt_tensor_cores
Description
Gets the number of RT (raytracing) and tensor cores. NVIDIA Turing+ GPUs only.
Syntax
rt_cores, tensor_cores = gh_gml.get_gpu_rt_tensor_cores(
gpu_index
)
Languages
Parameters
- gpu_index [INTEGER]: index of the GPU in the range (0 … num_gpus - 1)
Return Values
- rt_cores [INTEGER]: number of raytracing cores
- tensor_cores [INTEGER]: number of tensor cores
Code sample
rt_cores, tensor_cores = gh_gml.get_gpu_rt_tensor_cores(gpu_index)
| |