diff --git a/AppImage/components/hardware.tsx b/AppImage/components/hardware.tsx index c271fce7..1a6c13fa 100644 --- a/AppImage/components/hardware.tsx +++ b/AppImage/components/hardware.tsx @@ -2300,8 +2300,7 @@ title="AMD GPU Tools Installation" scriptName="switch_gpu_mode_direct" params={{ EXECUTION_MODE: "web", - GPU_SLOT: switchModeParams.gpuSlot, - TARGET_MODE: switchModeParams.targetMode, + GPU_SWITCH_PARAMS: `${switchModeParams.gpuSlot}|${switchModeParams.targetMode}`, }} title={`GPU Switch Mode → ${switchModeParams.targetMode.toUpperCase()}`} description={`Switching GPU ${switchModeParams.gpuSlot} to ${switchModeParams.targetMode === "vm" ? "VM (VFIO passthrough)" : "LXC (native driver)"} mode...`} diff --git a/scripts/gpu_tpu/switch_gpu_mode_direct.sh b/scripts/gpu_tpu/switch_gpu_mode_direct.sh index acef6cff..d110c3cb 100644 --- a/scripts/gpu_tpu/switch_gpu_mode_direct.sh +++ b/scripts/gpu_tpu/switch_gpu_mode_direct.sh @@ -878,7 +878,14 @@ final_summary() { # Parse Arguments (supports both CLI args and env vars) # ========================================================== 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 "$TARGET_MODE" ]] && PARAM_TARGET_MODE="$TARGET_MODE" @@ -908,8 +915,7 @@ main() { # Debug: Show received environment variables echo "[DEBUG] Environment variables received:" - echo "[DEBUG] GPU_SLOT='$GPU_SLOT'" - echo "[DEBUG] TARGET_MODE='$TARGET_MODE'" + echo "[DEBUG] GPU_SWITCH_PARAMS='$GPU_SWITCH_PARAMS'" echo "[DEBUG] EXECUTION_MODE='$EXECUTION_MODE'" echo ""