Enable Coral TPU in an LXC

This guide explains how to configure Google Coral TPU support for LXC containers in Proxmox VE using ProxMenux. Coral TPU provides dedicated AI acceleration, improving inference performance for machine learning applications. It is particularly useful for video surveillance applications with real-time video analysis, such as Frigate or Agent DVR or Blue Iris using CodeProject.AI.

Overview

The script automates the following steps:

  1. Allows selection of an existing LXC container.
  2. Ensures the container is privileged for hardware access.
  3. Configures LXC parameters for Coral TPU and Intel iGPU.
  4. Installs required drivers and dependencies inside the container.

Implementation Steps

1

Select an LXC Container

The script lists available LXC containers and prompts for selection.

2

Modify Container Configuration

The script applies necessary changes to enable Coral TPU:

  • Switches the container to privileged mode if required.
  • Enables nesting to allow GPU and TPU usage.
  • Sets device permissions for TPU and iGPU.
  • Configures proper device mounts.
3

Install Required Drivers

The script installs the necessary components inside the container:

  • GPU drivers (va-driver-all, intel-opencl-icd).
  • Coral TPU dependencies (Python, GPG keys, repository setup).
  • Coral TPU drivers (USB and M.2 support).
4

Select Coral TPU Driver Version

If a Coral M.2 device is detected, the script prompts the user to select:

  • Standard mode - balanced performance.
  • Maximum performance mode - higher speed, increased power usage.

Expected Results

  • The selected container is correctly configured for TPU and iGPU usage.
  • Required drivers and dependencies are installed inside the container.
  • The container will restart as needed during the process.
  • After completion, applications inside the container can utilize Coral TPU acceleration.

Important Considerations

  • The script supports both USB and M.2 Coral TPU devices.
  • The Proxmox host must have the required Coral TPU and Intel GPU drivers installed.
  • Additional application-specific configurations may be required inside the container.