Install Coral TPU on the Host

Hardware: GPUs and Coral-TPU~10 minView script

Prepare the Proxmox host so a Coral TPU can later be passed to an LXC container. ProxMenux auto-detects whether you have a M.2 / Mini-PCIe card, a USB Accelerator, or both, and runs only the install path that applies — kernel-module build via DKMS for PCIe, Google's Edge TPU runtime for USB.

What this does

A single hardware-aware installer selects the detected device paths. PCIe uses gasket and apex modules with DKMS; future rebuilds still need compatible driver sources and kernel headers. USB uses the libedgetpu1-std userspace runtime. If both types are detected, both paths run. USB runtime must be available where the app runs; a host runtime is not inherently required for an app running only inside LXC.

Which Coral do I have?

The two kinds of Coral devices you can plug into a Proxmox host look very different and the host-side install is very different too. The script handles both, but it's good to know what you have before running anything:

Form factorDetectionInstall typeReboot?
M.2 / Mini-PCIe
(M.2 cards include single- and dual-Edge-TPU variants)
PCI vendor 1ac1Kernel module (gasket + apex) via DKMSYes
USB Accelerator
(small plastic dongle)
USB 1a6e:089a (unprogrammed) / 18d1:9302 (programmed)User-space runtime (libedgetpu1-std) from Google APT repoNo

Before you start

  • A connected Coral TPU (M.2, Mini-PCIe or USB) is required for installation. Without detected hardware, the script can still offer cleanup or removal of an existing installation; it will not install a new hardware path.
    lspci -d 1ac1: ; lsusb | grep -E '1a6e:089a|18d1:9302'
  • Internet access on the host — for PCIe the DKMS path clones a GitHub repo, for USB it adds a Google APT repo and downloads the libedgetpu1-std package.
  • Kernel headers available via APT. On Proxmox this means proxmox-headers-$(uname -r) must be installable — needed only for the PCIe/M.2 path, but the script fetches it automatically so you don't have to.
  • Plan a reboot for PCIe hardware. The script attempts to load the built modules; a planned restart also verifies that they load automatically.

This only prepares the host

This prepares the host for device access; it does not configure or test an application. To use Coral in a compatible container application such as Frigate, continue with Add Coral TPU to an LXC.

Running the installer

Open ProxMenux on the host, go to Hardware: GPUs and Coral-TPU → Install/Update Coral TPU on Host.

Menu entry for 'Install/Update Coral TPU on Host' inside Hardware: GPUs and Coral-TPU

How the script runs

Hardware is detected first, so the install plan is shaped to your actual setup. Nothing is installed until you confirm.

Walking through the flow

Step 1

Hardware detection

