intel / intel-extension-for-tensorflow

Intel® Extension for TensorFlow*
Other
315 stars 39 forks source link

I can't Install Intel® Extension for TensorFlow[gpu] in Devcloud #50

Closed yarragotiravitheja closed 7 months ago

yarragotiravitheja commented 11 months ago

When I try to install a GPU-only version in a virtual environment, which depends on Intel GPU drivers and oneAPI BaseKit, when I run

(tf)$ pip install --upgrade intel-extension-for-tensorflow[GPU]

The error shows :

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
mkl-fft 1.3.6 requires mkl, which is not installed.
Successfully installed MarkupSafe-2.1.3 absl-py-2.0.0 astunparse-1.6.3 cachetools-5.3.1 flatbuffers-23.5.26 gast-0.4.0 google-auth-2.23.3 google-auth-oauthlib-1.0.0 google-pasta-0.2.0 grpcio-1.59.0 h5py-3.10.0 intel-extension-for-tensorflow-2.13.0.1 intel-extension-for-tensorflow-lib-2.13.0.1.1 keras-2.13.1 libclang-16.0.6 markdown-3.5 numpy-1.23.5 oauthlib-3.2.2 opt-einsum-3.3.0 protobuf-4.24.4 pyasn1-0.5.0 pyasn1-modules-0.3.0 requests-oauthlib-1.3.1 rsa-4.9 tensorboard-2.13.0 tensorboard-data-server-0.7.2 tensorflow-2.13.0 tensorflow-estimator-2.13.0 tensorflow-io-gcs-filesystem-0.34.0 termcolor-2.3.0 typing-extensions-4.5.0 werkzeug-3.0.0 wrapt-1.15.0
u205989@s001-n013:~$ python -c "import intel_extension_for_tensorflow as itex; print(itex.__version__)"
2023-10-23 21:18:50.971949: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used.
2023-10-23 21:18:51.822834: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used.
2023-10-23 21:18:51.825974: 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 AVX512F FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-10-23 21:18:54.489891: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
2023-10-23 21:19:09.784680: I itex/core/wrapper/itex_gpu_wrapper.cc:35] Intel Extension for Tensorflow* GPU backend is loaded.
2023-10-23 21:19:09.911551: W itex/core/ops/op_init.cc:58] Op: _QuantizedMaxPool3D is already registered in Tensorflow
2023-10-23 21:19:09.927190: E itex/core/devices/gpu/itex_gpu_runtime.cc:173] Can not found any devices. To check runtime environment on your host, please run itex/tools/env_check.sh.
If you need help, create an issue at https://github.com/intel/intel-extension-for-tensorflow/issues
2.13.0.1

When I try to install it says all requirements already satisfied , but when I try check the Environment for GPU[¶(https://intel.github.io/intel-extension-for-tensorflow/latest/docs/install/install_for_gpu.html#check-the-environment-for-gpu)

(tf)$ bash /path to site-packages/intel_extension_for_tensorflow/tools/env_check.sh It say's bash: /path: No such file or directory
And when I try to verify the Installation

python -c "import intel_extension_for_tensorflow as itex; print(itex.__version__)"

I'm getting error like :

2023-10-23 21:54:52.591318: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used.
2023-10-23 21:54:52.628535: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used.
2023-10-23 21:54:52.629025: 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 AVX512F FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.

2023-10-23 21:54:56.798253: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
2023-10-23 21:55:01.522121: I itex/core/wrapper/itex_gpu_wrapper.cc:35] Intel Extension for Tensorflow* GPU backend is loaded.
2023-10-23 21:55:01.580982: W itex/core/ops/op_init.cc:58] Op: _QuantizedMaxPool3D is already registered in Tensorflow
2023-10-23 21:55:01.594774: E itex/core/devices/gpu/itex_gpu_runtime.cc:173] Can not found any devices. To check runtime environment on your host, please run itex/tools/env_check.sh.
nazneenn commented 11 months ago

Here the error log here means CUDA drivers are not found, does not mean Intel GPU. The GPU backend of ITEX has been imported successfully. The "2.13.0.1" in the last line is the right output for ITEX version.

for env_check.sh, you could run python -m site or python -c 'import site; print(site.getsitepackages())' to list out the path to site-packages directory and then try the below command,

bash /path to site-packages/intel_extension_for_tensorflow/tools/env_check.sh

yarragotiravitheja commented 11 months ago

image I tried the commands u said but it still says bash: /path: No such file or directory, By the way I am using free trail version of the Devcloud (https://jupyter.oneapi.devcloud.intel.com)

nazneenn commented 11 months ago

Replace "path to site-packages" with the output obtained from the following command python -c 'import site; print(site.getsitepackages())'

In this case, bash /glob/development-tools/versions/oneapi/2023.2.0.1/oneapi/intelpython/latest/lib/python3.9/site-packages/intel_extension_for_tensorflow/tools/env_check.sh

yarragotiravitheja commented 11 months ago

Hi, can u tell how can i use the gpu for my TensorFlow in my Jupyter notebook in Jupyter Lab environment on Intel DevCloud for oneAPI, please.

nazneenn commented 11 months ago

Hi, Please review this introductory sample for getting started with ITEX, https://github.com/oneapi-src/oneAPI-samples/tree/master/AI-and-Analytics/Getting-Started-Samples/Intel_Extension_For_TensorFlow_GettingStarted