Closed pthorali closed 6 days ago
Please refer to Build from Source section of the Developer Guide.
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
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.
DNNL_GPU_RUNTIME=OCL
instead of DNNL_CPU_RUNTIME=OCL
:CC=gcc CXX=g++ cmake -DDNNL_GPU_RUNTIME=OCL -DOPENCLROOT=/path/to/opencl/sdk ..
icx
and icpx
rather than gcc
/g++
:CC=icx CXX=icpx cmake -DDNNL_GPU_RUNTIME=SYCL ..
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.
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, can you run sycl-ls
and verify the gpu device is visible
Yes, sycl-ls identifies the device. I have attached the screenshot below
@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?
@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
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.
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?
Hello @pthorali, there are two versions of oneAPI DPC++ Compiler:
export CC=icx
and export CC=icpx
before running cmake.export CC=clang
and export CC=clang++
before running cmake.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 ..
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.
I tried running a simple c++ code with icpx complier and it works as expected.
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
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 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.
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
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?
Thank you, Preethi Raksha