cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

peastman
Journeyman III

Error using OpenCL 2.0

I have an OpenCL program that was written to work with OpenCL 1.2.  I'm now trying to add some OpenCL 2.0 features to it.  But if I add "-cl-std=CL2.0" to the compilation options, then the program fails with the following error:

Symbol not found: % LLVM ERROR: Caught exception from libHSAIL

I'm not yet actually using any OpenCL 2.0 features.  The only change I made was adding that one option to clBuildProgram.  Without that option it works correctly.  Any idea what's going on?  This is with APP SDK 3.0 and an R9 Fury on Ubuntu 12.04.

0 Likes
25 Replies
pinform
Staff
Staff

Re: Error using OpenCL 2.0

Hi Peter,

Welcome!

I have white-listed you, so you should be able to directly post in the relevant forum. As this post seems to be relevant to the OpenCL forum, I am moving it there -- the experts there should help.

--Prasad

0 Likes
dipak
Staff
Staff

Re: Error using OpenCL 2.0

Hi Peter,

If the build flag "-cl-std=CL2.0" is used, the program is built as OCL 2.0 whether any OpenCL 2.0 feature is used or not. In order to build the kernel as OpenCL 2.0, you need to have OpenCL 2.0 compatible driver. Did you install any such driver? If not, please download the latest driver from here Download Drivers and then try. If you still observe the error, please share the kernel code and your setup details.

Regards,

0 Likes
peastman
Journeyman III

Re: Error using OpenCL 2.0

Thanks!  My driver is pretty recent.  The installer is amd-driver-installer-15.20.1046-x86.x86_64.run, with modification date July 7.  Also, if I query CL_DEVICE_OPENCL_C_VERSION, it reports OpenCL 2.0.  But I'll try upgrading to the very most recent driver and see if that helps.

0 Likes
peastman
Journeyman III

Re: Error using OpenCL 2.0

After installing the latest driver (AMD-Catalyst-15.9-Linux-installer-15.201.1151-x86.x86_64.run), I still get the same error.

I also ran the full test suite for my application, and found I get a variety of different failures in different tests.  Some fail with this error.  Others appear to run, but then produce incorrect results.  If I remove the compiler option, all of them pass.

0 Likes
dipak
Staff
Staff

Re: Error using OpenCL 2.0

In that case, could you please provide the reproducible test-cases that generate the above errors?

Regards,

0 Likes
peastman
Journeyman III

Re: Error using OpenCL 2.0

The source code for the project (OpenMM) is at https://github.com/pandegroup/openmm​.  Instructions for compiling it are at http://docs.openmm.org/6.3.0/userguide/library.html#compiling-openmm-from-source-code.  But first you'll need to modify it to specify OpenCL 2.0.  You can do that by modifying this line to add " -cl-std=CL2.0" to defaultOptimizationOptions:

https://github.com/pandegroup/openmm/blob/master/platforms/opencl/src/OpenCLContext.cpp#L180

Once you compile it, you can run the individual test cases from the command line.  The following tests fail with the error mentioned above:

TestOpenCLAndersenThermostat

TestOpenCLCheckpoints

TestOpenCLCustomIntegrator

TestOpenCLEwald

In addition, the following tests fail due to calculations producing incorrect results:

TestOpenCLCustomNonbondedForce

TestOpenCLGBSAOBCForce

TestOpenCLNonbondedForce

0 Likes
peastman
Journeyman III

Re: Error using OpenCL 2.0

By the way, you can turn off a lot of CMake options when compiling it:

OPENMM_BUILD_AMOEBA_CUDA_LIB

OPENMM_BUILD_CPU_LIB

OPENMM_BUILD_CUDA_COMPILER_PLUGIN

OPENMM_BUILD_CUDA_LIB

OPENMM_BUILD_C_AND_FORTRAN_WRAPPERS

OPENMM_BUILD_DRUDE_CUDA_LIB

OPENMM_BUILD_EXAMPLES

OPENMM_BUILD_PME_PLUGIN

OPENMM_BUILD_PYTHON_WRAPPERS

OPENMM_BUILD_RPMD_CUDA_LIB

OPENMM_BUILD_STATIC_LIB

OPENMM_GENERATE_API_DOCS

That will both make it compile a lot faster, and also eliminate most of the dependencies (CUDA, Python, Doxygen, Fortran, SWIG, FFTW).

0 Likes
dipak
Staff
Staff

Re: Error using OpenCL 2.0

Thanks Peter. We'll check and get back to you.

0 Likes
dipak
Staff
Staff

Re: Error using OpenCL 2.0

My apologies for this delayed reply.

I'm able to reproduce the error. However, as the project is large one and I'm not familiar with it, I'm facing difficulty to find out the probable problematic area of the code that generating the error. For debugging purpose, a small test case would be appreciated. Could you please help me in this regard?

Regards,

0 Likes