The script reads /sys/bus/pci/devices/*/vendor looking for 0x1ac1 (Global Unichip Corp., the silicon vendor of the Coral TPU chips) and runs lsusb looking for the USB Accelerator IDs. The USB device has two IDs depending on whether its firmware has been loaded yet:

  • 1a6e:089a — Global Unichip, unprogrammed state (before the Edge TPU runtime talks to it the first time).
  • 18d1:9302 — Google, programmed state (after the runtime loads firmware onto it).

If no Coral is detected and no installation exists, the script exits with an explanatory dialog. Existing components can still trigger the cleanup or removal menu.

Step 2

Pre-install prompt

Before the installation steps, a dialog lists detected devices and the planned components. Cancel to skip installation. Optional legacy cleanup has its own earlier confirmation.

Pre-install dialog showing detected Coral hardware (M.2/PCIe count + USB count) and the list of steps the installer will run
Step 3

PCIe path — gasket + apex kernel modules via DKMS

Only runs if the script found a PCIe / M.2 Coral. It's the heavier of the two paths because it's compiling a kernel module for your exact running kernel.

  1. Cleanup. Any existing gasket-dkms package is removed before rebuilding; if it is in a broken package state, the script forces its removal and purge.
  2. Install build deps: git, dkms, build-essential, proxmox-headers-$(uname -r).
  3. Clone the driver source. Prefers feranick/gasket-driver, falling back to google/gasket-driver if unavailable. A successful build still depends on kernel compatibility. The Google fallback receives these version-dependent patches:
    • For kernel 6.5+, the fallback patch replaces no_llseek with noop_llseek.
    • Kernel 6.13+ : MODULE_IMPORT_NS(DMA_BUF) requires string literal
  4. Stage sources under /usr/src/gasket-1.0/, generate dkms.conf, register with dkms add.
  5. Build and install: dkms build followed by dkms install. On failure, the script displays the last 50 lines of make.log if that file is available.
  6. Create the apex group + udev rules (/etc/udev/rules.d/99-coral-apex.rules) so /dev/apex_* nodes get the right group on the next boot.
  7. Load the modules: modprobe gasket + modprobe apex.
DKMS build progress + module load output for the gasket/apex kernel modules
Step 4

USB path — Edge TPU runtime from Google

Only runs if a USB Accelerator was detected. Much simpler:

  1. Add Google's GPG key to /etc/apt/keyrings/coral-edgetpu.gpg.
  2. Add the APT repository in /etc/apt/sources.list.d/coral-edgetpu.list, with signed-by= restricting verification to its keyring. This is one-line .list syntax, not deb822 .sources syntax.
  3. Install libedgetpu1-std — the standard-performance Edge TPU runtime.
  4. Reload udev so the rules shipped with the package apply to the USB device without having to unplug/replug.

Why libedgetpu1-std and not libedgetpu1-max?

The max package enables the maximum supported clock frequency, increasing performance, power use and heat compared with the standard runtime. Check the accelerator’s cooling and operating conditions before switching. The packages are mutually exclusive; install the alternative with apt install libedgetpu1-max.
Step 5

Reboot prompt (only if PCIe ran)

After the PCIe path, the script offers a reboot. It has attempted modprobe, but verify that the modules load and /dev/apex_0 appears with group apex. A planned reboot also checks automatic loading. USB-only installation does not prompt for a host reboot.

Final summary + reboot prompt after a PCIe install

Cleaning up legacy gasket-dkms on USB-only hosts

If the host has no detected PCIe / M.2 Coral but still contains a previous gasket-dkms installation, ProxMenux identifies that state separately and offers an optional cleanup. Nothing is removed without confirmation.

  • If a PCIe / M.2 Coral is present, this cleanup is never offered; the normal DKMS rebuild path is used instead.
  • The cleanup purges gasket-dkms, removes stale gasket DKMS registrations and source trees, and repairs pending dpkg / APT state.
  • The USB runtime packages libedgetpu1-std and libedgetpu1-max are left untouched, so a USB Coral keeps its runtime.
  • The script verifies that the legacy package is gone and that package management is healthy before reporting success.

Confirm the hardware first

If a PCIe / M.2 Coral may be installed but is not being detected, cancel the cleanup and check the card, slot and firmware settings before continuing.

Reinstall or uninstall

Running the installer on a host where Coral is already installed (PCIe via gasket-dkms, USB via libedgetpu1-std/libedgetpu1-max, or both) no longer drops straight into another fresh install. Instead, ProxMenux detects the existing setup and shows an action menu so you can decide what to do.

Coral action menu with two choices — Reinstall / update Coral drivers, or Uninstall Coral drivers and configuration — shown when the installer detects a previous Coral install on the host
The action menu only appears when at least one Coral component is already installed (DKMS gasket entry, libedgetpu1-* package, or live /dev/apex_* device nodes).

Reinstall / update

Continues with the normal install flow — useful after a kernel upgrade if the DKMS rebuild didn't happen automatically, or to lift the runtime to a newer libedgetpu1-* from the Google Coral apt repo. The previous DKMS state is cleaned up first so a half-installed package from a failed earlier attempt doesn't block the new build.

Uninstall — what gets removed

Requires confirmation before removal. LXC applications using /dev/apex_* may lose access during removal or after the next reboot. The removal sequence is:

  • Attempts to unload apex and gasket; active users can prevent module removal.
  • Removes every DKMS-registered gasket/<version> entry so the modules don't come back on the next kernel install.
  • Purges the gasket-dkms, libedgetpu1-std and libedgetpu1-max apt packages, then runs apt-get autoremove --purge.
  • Deletes the udev rule /etc/udev/rules.d/99-coral-apex.rules ProxMenux wrote; restores the upstream 60-gasket-dkms.rules group to its default if it's still present.
  • Checks the supplementary member list of apex. If that list is empty, it attempts group removal; otherwise it retains apex and lists its members. This is not a complete check of primary-group users.
  • Removes the repository list /etc/apt/sources.list.d/coral-edgetpu.list, the legacy coral-cloud.list and old keyrings named coral-edgetpu-archive-keyring.gpg. The current keyring at /etc/apt/keyrings/coral-edgetpu.gpg is not removed by this sequence.
  • Prompts for a reboot at the end only if the PCIe path was installed — the cleanest way to flush the kernel modules. USB-only uninstalls don't need one.

LXC containers with apex passthrough

Removing the host components can break LXC device access. Schedule maintenance if compatible applications such as Frigate depend on this Coral.

Update notifications

ProxMenux now tracks the installed Coral components in its managed-installs registry. Both variants are followed independently — a host with both M.2 and USB Coral devices gets two update streams, each with its own upstream source:

VariantTracked versionUpstream source
PCIe / M.2Recorded release tag from the successful installation, then a healthy gasket-dkms package version, with the DKMS module version as fallback. The bare DKMS version does not identify the fork’s patch level.Latest tag of feranick/gasket-driver on GitHub (7-day cache, build-number comparison)
USBlibedgetpu1-std or libedgetpu1-max apt versionLocal apt-cache policy candidate (Google Coral apt repo)

When a newer version is detected the Monitor fires a coral_driver_update_available notification on every enabled channel (Telegram, Discord, Gotify, ntfy, email, webhook). The notification points back at the same installer entry — pick Reinstall / update from the action menu above to apply it.

Anti-cascade by design

One notification per variant, only when the upstream version actually changes — never on every 24h scan. If you ignore an update it doesn't re-ping you until a newer release lands.

PCIe updates: plan a reboot

A rebuilt PCIe module must be loaded before it takes effect; a planned reboot also verifies automatic loading. A USB userspace-library upgrade needs no host reboot, but applications using the old library may need a restart.

Manual equivalent

If you want to know what happens under the hood, or redo an individual step by hand, the raw commands per path look like this.

PCIe / M.2 (gasket + apex via DKMS)

# Build deps
apt-get update
apt-get install -y git dkms build-essential "proxmox-headers-$(uname -r)"

# Clone the (maintained) fork
cd /tmp
rm -rf gasket-driver
git clone --depth=1 https://github.com/feranick/gasket-driver.git

# Stage under /usr/src for DKMS
mkdir -p /usr/src/gasket-1.0
cp -a /tmp/gasket-driver/src/. /usr/src/gasket-1.0/

# Tell DKMS what it is
cat > /usr/src/gasket-1.0/dkms.conf <<'EOF'
PACKAGE_NAME="gasket"
PACKAGE_VERSION="1.0"
BUILT_MODULE_NAME[0]="gasket"
BUILT_MODULE_NAME[1]="apex"
DEST_MODULE_LOCATION[0]="/updates/dkms"
DEST_MODULE_LOCATION[1]="/updates/dkms"
MAKE[0]="make KVERSION=${kernelver}"
CLEAN="make clean"
AUTOINSTALL="yes"
EOF

# Register + build + install
dkms add    /usr/src/gasket-1.0
dkms build  gasket/1.0 -k "$(uname -r)"
dkms install gasket/1.0 -k "$(uname -r)"

# Load it
modprobe gasket
modprobe apex

# Group + udev so /dev/apex_* end up with sane perms
groupadd --system apex 2>/dev/null || true
cat > /etc/udev/rules.d/99-coral-apex.rules <<'EOF'
KERNEL=="apex_*",   GROUP="apex", MODE="0660"
SUBSYSTEM=="apex",  GROUP="apex", MODE="0660"
EOF
udevadm control --reload-rules
udevadm trigger --subsystem-match=apex || true

# (Reboot recommended)

USB (libedgetpu runtime)

# GPG key + repo (modern signed-by layout)
mkdir -p /etc/apt/keyrings
curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg \
  | gpg --dearmor -o /etc/apt/keyrings/coral-edgetpu.gpg
chmod 0644 /etc/apt/keyrings/coral-edgetpu.gpg

echo 'deb [signed-by=/etc/apt/keyrings/coral-edgetpu.gpg] https://packages.cloud.google.com/apt coral-edgetpu-stable main' \
  > /etc/apt/sources.list.d/coral-edgetpu.list

# Install the runtime
apt-get update
apt-get install -y libedgetpu1-std

# Reload udev so shipped rules apply to anything already plugged in
udevadm control --reload-rules
udevadm trigger --subsystem-match=usb || true

Verification

PCIe / M.2

# Module loaded?
lsmod | grep apex
# Expect: apex, gasket (gasket as dependency)

# Device node present with apex group?
ls -l /dev/apex_*
# Expect: crw-rw---- 1 root apex ...  /dev/apex_0

# Kernel sees the device cleanly?
dmesg | grep -i apex | tail -10
# Expect: "Apex chip ID ..." / "apex 0000:xx:00.0: Apex performance changed to ..."

USB

# Is it seen by USB?
lsusb | grep -E '1a6e:089a|18d1:9302'

# Runtime installed?
dpkg -l libedgetpu1-std | grep ii

# Quick smoke test — run the Coral classification example from any Python env
#   pip install pycoral tflite_runtime pillow
# (Ran from the container that will use the TPU, not the host.)

Troubleshooting

DKMS build fails after a kernel upgrade

Missing headers are one possible cause. Verify proxmox-headers-$(uname -r) with dpkg -l proxmox-headers-$(uname -r). Install them if missing, then inspect the build log for source/kernel incompatibility. Re-running invokes cleanup_broken_gasket_dkms, but cleanup cannot guarantee compatibility with every kernel.

/dev/apex_0 missing after reboot

Check whether the PCIe device is detected and the module matches the running kernel. Try modprobe apex and inspect dmesg | grep -iE "apex|gasket". Build failures, module loading or slot/firmware configuration can prevent device creation.

Can see /dev/apex_0 but LXC can't

A visible host node alone does not prove the device works. Verify host access, then the LXC mount, cgroup rules and numeric user/group permissions. See Add Coral TPU to an LXC.

USB Accelerator detected but Frigate / TFLite can't reach it

Check the rules supplied by libedgetpu1-std and inspect permissions with ls -l /dev/bus/usb/*/*. The application’s mapped user/group needs read/write access; root ownership alone is not an error. After changing rules, run udevadm control --reload-rules && udevadm trigger and reconnect the device if needed.

Install log

Every run writes to /tmp/coral_install.log on the host. If the DKMS build dies, the script also appends the last 50 lines of /var/lib/dkms/gasket/1.0/build/make.log to that log — attach it when asking for help on GitHub.

Related