StreamHPC / gromacs

OpenCL porting of the GROMACS molecular simulation toolkit
http://www.gromacs.org
Other
25 stars 4 forks source link

Supposed OpenCL version? #35

Closed alexxy closed 9 years ago

alexxy commented 9 years ago

Hi all!

What target OpenCL version should be used? As I see in code its 1.2. I tryed to run it with opensource Mesa Clover stack on amd radeon gpu's (opencl v 1.1) and it cannot run because it doesnt allow static local storage

ancahamuraru commented 9 years ago

Hi Alexey,

The OpenCL version currently used is 1.1 The asc branch contains the latest changes, but is not yet tested.

Also, we are not aware of any static local storage for the OpenCL kernels.

Do you have more details about the error?

Thanks, Anca.

alexxy commented 9 years ago

Steps to reproduce

build llvm-3.5 and clang build mesa git master with opencl support

build gromacs with mesa's opencl library

Reading file speptide.md.tpr, VERSION 5.0-dev-20130306-fd51d5f (single precision) Note: file tpx version 92, software tpx version 100 Changing nstlist from 10 to 40, rlist from 1.2 to 1.287

Using 1 MPI thread Using 4 OpenMP threads

2 GPUs detected:

0: name: AMD TURKS, vendor: X.Org device version: OpenCL 1.1 MESA 10.4.0-devel, comp. units: 6, stat: compatible

1: name: AMD TURKS, vendor: X.Org device version: OpenCL 1.1 MESA 10.4.0-devel, comp. units: 6, stat: compatible

