From 3f2e573e2464e5a29ef71d79ddab10c22bb899a0 Mon Sep 17 00:00:00 2001 From: Disty0 Date: Mon, 6 Nov 2023 22:44:17 +0300 Subject: [PATCH 1/3] Add STARTUP_CMD and STARTUP_CMD_ARGS env var --- gui.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gui.sh b/gui.sh index debca42fa..dce3c34d7 100755 --- a/gui.sh +++ b/gui.sh @@ -85,7 +85,13 @@ then export ClDeviceGlobalMemSizeAvailablePercent=100 fi +#Set STARTUP_CMD as normal python if not specified +if [[ -z "$STARTUP_CMD" ]] +then + STARTUP_CMD=python +fi + # Validate the requirements and run the script if successful if python "$SCRIPT_DIR/setup/validate_requirements.py" -r "$REQUIREMENTS_FILE"; then - python "$SCRIPT_DIR/kohya_gui.py" "$@" + "${STARTUP_CMD}" $STARTUP_CMD_ARGS "$SCRIPT_DIR/kohya_gui.py" "$@" fi From a9cd3c9f756067989af735b6c58583118a126942 Mon Sep 17 00:00:00 2001 From: Disty0 Date: Mon, 6 Nov 2023 23:21:00 +0300 Subject: [PATCH 2/3] Add ipexrun support --- gui.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gui.sh b/gui.sh index dce3c34d7..f80b8093d 100755 --- a/gui.sh +++ b/gui.sh @@ -83,6 +83,14 @@ then fi export NEOReadDebugKeys=1 export ClDeviceGlobalMemSizeAvailablePercent=100 + if [[ -z "$STARTUP_CMD" ]] && [[ -z "$DISABLE_IPEXRUN" ]] + then + STARTUP_CMD=ipexrun + if [[ -z "$STARTUP_CMD_ARGS" ]] + then + STARTUP_CMD_ARGS="--multi-task-manager taskset --memory-allocator jemalloc" + fi + fi fi #Set STARTUP_CMD as normal python if not specified From 44519481bc80c6a4696ba669192bab1d73b6106c Mon Sep 17 00:00:00 2001 From: Disty0 Date: Tue, 7 Nov 2023 00:46:53 +0300 Subject: [PATCH 3/3] More checks for ipexrun --- gui.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui.sh b/gui.sh index f80b8093d..a2ce52a45 100755 --- a/gui.sh +++ b/gui.sh @@ -83,7 +83,7 @@ then fi export NEOReadDebugKeys=1 export ClDeviceGlobalMemSizeAvailablePercent=100 - if [[ -z "$STARTUP_CMD" ]] && [[ -z "$DISABLE_IPEXRUN" ]] + if [[ -z "$STARTUP_CMD" ]] && [[ -z "$DISABLE_IPEXRUN" ]] && [ -x "$(command -v ipexrun)" ] then STARTUP_CMD=ipexrun if [[ -z "$STARTUP_CMD_ARGS" ]]