Migrating to SYCL
One-stop forum for getting assistance migrating your existing code to SYCL
39 Discussions

Non-uniform work-groups are not supported by the target device

Siddhanta_Shroff
5,124 Views

Hello,

I have been trying to convert a simple matrix multiplication code from CUDA to OneAPI using DPCT. I have converted it using the tool and made the changes to the converted code as per DPCT reference messages.

Upon execution, I get the following error which I couldn't find any documentation on:

"Non-uniform work-groups are not supported by the target device -54 (CL_INVALID_WORK_GROUP_SIZE)Exception caught at file:matrixmulcuda.dp.cpp, line:246"

I am attaching the CUDA code, the converted DPCPP code, and its compiled binary ".o" file.

Steps I followed to compile and run on the devcloud server:

dpcpp matrixmulcuda.dp.cpp -o matrixmulcudanew.o

./matrixmulcudanew.o

 

Best,

Siddhanta

0 Kudos
11 Replies
GouthamK_Intel
Moderator
5,107 Views

Hi Siddhanta,

>>>Non-uniform work-groups are not supported by the target device -54 (CL_INVALID_WORK_GROUP_SIZE)Exception

Work-Group size is specific to the device you can find the details of supported max work-group size and Preferred work group size multiples using clinfo command.

Please try running the code with supported work-group size and do let us know if your issue still persists.

Also, let us know the target device on which you are trying to run the migrated code and error logs along with the output of clinfo command.


Regards

Goutham


0 Kudos
GouthamK_Intel
Moderator
5,079 Views

Hi Siddhanta,

Could you please let us know whether your issue is resolved or not? If not please share the above requested details.


Regards

Goutham


0 Kudos
Siddhanta_Shroff
5,056 Views

Hi Goutham,

Thank you for your solution. I was able to resolve that issue. 

However, I am receiving a segmentation fault error now. At first, I was getting an error on compilation saying "double type is not supported on this platform" as seen in "screenshot 1". I am building this for Intel Graphics. So I converted all my double types to float.

Doing so I was able to build successfully, however, I am now getting a sigsegv error on execution(screenshot 2).  I tried using gdb-oneapi to debug. I introduced a breakpoint at line 1 and it gave me this error at that point itself.

I am attaching my code for your reference.

Steps to replicate the issue:

$ qsub -I -l nodes=1:gpu:ppn=2 -d .

$ dpcpp -g -O0 -fsycl-targets=spir64_gen-unknown-unknown-sycldevice -Xs "-device kbl -internal_options -cl-kernel-debug-enable -options -cl-opt-disable" code.dp.cpp -o code.o

$ ./code.o

0 Kudos
GouthamK_Intel
Moderator
5,050 Views

Hi,

We are working on your issue.

Meanwhile, Regarding, "I was getting an error on compilation saying "double type is not supported on this platform"", "So I converted all my double types to float."

Instead of changing all the doubles types to float, could you please try exporting the below two environment variables on DevCloud and then compile and execute the code?

Let us know the output after following the above suggestion. Please do share the error logs.

export OverrideDefaultFP64Settings=1 && export IGC_EnableDPEmulation=1


Regards

Goutham



0 Kudos
Siddhanta_Shroff
5,046 Views

Hi Goutham,

Thank you for your time. Exporting the env variables enabled me to use double in my code.

Also, I was now able to solve the segmentation fault error in the code by debugging it. There is, however, an error when the kernel is called. It throws the following error: "Native API failed. Native API returns: -42 (CL_INVALID_BINARY) -42 (CL_INVALID_BINARY)Exception caught at file:CMT-bone-pca.dp.cpp, line:647". Adding the logs and the source code for your reference.

Best,

Siddhanta

0 Kudos
GouthamK_Intel
Moderator
5,032 Views

Hi Siddhanta,

>>" I was now able to solve the segmentation fault error in the code by debugging it"

Could you please share the latest code and steps to reproduce the current error you are getting?

We have tried to reproduce the error using the code dpc_code.cpp shared by you in your last post, but we were still getting a "Segmentation fault". Kindly share the updated code so that we can investigate further.

GouthamK_Intel_0-1614157727884.png

 

Thanks & Regards

Goutham

 

0 Kudos
Siddhanta_Shroff
4,927 Views

Hi Goutham,

Unfortunately, it has been giving me segmentation fault error after the first time that I ran it which is very strange.

So currently I am also getting the same error as you have shown in your screenshot.

I can't seem to understand what is causing the issue since I am not getting any specific error even when using gdb-oneapi.

Siddhanta_Shroff_0-1614711861274.png

Best,

Siddhanta

0 Kudos
GouthamK_Intel
Moderator
4,862 Views

Hi Siddhanta,

We are working on your issue, we will get back to you soon.


Regards

Goutham


0 Kudos
cw_intel
Moderator
4,852 Views

I can reproduce this issue. I will figure it out.​


0 Kudos
Siddhanta_Shroff
4,843 Views

Hello and Chen,

Thank you for your continued support. I was able to find a resolution for the issue. The issue was that the memory was being freed inside the outer loop as opposed to outside it. I am attaching the working code for your reference.

Again, Thank you for your help!

Siddhanta_Shroff_0-1615576540721.png

 

Best,

Siddhanta

0 Kudos
cw_intel
Moderator
4,534 Views

Hi Siddhanta,


Thanks for your feedbacks. It's really helpful.


0 Kudos
Reply