intel / intel-extension-for-tensorflow

Intel® Extension for TensorFlow*
Other
321 stars 40 forks source link

Could not load Intel Extension for Tensorflow* GPU backend, GPU will not be used. #73

Open ibrahimshahid1 opened 4 months ago

ibrahimshahid1 commented 4 months ago

2024-07-03 22:05:41.445430: I external/local_tsl/tsl/cuda/cudart_stub.cc:31] Could not find cuda drivers on your machine, GPU will not be used. 2024-07-03 22:05:41.446433: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations. To enable the following instructions: AVX2 AVX_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags. 2024-07-03 22:05:41.924553: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT 2024-07-03 22:05:42.266600: W itex/core/wrapper/itex_gpu_wrapper.cc:32] Could not load dynamic library: libze_loader.so.1: cannot open shared object file: No such file or directory running on xps 15 with intel arc a370m

yinghu5 commented 4 months ago

Hi [ibrahimshahid1] We happened to see a similar issue from Intel-extension for pyTorch :
https://github.com/intel/intel-extension-for-pytorch/issues/666

could you please check your OS version and other dependency as https://intel.github.io/intel-extension-for-tensorflow/v2.14.0.1/docs/install/install_for_xpu.html and check the Environment for XPU (tf)$ bash /path to site-packages/intel_extension_for_tensorflow/tools/env_check.sh

and let us know your output. thanks

ibrahimshahid1 commented 4 months ago

i mean im on windows 11

ibrahimshahid1 commented 4 months ago

im honestly kinda new to all of this so idk what ur really asking lol

yinghu5 commented 4 months ago

Hi Ibrahimshahid1,

thank you for letting us know. you are working on Window 11 + Arc 370m, and you hope to make the Intel extension for Tensorflow work on the Arc 370m, right?

The missing library is from intel level zero GPU runtime library , could you please check if you have the library in your WSL system, if there is, it is under /usr/lib/x86_64-linux-gnu (itex) yhu5@rajeshch-desk89:~$ find / -name libze_loader.so* /usr/lib/x86_64-linux-gnu/libze_loader.so.1.11.0 /usr/lib/x86_64-linux-gnu/libze_loader.so.1

and if it is not there, then you may need to install the related GPU driver runtime library :

Here are one install steps for your reference :

Hardware setup:

Host: Windows 11 better 16G or more GB RAM ddr4 your CPU: xxx Intel Arc A370m 4GB first install Arc driver : https://www.intel.com/content/www/us/en/download/785597/intel-arc-iris-xe-graphics-windows.html and make sure in the Windows performance monitor, you can see the GPU,

for example, ( my machine has one Xe GPU with 8GB) image

Then open one CMD prompt, install Ubuntu

wsl2: Ubuntu 22.04 on WSL2 ubuntu22.04 official distro (this runs on Microsoft special kernel

once you have WSL2 installed, open the Ubuntu command windows from the window start-up menu running uname -r 5.15.153.1-microsoft-standard-WSL2

from fresh installation: following steps here: https://github.com/intel/intel-extension-for-tensorflow/blob/main/docs/install/experimental/install_for_arc_gpu.md

wget -qO - https://repositories.intel.com/gpu/intel-graphics.key | \ sudo gpg --yes --dearmor --output /usr/share/keyrings/intel-graphics.gpg echo "deb [arch=amd64,i386 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/gpu/ubuntu jammy client" | \ sudo tee /etc/apt/sources.list.d/intel-gpu-jammy.list sudo apt update then

sudo apt-get install \ intel-igc-cm \ intel-level-zero-gpu \ intel-opencl-icd \ level-zero \ libigc1 \ libigdfcl1 \ libigdgmm12

To install the whole oneapi

wget https://registrationcenter-download.intel.com/akdlm/IRC_NAS/fdc7a2bc-b7a8-47eb-8876-de6201297144/l_BaseKit_p_2024.1.0.596.sh sudo sh ./l_BaseKit_p_2024.1.0.596.sh then

source /opt/intel/oneapi/setvars.sh

setting up my conda environment: https://intel.github.io/intel-extension-for-tensorflow/latest/docs/install/experimental/install_for_gpu_conda.html

curl https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -o Miniconda3-latest-Linux-x86_64.sh (or miniforge 's conda environment) bash Miniconda3-latest-Linux-x86_64.sh conda update conda conda create -n itex -c intel intelpython3_full python=3.9

I removed the version orig: conda create -n itex -c intel intelpython3_full==2023.2.0 python=3.9

activated my conda conda activate itex proceeded as documented

pip install --upgrade pip pip install tensorflow==2.15.0 pip install intel-extension-for-tensorflow[xpu] source /opt/intel/oneapi/setvars.sh sycl-ls

Please let me know if any steps you run into a problem

RafinRono commented 2 months ago

So, the extension is only available for Ubuntu and not Windows?

yinghu5 commented 2 months ago

Hi RafinRono,

Right, currently the extension is only support Linux or WSL, no native windows. Here is the system requirements: https://intel.github.io/intel-extension-for-tensorflow/latest/get_started.html#install