GPU Compute Software
Ask questions about Intel® Graphics Compute software technologies, such as OpenCL* GPU driver and oneAPI Level Zero
140 Discussions

Intel GPU: OpenMP Hangs on Target Directive

lamb
Beginner
2,007 Views

I'm having trouble running OpenMP on my Intel GPU. My OpenMP application seems to hang as soon as it encounters an OpenMP directive with the "target" clause. 

OS: x86_64 GNU/Linux
CPU: Intel(R) Xeon(R) CPU
Accelerator: Intel Iris Xe MAX
Toolkit: Intel(R) oneAPI DPC++ Compiler 2021.1 (2020.10.0.1113)

As an example, the following, sourced from Intel design examples:

Compilation Tested: icpx -fiopenmp -fopenmp-targets=spir64 -D__STRICT_ANSI__ -g matrix_mul_omp.cpp -o matrix_mul_omp

#pragma omp target teams distribute parallel for map(to : a, b) \
map(tofrom : c) thread_limit(128)
{
  for (i = 0; i < M; i++) {
    for (k = 0; k < N; k++) {
      // Each element of the product is just the sum 1+2+...+n
      for (j = 0; j < P; j++) {
        c[i][j] += a[i][k] * b[k][j];
      }
    }
  }
}

This example hangs, even with very small input sizes. I've tried other applications/examples and gotten the same results (hangs on first "target" directive). However, when testing using the default configuration on the Intel DevCloud, they execute successfully.

Any ideas? Let me know if I can add any more information.

Thanks

0 Kudos
1 Solution
PrasanthD_intel
Moderator
1,963 Views

Hi Jacob,


This was a known issue and has been included in the release notes (Intel® oneAPI Toolkits DPC++/C++ Compiler Release Notes).

The OpenMP offload hangs for Level0 backend.

Intel has released a patch for this as 2021.1.2 if you want to continue with Level0 please install the latest patch and follow the steps mentioned in the release notes.

Else if you can use the OpenCL backend and continue using your current version.

The default backend is Level0 and you can change using this environment variable export LIBOMPTARGET_PLUGIN=OPENCL.


Let us know if you face any issues.


Regards

Prasanth


View solution in original post

2 Replies
PrasanthD_intel
Moderator
1,964 Views

Hi Jacob,


This was a known issue and has been included in the release notes (Intel® oneAPI Toolkits DPC++/C++ Compiler Release Notes).

The OpenMP offload hangs for Level0 backend.

Intel has released a patch for this as 2021.1.2 if you want to continue with Level0 please install the latest patch and follow the steps mentioned in the release notes.

Else if you can use the OpenCL backend and continue using your current version.

The default backend is Level0 and you can change using this environment variable export LIBOMPTARGET_PLUGIN=OPENCL.


Let us know if you face any issues.


Regards

Prasanth


PrasanthD_intel
Moderator
1,949 Views

Hi Jacob,


Thanks for the confirmation.

As your issue has been resolved, we are closing this thread. If you require additional assistance from Intel, please start a new thread. Any further interaction in this thread will be considered community only


Regards

Prasanth


0 Kudos
Reply