henrygd/beszel · warning

no sysfs values found

Error message

no sysfs values found

What it means

The Intel sysfs GPU collector's readFirstOptionalSysfsFloat iterates candidate sysfs value paths and fails when none of them can be read. It means the Intel GPU metrics files (e.g. frequency/energy counters) were absent or unreadable at every expected path.

Source

Thrown at agent/gpu_intel_sysfs_linux.go:268

	return strconv.ParseUint(strings.TrimSpace(val), 10, 64)
}

func readOptionalSysfsFloat(path string) (float64, error) {
	val, err := os.ReadFile(path)
	if err != nil {
		return 0, err
	}
	return strconv.ParseFloat(strings.TrimSpace(string(val)), 64)
}

func readFirstOptionalSysfsFloat(paths ...string) (float64, error) {
	for _, path := range paths {
		val, err := readOptionalSysfsFloat(path)
		if err == nil {
			return val, nil
		}
	}
	return 0, fmt.Errorf("no sysfs values found")
}

func getIntelSysfsGpuName(cardPath string) string {
	devicePath := filepath.Join(cardPath, "device")
	if product, err := utils.ReadStringFileLimited(filepath.Join(devicePath, "product_name"), 128); err == nil && strings.TrimSpace(product) != "" {
		return strings.TrimSpace(product)
	}
	if name, err := utils.ReadStringFileLimited(filepath.Join(devicePath, "name"), 128); err == nil && strings.TrimSpace(name) != "" {
		return strings.TrimSpace(name)
	}
	return fmt.Sprintf("Intel GPU %s", filepath.Base(cardPath))
}

View on GitHub (pinned to b38fb7dafa)

Solutions

  1. Mount /sys and the GPU devices into the container (--device /dev/dri, bind-mount /sys/class/drm and /sys/devices).
  2. Run the agent with permissions to read the sysfs nodes (root or appropriate group, e.g. video/render).
  3. Verify the expected files exist: ls /sys/class/drm/card0/device/hwmon/*/ and drm node metrics.
  4. Update the agent/kernel — sysfs layout varies across kernels; newer beszel versions support more paths.
  5. Treat as non-fatal if other GPU metrics (name, temp) still work; this metric is simply skipped.

Example fix

// before
docker run beszel/agent
// after
docker run --device /dev/dri --volume /sys:/sys:ro beszel/agent
Defensive patterns

Strategy: try-catch

Validate before calling

// precondition check for Intel sysfs metrics:
ls /sys/class/drm/card*/device/hwmon/*/ 2>/dev/null || echo 'no hwmon nodes'
[ -d /sys/class/drm ] || echo 'sysfs not mounted'

Try / catch

val, err := readFirstOptionalSysfsFloat(paths)
if err != nil {
    slog.Debug("optional GPU metric unavailable", "err", err)
    val = 0 // metric skipped, other GPU data still reported
}

Prevention

When it happens

Trigger: updateIntelSysfsGpuData calls readFirstOptionalSysfsFloat(paths); every readOptionalSysfsFloat(path) call errors (file missing, permission denied, invalid contents), so the loop exits and returns 'no sysfs values found'.

Common situations: Running in a container without /sys mounted or with restricted device access; non-Intel GPU or iGPU without the expected hwmon/drm metric nodes; kernel version exposing different sysfs layout; cardPath guessed wrong when enumerating /sys/class/drm/card*.

Related errors


AI-assisted analysis of henrygd/beszel@b38fb7dafa (2026-08-31). Data as JSON: /api/errors/d27005691d1e99bd. Report an issue: GitHub.