1 GPU auto-selected for this run. Mapping of GPU ID to the 1 PP rank in this node: AMD TURKS The OpenCL compilation log has been saved in "nbnxn_ocl_kernels.cl.FAILED" Compilation of source file failed! -- Used build options: -DWARP_SIZE_TEST=1 -cl-opt-disable -Iopencl -I../../src/gromacs/gmxlib/ocl_tools -I../../src/gromacs/mdlib/nbnxn_ocl -I../../src/gromacs/pbcutil -I../../src/gromacs/mdlib -I../../../gromacs/src/gromacs/gmxlib/ocl_tools -I../../../gromacs/src/gromacs/mdlib/nbnxn_ocl -I../../../gromacs/src/gromacs/pbcutil -I../../../gromacs/src/gromacs/mdlib --------------LOG START--------------- In file included from input.cl:50: In file included from opencl/nbnxn_ocl_kernels.clh:49: In file included from opencl/nbnxn_ocl_kernel_utils.clh:36: opencl/vectype_ops.clh:77:12: warning: implicit declaration of function 'distance' is invalid in C99 opencl/vectype_ops.clh:93:14: warning: implicit declaration of function 'atomic_cmpxchg' is invalid in C99 In file included from input.cl:50: In file included from opencl/nbnxn_ocl_kernels.clh:49: In file included from opencl/nbnxn_ocl_kernel_utils.clh:37: opencl/../nbnxn_consts.h:111:1: error: OpenCL does not support the 'static' storage class specifier opencl/../nbnxn_consts.h:113:1: error: OpenCL does not support the 'static' storage class specifier opencl/../nbnxn_consts.h:115:1: error: OpenCL does not support the 'static' storage class specifier opencl/../nbnxn_consts.h:116:1: error: OpenCL does not support the 'static' storage class specifier opencl/../nbnxn_consts.h:118:1: error: OpenCL does not support the 'static' storage class specifier opencl/../nbnxn_consts.h:119:1: error: OpenCL does not support the 'static' storage class specifier In file included from input.cl:50: In file included from opencl/nbnxn_ocl_kernels.clh:49: opencl/nbnxn_ocl_kernel_utils.clh:59:44: error: use of undeclared identifier 'CLK_NORMALIZED_COORDS_FALSE' opencl/nbnxn_ocl_kernel_utils.clh:60:47: error: use of undeclared identifier 'CLK_ADDRESS_NONE' opencl/nbnxn_ocl_kernel_utils.clh:61:47: error: use of undeclared identifier 'CLK_FILTER_NEAREST' opencl/nbnxn_ocl_kernel_utils.clh:211:1: error: OpenCL does not support the 'static' storage class specifier opencl/nbnxn_ocl_kernel_utils.clh:237:1: error: OpenCL does not support the 'static' storage class specifier opencl/nbnxn_ocl_kernel_utils.clh:275:1: error: OpenCL does not support the 'static' storage class specifier opencl/nbnxn_ocl_kernel_utils.clh:312:1: error: OpenCL does not support the 'static' storage class specifier opencl/nbnxn_ocl_kernel_utils.clh:349:1: error: OpenCL does not support the 'static' storage class specifier opencl/nbnxn_ocl_kernel_utils.clh:362:17: warning: implicit declaration of function 'read_imagef' is invalid in C99 opencl/nbnxn_ocl_kernel_utils.clh:362:83: error: member reference base type 'int' is not a structure or union opencl/nbnxn_ocl_kernel_utils.clh:363:85: error: member reference base type 'int' is not a structure or union opencl/nbnxn_ocl_kernel_utils.clh:378:1: error: OpenCL does not support the 'static' storage class specifier opencl/nbnxn_ocl_kernel_utils.clh:395:83: error: member reference base type 'int' is not a structure or union opencl/nbnxn_ocl_kernel_utils.clh:396:85: error: member reference base type 'int' is not a structure or union opencl/nbnxn_ocl_kernel_utils.clh:417:1: error: OpenCL does not support the 'static' storage class specifier opencl/nbnxn_ocl_kernel_utils.clh:437:84: error: member reference base type 'int' is not a structure or union opencl/nbnxn_ocl_kernel_utils.clh:438:85: error: member reference base type 'int' is not a structure or union opencl/nbnxn_ocl_kernel_utils.clh:439:86: error: member reference base type 'int' is not a structure or union opencl/nbnxn_ocl_kernel_utils.clh:440:87: error: member reference base type 'int' is not a structure or union opencl/nbnxn_ocl_kernel_utils.clh:467:1: error: OpenCL does not support the 'static' storage class specifier opencl/nbnxn_ocl_kernel_utils.clh:478:78: error: member reference base type 'int' is not a structure or union opencl/nbnxn_ocl_kernel_utils.clh:479:85: error: member reference base type 'int' is not a structure or union opencl/nbnxn_ocl_kernel_utils.clh:483:1: error: OpenCL does not support the 'static' storage class specifier opencl/nbnxn_ocl_kernel_utils.clh:575:1: error: OpenCL does not support the 'static' storage class specifier opencl/nbnxn_ocl_kernel_utils.clh:603:1: error: OpenCL does not support the 'static' storage class specifier opencl/nbnxn_ocl_kernel_utils.clh:649:1: error: OpenCL does not support the 'static' storage class specifier opencl/nbnxn_ocl_kernel_utils.clh:701:1: error: OpenCL does not support the 'static' storage class specifier In file included from input.cl:50: opencl/nbnxn_ocl_kernels.clh:56:32: error: variadic macros not supported in OpenCL In file included from input.cl:50: In file included from opencl/nbnxn_ocl_kernels.clh:57: opencl/nbnxn_ocl_kernel_nvidia.clh:42:10: fatal error: 'ishift.h' file not found ---------------LOG END----------------


Program mdrun, VERSION 5.1-dev-20141002-ac9ec7f-unknown Source code file: /home/alexxy/Src/gromacs-opencl/src/gromacs/mdlib/forcerec.c, line: 1839

Fatal error: On rank 0 failed to initialize GPU #-1:

sharpneli commented 9 years ago

You are correct. Static qualifier is not allowed in OpenCL 1.1. Thankfully it's only used in the C sense of limiting the function to the compilation unit, and in the constants header variable definitions it's also redundant.

I removed them as a test and it still works fine. So they are unnecessary remnants.

However even with this change you are not able to use it yet due to the variadic macroes. There is an issue open for that already.

alexxy commented 9 years ago

Ok, I'll try to run it with mesa's opencl to see if it can work.

sharpneli commented 9 years ago

It should compile the kernels cleanly now. No more static qualifiers nor variadic macroes. It works on Intel CPU platform which has those exact same limitations.

VincentSC commented 9 years ago

What is the status of this issue?

sharpneli commented 9 years ago

Fixed alongside the variadic macro issue. The kernel now should be standards compliant.