diff --git a/scripts/configure_igpu_lxc.sh b/scripts/configure_igpu_lxc.sh index d848d89..7c3e362 100644 --- a/scripts/configure_igpu_lxc.sh +++ b/scripts/configure_igpu_lxc.sh @@ -39,7 +39,6 @@ initialize_cache - # Select LXC container select_container() { CONTAINERS=$(pct list | awk 'NR>1 {print $1, $3}' | xargs -n2) @@ -66,7 +65,6 @@ select_container() { - # Validate that the selected container is valid validate_container_id() { if [ -z "$CONTAINER_ID" ]; then @@ -84,7 +82,6 @@ validate_container_id() { - # Configure LXC for Coral TPU and iGPU configure_lxc_hardware() { validate_container_id @@ -127,83 +124,32 @@ configure_lxc_hardware() { echo "lxc.mount.entry: /dev/fb0 dev/fb0 none bind,optional,create=file" >> "$CONFIG_FILE" fi - # Configure Coral TPU (USB and M.2) - if ! grep -Pq "^lxc.cgroup2.devices.allow: c 189:\* rwm # Coral USB$" "$CONFIG_FILE"; then - echo "lxc.cgroup2.devices.allow: c 189:* rwm # Coral USB" >> "$CONFIG_FILE" - fi - - if ! grep -Pq "^lxc.mount.entry: /dev/bus/usb dev/bus/usb none bind,optional,create=dir$" "$CONFIG_FILE"; then - echo "lxc.mount.entry: /dev/bus/usb dev/bus/usb none bind,optional,create=dir" >> "$CONFIG_FILE" - fi - - if ! grep -Pq "^lxc.mount.entry: /dev/apex_0 dev/apex_0 none bind,optional,create=file$" "$CONFIG_FILE"; then - echo "lxc.mount.entry: /dev/apex_0 dev/apex_0 none bind,optional,create=file" >> "$CONFIG_FILE" - fi msg_ok "$(translate 'Coral TPU and iGPU configuration added to container') $CONTAINER_ID." } +# Install iGPU drivers in the container +install_igpu_in_container() { - -# Install Coral TPU drivers in the container -install_coral_in_container() { - echo -ne "${TAB}${YW}- $(translate 'Installing iGPU and Coral TPU drivers inside the container...') ${CL}" - + echo -ne "${TAB}${YW}-$(translate 'Installing iGPU drivers inside the container...') ${CL}" pct start "$CONTAINER_ID" + pct exec "$CONTAINER_ID" -- bash -c " - CORAL_M2=$(lspci | grep -i "Global Unichip") - if [[ -n "$CORAL_M2" ]]; then - DRIVER_OPTION=$(whiptail --title "$(translate 'Select driver version')" \ - --menu "$(translate 'Choose the driver version for Coral M.2:\n\nCaution: Maximum mode generates more heat.')" 15 60 2 \ - 1 "libedgetpu1-std ($(translate 'standard performance'))" \ - 2 "libedgetpu1-max ($(translate 'maximum performance'))" 3>&1 1>&2 2>&3) - - case "$DRIVER_OPTION" in - 1) DRIVER_PACKAGE="libedgetpu1-std" ;; - 2) DRIVER_PACKAGE="libedgetpu1-max" ;; - *) DRIVER_PACKAGE="libedgetpu1-std" ;; - esac - else - DRIVER_PACKAGE="libedgetpu1-std" - fi - - pct exec "$CONTAINER_ID" -- bash <