mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-04-25 00:46:21 +00:00
update switch_gpu_mode_direct.sh
This commit is contained in:
@@ -2300,8 +2300,7 @@ title="AMD GPU Tools Installation"
|
|||||||
scriptName="switch_gpu_mode_direct"
|
scriptName="switch_gpu_mode_direct"
|
||||||
params={{
|
params={{
|
||||||
EXECUTION_MODE: "web",
|
EXECUTION_MODE: "web",
|
||||||
GPU_SLOT: switchModeParams.gpuSlot,
|
GPU_SWITCH_PARAMS: `${switchModeParams.gpuSlot}|${switchModeParams.targetMode}`,
|
||||||
TARGET_MODE: switchModeParams.targetMode,
|
|
||||||
}}
|
}}
|
||||||
title={`GPU Switch Mode → ${switchModeParams.targetMode.toUpperCase()}`}
|
title={`GPU Switch Mode → ${switchModeParams.targetMode.toUpperCase()}`}
|
||||||
description={`Switching GPU ${switchModeParams.gpuSlot} to ${switchModeParams.targetMode === "vm" ? "VM (VFIO passthrough)" : "LXC (native driver)"} mode...`}
|
description={`Switching GPU ${switchModeParams.gpuSlot} to ${switchModeParams.targetMode === "vm" ? "VM (VFIO passthrough)" : "LXC (native driver)"} mode...`}
|
||||||
|
|||||||
@@ -878,7 +878,14 @@ final_summary() {
|
|||||||
# Parse Arguments (supports both CLI args and env vars)
|
# Parse Arguments (supports both CLI args and env vars)
|
||||||
# ==========================================================
|
# ==========================================================
|
||||||
parse_arguments() {
|
parse_arguments() {
|
||||||
# First, check environment variables (set by ScriptTerminalModal)
|
# First, check combined parameter (format: "SLOT|MODE")
|
||||||
|
# This is the primary method used by ProxMenux Monitor
|
||||||
|
if [[ -n "$GPU_SWITCH_PARAMS" ]]; then
|
||||||
|
PARAM_GPU_SLOT="${GPU_SWITCH_PARAMS%%|*}"
|
||||||
|
PARAM_TARGET_MODE="${GPU_SWITCH_PARAMS##*|}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Also check individual environment variables as fallback
|
||||||
[[ -n "$GPU_SLOT" ]] && PARAM_GPU_SLOT="$GPU_SLOT"
|
[[ -n "$GPU_SLOT" ]] && PARAM_GPU_SLOT="$GPU_SLOT"
|
||||||
[[ -n "$TARGET_MODE" ]] && PARAM_TARGET_MODE="$TARGET_MODE"
|
[[ -n "$TARGET_MODE" ]] && PARAM_TARGET_MODE="$TARGET_MODE"
|
||||||
|
|
||||||
@@ -908,8 +915,7 @@ main() {
|
|||||||
|
|
||||||
# Debug: Show received environment variables
|
# Debug: Show received environment variables
|
||||||
echo "[DEBUG] Environment variables received:"
|
echo "[DEBUG] Environment variables received:"
|
||||||
echo "[DEBUG] GPU_SLOT='$GPU_SLOT'"
|
echo "[DEBUG] GPU_SWITCH_PARAMS='$GPU_SWITCH_PARAMS'"
|
||||||
echo "[DEBUG] TARGET_MODE='$TARGET_MODE'"
|
|
||||||
echo "[DEBUG] EXECUTION_MODE='$EXECUTION_MODE'"
|
echo "[DEBUG] EXECUTION_MODE='$EXECUTION_MODE'"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user