sysinfo#

System information helpers.

Module Attributes

IGNORED_INTEL_DEVICE_IDS

Intel PCI device IDs that are not useful compute targets.

Functions

discover_intel_gpus()

Discover Intel GPUs on this machine.

get_device_name_by_pci_address(pci_address)

Get the device name for a PCI address.

get_git_commit_hash()

Get the git describe hash for the current repo state.

get_icpx_version()

Get the Intel icpx compiler version string if available.

get_igc_revision()

Get the Intel IGC revision string if available.

get_intel_cpu_name()

Get the CPU model name from /proc/cpuinfo.

get_neo_revision()

Get the Intel NEO revision string if available.

get_nvcc_version()

Get the CUDA nvcc version string if available.

get_nvidia_compute_capabilities()

Get NVIDIA GPU compute capabilities from nvidia-smi.

get_nvidia_gpu_name()

Get the first NVIDIA GPU name if present.

get_ocl_driver_version()

Get the OpenCL driver version string if available.

get_torch_version()

Get the installed torch version without importing it.

get_total_system_memory_kb()

Get the total amount of system memory in kB from /proc/meminfo.

get_worker_info()

Get system info for the current worker.

select_intel_gpu()

Pick the Intel GPU to target on a machine that has more than one, prefering discrete GPU.

kernelfoundry.eval_pipeline.utils.sysinfo.get_intel_cpu_name()[source]#

Get the CPU model name from /proc/cpuinfo.

Returns:

CPU model name, or an empty string if unavailable.

Return type:

str

kernelfoundry.eval_pipeline.utils.sysinfo.get_total_system_memory_kb() → int[source]#

Get the total amount of system memory in kB from /proc/meminfo.

Returns:

Total memory in kB (from MemTotal), or 0 if unavailable.

Return type:

int

kernelfoundry.eval_pipeline.utils.sysinfo.get_torch_version()[source]#

Get the installed torch version without importing it.

Returns:

Torch version string.

Return type:

str

kernelfoundry.eval_pipeline.utils.sysinfo.get_nvcc_version()[source]#

Get the CUDA nvcc version string if available.

Returns:

nvcc version string, or an empty string if unavailable.

Return type:

str

kernelfoundry.eval_pipeline.utils.sysinfo.get_icpx_version()[source]#

Get the Intel icpx compiler version string if available.

Returns:

icpx version string, or an empty string if unavailable.

Return type:

str

kernelfoundry.eval_pipeline.utils.sysinfo.get_ocl_driver_version()[source]#

Get the OpenCL driver version string if available.

Returns:

OpenCL driver version string, or an empty string if unavailable.

Return type:

str

kernelfoundry.eval_pipeline.utils.sysinfo.get_neo_revision()[source]#

Get the Intel NEO revision string if available.

Returns:

Intel NEO revision string, or an empty string if unavailable.

Return type:

str

kernelfoundry.eval_pipeline.utils.sysinfo.get_igc_revision()[source]#

Get the Intel IGC revision string if available.

Returns:

Intel IGC revision string, or an empty string if unavailable.

Return type:

str

kernelfoundry.eval_pipeline.utils.sysinfo.get_git_commit_hash() → str | None[source]#

Get the git describe hash for the current repo state.

Returns:

Git describe hash, or an empty string if unavailable.

Return type:

str

kernelfoundry.eval_pipeline.utils.sysinfo.IGNORED_INTEL_DEVICE_IDS = frozenset({'0x4680'})#

Intel PCI device IDs that are not useful compute targets.

kernelfoundry.eval_pipeline.utils.sysinfo.discover_intel_gpus() → list[tuple[Path, str, str]][source]#

Discover Intel GPUs on this machine. Reads DRM devices from sysfs on Linux and the PnP database on Windows.

Returns:

Tuples of (card_path, device_id, pci_slot_name).

The device ID describes the GPU model, e.g. “0x56c0”, and can be passed to the compiler via TORCH_XPU_ARCH_LIST.

Return type:

list[tuple[Path, str, str]]

kernelfoundry.eval_pipeline.utils.sysinfo.select_intel_gpu() → tuple[Path, str, str] | None[source]#

Pick the Intel GPU to target on a machine that has more than one, prefering discrete GPU.

Returns:

The chosen (card_path, device_id, pci_slot_name), or

None if the machine has no Intel GPU.

Return type:

tuple[Path, str, str] | None

kernelfoundry.eval_pipeline.utils.sysinfo.get_device_name_by_pci_address(pci_address: str) → str[source]#

Get the device name for a PCI address.

Uses lspci on Linux and the PnP database on Windows, where lspci does not exist and the “PCI address” the discovery helpers hand out is really a PNPDeviceID.

Parameters:

pci_address (str) – PCI address of the device (e.g., “0000:3b:00.0”), or on Windows a PNPDeviceID as returned by discover_intel_gpus().

Returns:

Device name, or an empty string if not found.

Return type:

str

kernelfoundry.eval_pipeline.utils.sysinfo.get_nvidia_compute_capabilities() → list[str][source]#

Get NVIDIA GPU compute capabilities from nvidia-smi.

Returns:

Compute capability strings (e.g., [“7.5”, “8.6”]).

Return type:

list[str]

kernelfoundry.eval_pipeline.utils.sysinfo.get_nvidia_gpu_name() → str[source]#

Get the first NVIDIA GPU name if present.

Returns:

GPU name, or an empty string if not found.

Return type:

str

kernelfoundry.eval_pipeline.utils.sysinfo.get_worker_info()[source]#

Get system info for the current worker.

Returns:

System info map including compiler, driver, and device details.

Return type:

dict