Compatibility

System Requirements

ComponentRequirement
OSLinux (kernel 4.14+ for V4L2)
Architecturex86_64 (ONNX Runtime binaries)
Rust1.85+ (edition 2024)
CameraV4L2-compatible (USB webcam, built-in IR)
PAMLinux-PAM (pam 1.5+)

Tested Distributions

DistributionInit SystemModeStatus
Arch Linuxsystemddaemon + D-Bus activationPrimary target
Arch LinuxsystemdoneshotTested
Container (Arch)nonedaemon (manual)CI-tested
Container (Arch)noneoneshotCI-tested

Expected to Work (untested)

DistributionInit SystemMode
Fedora 38+systemddaemon + D-Bus activation
Ubuntu 22.04+systemddaemon + D-Bus activation
Debian 12+systemddaemon + D-Bus activation
Any Linuxany / noneoneshot
Void Linuxrunitoneshot or manual daemon
Alpine LinuxOpenRConeshot or manual daemon
GentooOpenRC / systemdoneshot or daemon

Camera Compatibility

IR cameras provide anti-spoofing protection. Facelock auto-detects IR cameras by:

  • Device name containing "ir" or "infrared"
  • Supporting GREY or Y16 pixel formats

Known working:

  • Logitech BRIO (IR mode)
  • Intel RealSense (IR stream)
  • Most laptops with Windows Hello IR cameras

RGB Cameras (development only)

RGB cameras work with security.require_ir = false but provide no anti-spoofing. Any photo of the enrolled user will authenticate.

Format Support

FormatSupportNotes
MJPGFullMost common USB camera format
YUYVFullRaw format, converted to RGB
GREYFullIR cameras, replicated to RGB
OtherNot supportedCamera negotiates to supported format

Init System Support

Full support via D-Bus activation:

sudo facelock setup --systemd

Features:

  • D-Bus activation (daemon starts on first connection)
  • Idle timeout (daemon stops when idle)
  • Service hardening (ProtectSystem, NoNewPrivileges, etc.)
  • Automatic restart on failure

Non-systemd

Use oneshot mode (no daemon needed):

[daemon]
mode = "oneshot"

Or manage the daemon manually:

facelock daemon &                    # start
kill $(pidof facelock)               # stop

For process supervisors (runit, s6, dinit, OpenRC), create a service that runs facelock daemon. The daemon handles SIGTERM for graceful shutdown.

PAM Stack Compatibility

Facelock works with standard Linux-PAM. The module is installed as:

auth  sufficient  pam_facelock.so

Tested PAM Services

ServiceFileNotes
sudo/etc/pam.d/sudoPrimary target, safest to test first
polkit/etc/pam.d/polkit-1GUI privilege escalation
ServiceReason
system-authAffects ALL auth -- test sudo first
loginConsole login -- hard to recover if broken
sshdSSH has no camera -- always fails

Build Dependencies

Runtime

  • pam (Linux-PAM library)
  • gcc-libs (C runtime)

Build

  • rust + cargo (1.85+)
  • clang (for ONNX Runtime bindings)
  • System headers: libv4l-dev, libxkbcommon-dev, libpam0g-dev (names vary by distro)

Optional

  • tpm2-tss -- TPM2 support for embedding encryption
  • podman or docker -- container testing

ONNX Runtime

Facelock uses the ort crate (Rust bindings for ONNX Runtime). The runtime binary is downloaded at build time via the download-binaries feature.

Execution Providers

GPU support is runtime-only -- no special build flags needed. Install a GPU-enabled ONNX Runtime package and set execution_provider in config.

ProviderConfigRuntime RequirementStatus
CPUexecution_provider = "cpu"none (default)Working
CUDA (NVIDIA)execution_provider = "cuda"CUDA toolkit + GPU-enabled ORTConfig ready, untested
ROCm (AMD)execution_provider = "rocm"ROCm runtime + GPU-enabled ORTConfig ready, untested
OpenVINO (Intel)execution_provider = "openvino"OpenVINO runtime + GPU-enabled ORTConfig ready, untested

CPU is the default and only tested provider.