﻿# Preserve accelerator device permissions across recreation

Trace device permissions to their event-driven owner and verify recreation under the real service identity.

Author: Retrivium editorial team
Updated: 2026-11-03
Canonical URL: https://retrivium.ai/journal/guide-linux-device-udev/
Language: en

A service can access an accelerator after a manual permission change, but loses access when its device node is recreated. The change affected one filesystem object, while the device-management rules remain the source of future state. Inspect the creation event and rule ownership before repeating a chmod that cannot define recreation behavior.

## Identify the actual node

Record device identity, path, ownership, mode and the service's effective user and groups. A symlink and its target can have different diagnostic roles. Preserve the kernel device relationship rather than trusting a short index that can change across discovery. Access failure can also involve a namespace or device-control boundary, so mode alone is not a complete permission diagnosis.

## Follow the event-driven policy

udev receives device events and applies matching rules to manage attributes, permissions and links. Read the applicable rule files and precedence for the installed environment. A manually changed existing node does not amend those rules. Another creation or change event can therefore produce the configured state again without any mysterious reversal by the model process.

## Match stable properties narrowly

Use the documented device properties to understand which rule selects the intended hardware. A broad wildcard can unintentionally affect unrelated accelerators or other devices. Inspect the selected attributes through read-only information queries before proposing a rule. Vendor-provided management may own part of the lifecycle, so avoid creating a competing local rule without understanding the supported integration.

## Separate node existence from readiness

A device node can exist before the intended service is ready to use its complete runtime path. Device-unit activation and application initialization are different milestones. Similarly, the right mode does not grant container injection or cgroup device access automatically. Preserve each boundary in the evidence instead of treating permission bits as a universal explanation for every accelerator-access error.

## Verify recreation in a disposable setup

Use an isolated fixture with the intended supported device lifecycle to compare rule evaluation, recreated metadata and access under the actual service identity. Do not trigger production device events as a guess. Acceptance establishes persistent intended permissions for that path. It does not authenticate application clients, validate driver health or justify granting every local user unrestricted access to all accelerator nodes.

## Primary references

[Dynamic Device Management](https://www.freedesktop.org/software/systemd/man/latest/udev.html).

[Device Database and Event Diagnostics](https://www.freedesktop.org/software/systemd/man/latest/udevadm.html).

[systemd Device Units](https://www.freedesktop.org/software/systemd/man/latest/systemd.device.html).

Related reading: [GPU containers or virtual machines: what to check before deployment](/journal/gpu-containers-vs-vms/); [NVML Unknown Error after daemon-reload: when a container loses its GPU](/journal/nvidia-container-nvml-systemd-reload/).
