mt.gpu
Submodules
Functions
detect_machine()
: Detects the machine architecture.get_mem_info()
: Returns a dictionary containing information about detected CPU/GPU devices and their memory usage, or None if the architecture is unknown.sort_gpu_devices()
: Sorts the GPU devices in decreasing order of free memory. Only effective with CUDA hardare.
- mt.gpu.detect_machine()
Detects the machine architecture.
- Returns:
a unique name identifying the machine architecture
- Return type:
[‘arm64-r5b’, ‘arm64-rpi’, ‘arm64-tx1’, ‘arm64-tx2’, ‘arm64-j43’, ‘amd64-cpu’, ‘amd64-nvidia’, ‘amd64-amd’]
Notes
The names correspond to the following architectures:
“arm64-r5b” : a Rock 5B
“arm64-rp4” : a Raspberry Pi Model 4
“arm64-rp3” : a Raspberry Pi Model 3
“arm64-tk1” : an Nvidia Tegra K1
“arm64-tx1” : an Nvidia Tegra X1
“arm64-tx2” : an Nvidia Tegra X2
“arm64-xnx” : an Nvidia Jetson Xavier-NX
“amd64-cpu” : an amd64 PC without any graphic card
“amd64-nvidia” : an amd64 PC with Nvidia graphic card(s)
“amd64-amd” : and amd64 PC with AMDGPU card(s)
- mt.gpu.get_mem_info(print_bars=False)
Returns a dictionary containing information about detected CPU/GPU devices and their memory usage, or None if the architecture is unknown.
- Parameters:
print_bars (bool) – whether or not to print some bars
- mt.gpu.sort_gpu_devices()
Sorts the GPU devices in decreasing order of free memory. Only effective with CUDA hardare.