Skip to main content
Linux has full support for all GPU vendors with multiple detection methods and fallbacks.

GPU Detection Methods

NVIDIA GPUs

llmfit detects NVIDIA GPUs via two methods:

1. nvidia-smi (Primary)

Unified Memory Detection:
  • NVIDIA Grace/DGX Spark (GB10, GB20): addressing_mode returns “ATS” (Address Translation Services)
  • When VRAM is unavailable, falls back to /proc/meminfo for total RAM
Multi-GPU Support:
  • Aggregates same-model GPUs (e.g., 2x RTX 4090 → count=2, per-card VRAM=24GB)
  • Total VRAM = per-card VRAM × count (for tensor splitting across cards)

2. sysfs Fallback (Containers/Toolbx)

When nvidia-smi is unavailable (common in containers):
GPU name resolution:
  • lspci -nn queries PCI slot from sysfs uevent file
  • Matches GPU model from lspci output (e.g., “GeForce RTX 2060”)
  • Fallback to flatpak-spawn --host lspci in Flatpak environments
Backend detection:
  • Checks DRIVER= in sysfs uevent file
  • nvidia driver → CUDA backend
  • Other drivers (nouveau, etc.) → Vulkan backend

AMD GPUs

llmfit detects AMD GPUs via three methods:

1. rocm-smi (ROCm installed)

Multi-GPU Support:
  • Tracks per-GPU VRAM from multiple “Total” lines
  • Backend: ROCm

2. sysfs (No ROCm)

GPU name resolution:
  • lspci -nn for AMD/ATI VGA/3D controllers
  • Backend: Vulkan (no ROCm)

3. Unified Memory APUs

Ryzen AI series APUs (Strix Halo, Strix Point) share system RAM:
Behavior:
  • VRAM = total system RAM (unified pool)
  • Backend: Vulkan
  • unified_memory flag set to true

Intel Arc GPUs

llmfit detects Intel Arc via sysfs and lspci:

Discrete GPUs (Arc A770, A370M)

Integrated GPUs (Arc Graphics in Meteor Lake)

Behavior:
  • Discrete: Reports exact VRAM
  • Integrated: Reports 0 VRAM (shares system memory)
  • Backend: SYCL (Intel oneAPI)

Ascend NPUs

llmfit detects Huawei Ascend NPUs via npu-smi:
Behavior:
  • Each NPU tracked separately (count=1 per NPU)
  • VRAM = HBM capacity in MB → GB
  • Backend: Ascend

Installation Methods

Quick Install Script

From Source

Troubleshooting

GPU Not Detected

NVIDIA:
  1. Check if nvidia-smi works:
  2. If nvidia-smi fails, check sysfs:
  3. Install nvidia-utils package:
  4. Manual override:
AMD:
  1. Check if rocm-smi works:
  2. Install ROCm:
  3. Sysfs fallback (no ROCm):
Intel Arc:
  1. Check sysfs vendor ID:
  2. Check lspci:
  3. Install Intel compute runtime:

VRAM Shows 0 or Wrong Value

Broken nvidia-smi:
VM/Passthrough setups: VRAM reporting often fails in VMs. Use manual override:
Container/Toolbx: Sysfs fallback should work. If not, check mount points:

WSL-Specific Issues

llmfit detects WSL via environment variables and /proc/version:
NVIDIA in WSL: AMD in WSL:
  • Limited support; ROCm not officially supported in WSL
  • Use CPU-only mode or run llmfit natively on Windows

Multi-GPU Detection Issues

Same-model cards not grouped: Check nvidia-smi output format:
Expected output:
llmfit groups by exact name match. Different-model cards: llmfit uses the GPU with the most VRAM as primary:

Next Steps