bitorch_engine.utils.arch_helper.linux_arch_ident

class bitorch_engine.utils.arch_helper.linux_arch_ident[source]

A utility class for identifying Linux architecture, specifically aimed at ARM architectures.

This class provides methods to check if the current system is running on an ARM architecture and to determine the specific model of the ARM CPU.

Methods

get_arm_model

Fetches the model name of the ARM CPU from the system and maps it to a predefined ARCH_CPU enum.

is_arm

Determines if the current system's architecture is ARM-based.

static get_arm_model() ARCH_CPU[source]

Fetches the model name of the ARM CPU from the system and maps it to a predefined ARCH_CPU enum.

This method attempts to execute the ‘lscpu’ command to retrieve CPU information, then parses the output to identify the model name of the ARM CPU.

Returns:

An ARCH_CPU enum value corresponding to the ARM CPU model.

Raises:

Exception – If there’s an error executing ‘lscpu’, or if the CPU model cannot be recognized.

static is_arm() bool[source]

Determines if the current system’s architecture is ARM-based.

Returns:

True if the system is ARM-based, False otherwise.