mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-08-18 02:42:21 +00:00
Update configure_igpu_lxc.sh
This commit is contained in:
parent
bda7834a4f
commit
2132ae79a6
@ -76,8 +76,8 @@ validate_container_id() {
|
||||
|
||||
|
||||
|
||||
# Configure LXC for Coral TPU and iGPU
|
||||
configure_lxc_for_igpu() {
|
||||
# Configure LXC for iGPU
|
||||
configure_lxc_for_igpu_() {
|
||||
validate_container_id
|
||||
CONFIG_FILE="/etc/pve/lxc/${CONTAINER_ID}.conf"
|
||||
if [ ! -f "$CONFIG_FILE" ]; then
|
||||
@ -131,6 +131,32 @@ configure_lxc_for_igpu() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
configure_lxc_for_igpu() {
|
||||
validate_container_id
|
||||
CONFIG_FILE="/etc/pve/lxc/${CONTAINER_ID}.conf"
|
||||
[[ -f "$CONFIG_FILE" ]] || { msg_error "$(translate 'Configuration file not found.')"; exit 1; }
|
||||
|
||||
|
||||
if ! grep -q "^unprivileged:" "$CONFIG_FILE"; then
|
||||
echo "unprivileged: 1" >> "$CONFIG_FILE"
|
||||
fi
|
||||
|
||||
|
||||
grep -q "^features: " "$CONFIG_FILE" || echo "features: nesting=1" >> "$CONFIG_FILE"
|
||||
grep -q "^lxc.cgroup2.devices.allow: c 226:\* rwm" "$CONFIG_FILE" || \
|
||||
echo "lxc.cgroup2.devices.allow: c 226:* rwm" >> "$CONFIG_FILE"
|
||||
grep -q "^lxc.mount.entry: /dev/dri " "$CONFIG_FILE" || \
|
||||
echo "lxc.mount.entry: /dev/dri dev/dri none bind,optional,create=dir" >> "$CONFIG_FILE"
|
||||
|
||||
msg_ok "$(translate 'iGPU configuration added to container') $CONTAINER_ID."
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Install iGPU drivers in the container
|
||||
install_igpu_in_container() {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user