Intel® DevCloud
Help for those needing help starting or connecting to the Intel® DevCloud
1054 Discussions

cl::sycl::compile_program_error

Viet-Duc
Novice
591 Views

 

Dear Support Team,

I am having a runtime error when running a SYCL code on GPUs queue.

The code is attached below. It compiled and run correctly on login node. 

I was able to run the code without issues last week.

Steps to reproduce the problem (s012-n0001)

 

qsub -I -l nodes=iris_xe_max:quad_gpu:ppn=2
dpcpp -O2 matmul.cpp -o matmul.x

 

 

The error message is for level-zero backend is:

 

 SYCL_PI_TRACE=1  ./matmul.x
SYCL_PI_TRACE[basic]: Plugin found and successfully loaded: libpi_opencl.so
SYCL_PI_TRACE[basic]: Plugin found and successfully loaded: libpi_level_zero.so
SYCL_PI_TRACE[all]: Selected device ->
SYCL_PI_TRACE[all]:   platform: Intel(R) Level-Zero
SYCL_PI_TRACE[all]:   device: Intel(R) Iris(R) Xe MAX Graphics [0x4905]
terminate called after throwing an instance of 'cl::sycl::compile_program_error'
  what():  The program was built for 1 devices
Build program log for 'Intel(R) Iris(R) Xe MAX Graphics [0x4905]':
Internal linker error -11 (CL_BUILD_PROGRAM_FAILURE)
Aborted

 

 

The error message is for opencl backend is:

 

SYCL_PI_TRACE=1 SYCL_DEVICE_FILTER=opencl:gpu ./matmul.x
SYCL_PI_TRACE[basic]: Plugin found and successfully loaded: libpi_opencl.so
SYCL_PI_TRACE[all]: Selected device ->
SYCL_PI_TRACE[all]:   platform: Intel(R) OpenCL HD Graphics
SYCL_PI_TRACE[all]:   device: Intel(R) Iris(R) Xe MAX Graphics [0x4905]
terminate called after throwing an instance of 'cl::sycl::compile_program_error'
  what():  The program was built for 1 devices
Build program log for 'Intel(R) Iris(R) Xe MAX Graphics [0x4905]':
Internal linker error -42 (CL_INVALID_BINARY)
Aborted

 

 

Perhaps there is some recent changes that I am not aware of.

You advices are much appreciated.

Regards.

 

 

0 Kudos
1 Solution
JananiC_Intel
Moderator
506 Views

Hi,


Glad to know that your issue is resolved. Thanks for sharing the solution with us. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.


Regards,

Janani Chandran


View solution in original post

3 Replies
JananiC_Intel
Moderator
555 Views

Hi,


Thanks for posting in Intel forums.


We are looking into this. We will get back to you soon.


Regards,

Janani Chandran


Viet-Duc
Novice
526 Views

Dear Janani, 

 

Thanks for looking into the problem.

 

I would like to give some updates on the problem.

I think the error is probable associated with calling std::rand() on the GPU, as showing in the code snippet below:

SYCL_EXTERNAL int rand(); 
...
queue.submit([&](auto &handle) { 
        handle.parallel_for(range(m, p), [=](auto index) { 
            int i = index[0]; 
            int j = index[1]; 

            A_USM[i*p+j] = (float)rand()/(float)RAND_MAX; 
        }); 
    }); 
    queue.wait();

(Per SYCL standard, I had to declare rand() with SYCL_EXTERNAL attribute)

 

The problem is solved by initialization all the matrix on the host.

 random_matrix<float>(A_USM, m, p);

 

If you have other comments, please let me know. Otherwise, I think the issue could be closed.

Once again, thanks for your time.

 

Regards.

JananiC_Intel
Moderator
507 Views

Hi,


Glad to know that your issue is resolved. Thanks for sharing the solution with us. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.


Regards,

Janani Chandran


Reply