From 95242ca7d6e8da8dde4361fe78abfa9679d72d4e Mon Sep 17 00:00:00 2001 From: Disty0 Date: Sat, 27 May 2023 09:46:20 +0300 Subject: [PATCH] Remove broken ipex auto detection --- installer.py | 2 +- webui.sh | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/installer.py b/installer.py index 92b6c9cfd..25a6e18c2 100644 --- a/installer.py +++ b/installer.py @@ -261,7 +261,7 @@ def check_torch(): os.environ.setdefault('PYTORCH_HIP_ALLOC_CONF', 'garbage_collection_threshold:0.9,max_split_size_mb:512') torch_command = os.environ.get('TORCH_COMMAND', 'torch==2.0.0 torchvision==0.15.1 --index-url https://download.pytorch.org/whl/rocm5.4.2') xformers_package = os.environ.get('XFORMERS_PACKAGE', 'none') - elif allow_ipex and (shutil.which('sycl-ls') is not None or os.path.exists('/opt/intel/oneapi') or args.use_ipex): + elif allow_ipex and args.use_ipex and shutil.which('sycl-ls') is not None: log.info('Intel OneAPI Toolkit detected') torch_command = os.environ.get('TORCH_COMMAND', 'torch==1.13.0a0 torchvision==0.14.1a0 intel_extension_for_pytorch==1.13.120+xpu -f https://developer.intel.com/ipex-whl-stable-xpu') xformers_package = os.environ.get('XFORMERS_PACKAGE', 'none') diff --git a/webui.sh b/webui.sh index 5e4df3f5b..2abf44a67 100755 --- a/webui.sh +++ b/webui.sh @@ -81,10 +81,15 @@ else exit 1 fi -if [[ "$@" == *"--use-ipex"* ]] +#Set OneAPI environmet if it's not set by the user +if [[ "$@" == *"--use-ipex"* ]] && ! [ -x "$(command -v sycl-ls)" ] then - echo "Setting OneAPI enviroment" - source /opt/intel/oneapi/setvars.sh + echo "Setting OneAPI environment" + if [[ -z "$ONEAPI_ROOT" ]] + then + ONEAPI_ROOT=/opt/intel/oneapi + fi + source $ONEAPI_ROOT/setvars.sh fi if [[ ! -z "${ACCELERATE}" ]] && [ ${ACCELERATE}="True" ] && [ -x "$(command -v accelerate)" ]