OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU.
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.
1721 Discussions

Opencl Intercept layer not working (segmentation fault)

Dutta__Sankha
Beginner
1,116 Views

Hello

I have build and installed opencl intercept layer in my linux platform with kernel version 4.13.0. However, I couldn’t get the intercept layer to work. I would mention the steps I have taken to make it work in detail hoping to get it work. I am trying to get some metrics out of my opencl application. First, I downloaded whole opencl intercept repo in a folder and followed the cmake instructions as provided in the release mode and I have enabled other flags like bled other flags like ENABLE_CLIPROFENABLE_CLIPROF, ENABLE_MDAPI, ENABLE_CLILOADER followed by make and make install.

The opencl library created successfully inside the folder where I downloaded the repo. After that I am trying to use it for a particular application rather than doing a global install. So I believed I set the environment properly.

Specifically, the environment setting steps are as follows:

export LD_LIBRARY_PATH=/home/user/Desktop/OpenclIntercept/:$LD_LIBRARY_PATH

export CLI_DLLName=/opt/intel/opencl/SDK/lib64/libOpenCL.so

 

Setting other environment variables like:

export CLI_CallLogging=1 CLI_DumpProgramSource=1 CLI_DevicePerfCounterCustom=ComputeBasic CLI_DevicePerfCounterTiming=1

After setting all this when I am trying to execute both the cliloader and cliprof on my application I am getting segmentation fault.

CliLoader details:

sudo ./cliloader --debug --call-logging --dump-source /path/to/application/Application_itself

Output:

[cliloader debug] full path to executable is: /home/User/Desktop/opencl-intercept-layer/cliloader/cliloader

[cliloader debug] pProcessName is non-NULL: /cliloader

[cliloader debug] process directory is /home/User/Desktop/opencl-intercept-layer/cliloader

[cliloader debug] New LD_PRELOAD is /home/User/Desktop/opencl-intercept-layer/cliloader/../libOpenCL.so

[cliloader debug] New LD_LIBRARY_PATH is /home/User/Desktop/opencl-intercept-layer/cliloader/..

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

CLIntercept (64-bit) is loading...

CLintercept file location: /home/User/Desktop/opencl-intercept-layer/cliloader/../libOpenCL.so

CLIntercept URL: https://github.com/intel/opencl-intercept-layer

CLIntercept git description: v2.2.1-111-g331ce28

CLIntercept git refspec: refs/heads/master

CLInterecpt git hash: 331ce28ff998ea83620317aa1dfc64b0c06f6587

CLIntercept optional features:

   cliloader(supported)

   cliprof(supported)

   kernel overrides(NOT supported)

   ITT tracing(NOT supported)

   MDAPI(supported)

CLIntercept environment variable prefix: CLI_

CLIntercept config file: clintercept.conf

Trying to load dispatch from: ./real_libOpenCL.so

Couldn't load library from: ./real_libOpenCL.so

Trying to load dispatch from: /usr/lib/x86_64-linux-gnu/libOpenCL.so

Couldn't get exported function pointer to: clSetProgramReleaseCallback

Couldn't get exported function pointer to: clSetProgramSpecializationConstant

... success!

CallLogging is set to a non-default value!

ReportToStderr is set to a non-default value!

DumpProgramSource is set to a non-default value!

Timer Started!

... loading complete.

>>>> clGetPlatformIDs

<<<< clGetPlatformIDs -> CL_SUCCESS

Number of Platforms: 2

>>>> clGetPlatformIDs

<<<< clGetPlatformIDs -> CL_SUCCESS

>>>> clGetDeviceIDs: platform = [ Intel(R) OpenCL HD Graphics ], device_type = CL_DEVICE_TYPE_GPU (4)

<<<< clGetDeviceIDs -> CL_SUCCESS

>>>> clGetDeviceIDs: platform = [ Intel(R) OpenCL HD Graphics ], device_type = CL_DEVICE_TYPE_GPU (4)

<<<< clGetDeviceIDs -> CL_SUCCESS

>>>> clCreateContext: properties = [ NULL ], num_devices = 1, devices = [ Intel(R) Gen9 HD Graphics NEO (CL_DEVICE_TYPE_GPU) ]

<<<< clCreateContext: returned 0x1c7ee50 -> CL_SUCCESS

Context created successfully

Segmentation fault (core dumped)

 

CliProf details:

 

 sudo ./cliprof --debug --verbose /path/to/application/Application_itself

 

Output:

[cliprof debug] full path to executable is: /home/user/Desktop/opencl-intercept-layer/cliprof/cliprof

[cliprof debug] pProcessName is non-NULL: /cliprof

[cliprof debug] process directory is /home/user/Desktop/opencl-intercept-layer/cliprof

[cliprof debug] New LD_PRELOAD is /home/user/Desktop/opencl-intercept-layer/cliprof/../libOpenCL.so

[cliprof debug] New LD_LIBRARY_PATH is /home/user/Desktop/opencl-intercept-layer/cliprof/..

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

CLIntercept (64-bit) is loading...

CLintercept file location: /home/user/Desktop/opencl-intercept-layer/cliprof/../libOpenCL.so

CLIntercept URL: https://github.com/intel/opencl-intercept-layer

CLIntercept git description: v2.2.1-111-g331ce28

CLIntercept git refspec: refs/heads/master

CLInterecpt git hash: 331ce28ff998ea83620317aa1dfc64b0c06f6587

CLIntercept optional features:

   cliloader(supported)

   cliprof(supported)

   kernel overrides(NOT supported)

   ITT tracing(NOT supported)

   MDAPI(supported)

CLIntercept environment variable prefix: CLI_

CLIntercept config file: clintercept.conf

Trying to load dispatch from: ./real_libOpenCL.so

Couldn't load library from: ./real_libOpenCL.so

Trying to load dispatch from: /usr/lib/x86_64-linux-gnu/libOpenCL.so

Couldn't get exported function pointer to: clSetProgramReleaseCallback

Couldn't get exported function pointer to: clSetProgramSpecializationConstant

... success!

ReportToStderr is set to a non-default value!

DevicePerformanceTiming is set to a non-default value!

Timer Started!

... loading complete.

Number of Platforms: 2

Context created successfully

Segmentation fault (core dumped)

Also when I am trying to launch the application after setting up environment variables I am getting a segmentation fault. I don’t know if the directory CLIntercept_Dump would be created automatically, I created it manually and I didn’t see any dump inside it even after enabling logging and dump. So I am not sure how to make this thing work and what I should do. I have one more question as to how can I use the control apis as mentioned in here .

I would really appreciate if someone could help me out with the errors.

Thank you.

0 Kudos
1 Reply
Ben_A_Intel
Employee
1,116 Views

Hi Sankha,

Let's continue discussion on the github issue:

https://github.com/intel/opencl-intercept-layer/issues/70

Thanks!

0 Kudos
Reply