diff --git a/scripts/configure_igpu_lxc.sh b/scripts/configure_igpu_lxc.sh index f3a90ea..8859c41 100644 --- a/scripts/configure_igpu_lxc.sh +++ b/scripts/configure_igpu_lxc.sh @@ -41,7 +41,7 @@ select_container() { fi CONTAINER_ID=$(whiptail --title "$(translate 'Select Container')" \ - --menu "$(translate 'Select the LXC container:')" 15 60 5 $CONTAINERS 3>&1 1>&2 2>&3) + --menu "$(translate 'Select the LXC container:')" 15 60 8 $CONTAINERS 3>&1 1>&2 2>&3) if [ -z "$CONTAINER_ID" ]; then msg_error "$(translate 'No container selected. Exiting.')" @@ -95,6 +95,15 @@ configure_lxc_for_igpu() { msg_ok "$(translate 'Container changed to privileged.')" fi + + if grep -q "^lxc.apparmor.profile" "$CONFIG_FILE"; then + msg_info "$(translate 'Disabling AppArmor profile to avoid conflicts...')" + sed -i "/^lxc.apparmor.profile/d" "$CONFIG_FILE" + msg_ok "$(translate 'AppArmor profile removed.')" + fi + + + # Configure iGPU if ! grep -q "features: nesting=1" "$CONFIG_FILE"; then echo "features: nesting=1" >> "$CONFIG_FILE" @@ -128,12 +137,12 @@ install_igpu_in_container() { tput sc LOG_FILE=$(mktemp) - pct start "$CONTAINER_ID" + msg_info "$(translate 'Installing iGPU drivers...')" + pct start "$CONTAINER_ID" >/dev/null 2>&1 + script -q -c "pct exec \"$CONTAINER_ID\" -- bash -c ' set -e - echo \"- Updating package lists...\" - apt-get update - echo \"- Installing iGPU drivers...\" + apt-get update >/dev/null 2>&1 apt-get install -y va-driver-all ocl-icd-libopencl1 intel-opencl-icd vainfo intel-gpu-tools chgrp video /dev/dri && chmod 755 /dev/dri adduser root video && adduser root render @@ -161,5 +170,5 @@ configure_lxc_for_igpu install_igpu_in_container -msg_ok "$(translate 'iGPU configuration completed in container') $CONTAINER_ID." +msg_success "$(translate 'iGPU configuration completed in container') $CONTAINER_ID." sleep 2 diff --git a/web/app/docs/hardware/coral-tpu-lxc/page.tsx b/web/app/docs/hardware/coral-tpu-lxc/page.tsx index b468c04..0a04470 100644 --- a/web/app/docs/hardware/coral-tpu-lxc/page.tsx +++ b/web/app/docs/hardware/coral-tpu-lxc/page.tsx @@ -1,87 +1,83 @@ -import type { Metadata } from "next" -import { Steps } from "@/components/ui/steps" +"use client" -export const metadata: Metadata = { - title: "Coral TPU to an LXC | ProxMenux Documentation", - description: "Learn how to add Coral TPU support to an LXC container in Proxmox VE.", +import { Steps } from "@/components/ui/steps" +import CopyableCode from "@/components/CopyableCode" +import Image from "next/image" + +export const metadata = { + title: "Enable Coral TPU in LXC | ProxMenux Documentation", + description: "Step-by-step guide to enable Google Coral TPU support in an LXC container using ProxMenux.", } export default function CoralTPULXC() { return (
-

Coral TPU to an LXC

- +

Enable Coral TPU in an LXC

+

- This script automates the process of adding Google Coral TPU (Tensor Processing Unit) support to LXC containers - in Proxmox VE. It configures containers to leverage the power of Coral TPU for AI and machine learning tasks, - significantly accelerating inference operations. + 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.

- -

What Does This Script Do?

-

When executed, this script performs the following actions:

+ +

Overview

+

The script automates the following steps:

    -
  1. Presents a list of available LXC containers for selection
  2. -
  3. Configures the selected container to support both Coral TPU and Intel iGPU
  4. -
  5. Installs necessary drivers and tools inside the container
  6. -
  7. Sets up proper permissions and mounts for hardware access
  8. +
  9. Allows selection of an existing LXC container.
  10. +
  11. Ensures the container is privileged for hardware access.
  12. +
  13. Configures LXC parameters for Coral TPU and Intel iGPU.
  14. +
  15. Installs required drivers and dependencies inside the container.
- -

Key Steps

+ +

Implementation Steps

- -

You'll be prompted to select the LXC container you want to enable Coral TPU support for.

+ +

The script lists available LXC containers and prompts for selection.

- -

The script modifies the container's configuration to allow Coral TPU and iGPU access. This includes:

+ +

The script applies necessary changes to enable Coral TPU:

    -
  • Ensuring the container is privileged (for necessary permissions)
  • -
  • Enabling nesting feature
  • -
  • Adding device permissions for TPU and GPU access
  • -
  • Setting up proper mounts for TPU and GPU devices
  • +
  • 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.
- -

Inside the container, the script installs required packages:

+ +

The script installs the necessary components inside the container:

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

- If a Coral M.2 device is detected, you'll be prompted to choose between standard and maximum performance - drivers. -

+ +

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.
  • +
- -

What to Expect

+ +

Expected Results

- -

Important Notes

+ +

Important Considerations

- +

- This script simplifies the process of enabling Coral TPU and iGPU acceleration in your LXC containers without - the need for manual configuration file editing or running complex commands. This setup is ideal for AI and - machine learning workloads that can benefit from hardware acceleration. + By using ProxMenux, Coral TPU and iGPU support can be enabled in LXC containers efficiently, avoiding manual configuration steps.

) } - diff --git a/web/app/docs/hardware/igpu-acceleration-lxc/page.tsx b/web/app/docs/hardware/igpu-acceleration-lxc/page.tsx index 95db2e0..d16fb43 100644 --- a/web/app/docs/hardware/igpu-acceleration-lxc/page.tsx +++ b/web/app/docs/hardware/igpu-acceleration-lxc/page.tsx @@ -65,13 +65,9 @@ export default function IGPUAccelerationLXC() {

Important Notes

-

- By using ProxMenux, you can enable iGPU acceleration in your LXC containers easily, without manual configuration. -

) }