oneapi-src / oneDNN

oneAPI Deep Neural Network Library (oneDNN)
https://uxlfoundation.org
Apache License 2.0
3.58k stars 985 forks source link

oneDNN - Build failure #2050

Closed pthorali closed 6 days ago

pthorali commented 3 weeks ago

Hi Team,

We are trying to build https://github.com/oneapi-src/oneDNN into Intel Graphics ( Meteor Lake ). We are unable to build it successfully for any combinations of cmake. Attached screenshot with the errors. Are we missing something, could you please guide us on what we should do?

image

Thank you, Preethi Raksha

vpirogov commented 3 weeks ago

Please refer to Build from Source section of the Developer Guide.

vpirogov commented 3 weeks ago

The following command line will build oneDNN with Intel GPU support (via OpenCL runtime) for Linux:

CC=gcc CXX=g++ cmake -DDNNL_GPU_RUNTIME=OCL ..
make -j
shu1chen commented 3 weeks ago

Hi @pthorali, there are 2 options to build oneDNN with Intel GPU support, one via OpenCL runtime and the other via SYCL runtime. Please ensure that the software requirements for GPU engine are in place before building from source.

CC=gcc CXX=g++ cmake -DDNNL_GPU_RUNTIME=OCL -DOPENCLROOT=/path/to/opencl/sdk ..

CC=icx CXX=icpx cmake -DDNNL_GPU_RUNTIME=SYCL ..

pthorali commented 2 weeks ago

Thank you for the quick solution, I tried all the suggested methods I was able to install it, but it is not working for gpu. image

We are using Meteor lake GPU, which is not a data center GPU, and the code is not identifying the GPU. Could you please let us know how to fix it?

yehudaorel commented 2 weeks ago

@pthorali, can you run sycl-ls and verify the gpu device is visible

pthorali commented 2 weeks ago

Yes, sycl-ls identifies the device. I have attached the screenshot below image

yehudaorel commented 2 weeks ago

@pthorali, I do not see the GPU device [nor level zero] from your screenshot you shared, which explains why oneDNN couldn't utilize the igpu. Somewhere in your systems GPU stack has an issue or is missing, have you setup gpu drivers properly?

shu1chen commented 2 weeks ago

@pthorali From the command lines, it seems that you are running the workload on Linux platform. Please refer to the webpage https://dgpu-docs.intel.com/driver/client/overview.html to setup client GPU drivers properly. You'll see devices starting with [opencl:gpu] or with [level_zero:gpu] using sycl-ls

pthorali commented 1 week ago

Thank you for the instruction, we cloned a new drive and set up the drivers again. Now sycl-ls seems to identify the GPU. [opencl:gpu] or with [level_zero:gpu]

But when we build the oneDNN now, it fails with this error. It is not identifying the icpx. image

In the one DNN source document there is a note to use clang/clang++, what is the syntax to use it or is there any other necessity we are missing? image

shu1chen commented 1 week ago

Hello @pthorali, there are two versions of oneAPI DPC++ Compiler:

For the error in icpx, the error message in the screenshot is incomplete. Did you build a simple program and verify the compiler by referring to the Intel® oneAPI DPC++/C++ Compiler getting-started guide? If the product version of compiler is not working well, please post a question and attach the full error log in the Intel compiler community to get the support.

By the way, does OpenCL runtime work for you? OneDNN with Intel GPU support via OpenCL runtime doesn't rely on the oneAPI DPC++ Compiler and gcc/g++ also works: CC=gcc CXX=g++ cmake -DDNNL_GPU_RUNTIME=OCL -DOPENCLROOT=/path/to/opencl/sdk ..

pthorali commented 1 week ago
  1. For the export cc=icx and export cc=icpx. The OneDnn compilation fails with the below error screenshot after 54% is completed. The same error keeps repeating, I had to kill execution. image

  2. I tried running a simple c++ code with icpx complier and it works as expected. image

The files I source and the script I execute are given below source /opt/intel/oneapi/compiler/latest/env/vars.sh source /opt/intel/oneapi/mkl/latest/env/vars.sh source /opt/intel/oneapi/setvars.sh image

Could you please point out the mistake I am doing? Am I missing somethin that the icpx drivers does not work for the benchDnn code?

shu1chen commented 1 week ago

@pthorali A possible reason is that you have another version of oneDNN library linked in the environment (Possibly installed in /opt/intel/oneapi/dnnl/) and the compiler was trying to link that libdnnl.so to benchdnn instead of the newly built one. Please don't run source /opt/intel/oneapi/setvars.sh, which will add every component installed in /opt/intel/oneapi/ into the linking environment. Like source /opt/intel/oneapi/compiler/latest/env/vars.sh, you can activate the necessary components by running separate vars.sh scripts.

pthorali commented 6 days ago

Hi Team,

Thanks a lot for the help! The above issue is caused due to make -j when we tried make -j8 it worked. I am able to run the benchDnn for both GPU and CPU.

Thanks, Preethi Raksha