oneDNN icon indicating copy to clipboard operation
oneDNN copied to clipboard

oneDNN - Build failure

Open pthorali opened this issue 1 year ago • 8 comments

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

pthorali avatar Aug 21 '24 23:08 pthorali

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

vpirogov avatar Aug 21 '24 23:08 vpirogov

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

vpirogov avatar Aug 21 '24 23:08 vpirogov

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.

  • Via OpenCL runtime, as @vpirogov already shared, it is DNNL_GPU_RUNTIME=OCL instead of DNNL_CPU_RUNTIME=OCL:

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

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

shu1chen avatar Aug 22 '24 06:08 shu1chen

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?

pthorali avatar Aug 26 '24 17:08 pthorali

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

yehudaorel avatar Aug 26 '24 18:08 yehudaorel

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

pthorali avatar Aug 26 '24 21:08 pthorali

@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?

yehudaorel avatar Aug 27 '24 00:08 yehudaorel

@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

shu1chen avatar Aug 27 '24 02:08 shu1chen

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

pthorali avatar Sep 04 '24 17:09 pthorali

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

  • One is the product version installed from Intel oneAPI website and has the driver names icx/icpx. For this product version, it is expected to run export CC=icx and export CC=icpx before running cmake.
  • The other is open-source version from the github repo intel/llvm and has the driver names clang/clang++. For this open-source version, it is expected to export CC=clang and export CC=clang++ before running cmake.
  • You can use either of them if you plan to compile oneDNN based on SYCL runtime. Since you have already installed the product version, please run export CC=icx and export CC=icpx.

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 ..

shu1chen avatar Sep 05 '24 02:09 shu1chen

  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?

pthorali avatar Sep 05 '24 16:09 pthorali

@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.

shu1chen avatar Sep 06 '24 00:09 shu1chen

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

pthorali avatar Sep 06 '24 18:09 pthorali