Opened 8 years ago

Closed 3 years ago

#1446 closed task (worksforme)

add --with-opencl support to ./configure

Reported by: hamish Owned by: grass-dev@…
Priority: major Milestone: 7.0.5
Component: Compiling Version: svn-trunk
Keywords: OpenCL, configure, smp, gpu, r.sun Cc: sprice
CPU: All Platform: All

Description

This is akin to task #657 (add --with-openmp support to ./configure), which I still am very keen to see happen as we already have OpenMP-aware code in trunk. See that report for a basic summary & philosophy of approach.

For now the OepnCL support would mainly be used for Seth's 2010 GSoC project to make r.sun use OpenCL, making it some hundreds of times faster, which we'd like to merge into trunk in the near future.

note that even if you don't have a fancy GPU the OpenCL spec allows you to run the code on a multi-core CPU instead, so it's still nice. (maybe even both multi-core CPU and GPU ??)

any help with the autoconf magic would be greatly appreciated.

thanks, Hamish

Change History (9)

comment:1 Changed 6 years ago by hamish

I've got these headers in the /opt/AMDAPP/include/CL directory; which should we search for as part of the ./configure --with-opencl check?

cl.h
cl.hpp
cl_ext.h
cl_gl.h
cl_gl_ext.h
cl_platform.h
opencl.h

my i7 3770 intel driver is not a Xeon, so no OpenCL support for linux yet, and my nvidia system + proprietary driver supplies:

/usr/lib/libOpenCL.so
/usr/include/nvidia-current/CL/cl.h
/usr/include/nvidia-current/CL/cl_platform.h
/usr/include/nvidia-current/CL/cl_gl.h

from the nvidia-current-dev package.

so the 3 header files from the nvidia package seem to be the common ones to check for. maybe cl.h is enough to look for?

Hamish

comment:2 Changed 6 years ago by hamish

Hi,

before touching configure.in, I notice there are a number of recent edits to configure which were done out of sync with configure.in. As soon as I run autoconf2.13 they'll be lost. :-(

https://trac.osgeo.org/grass/log/grass/trunk/configure https://trac.osgeo.org/grass/log/grass/trunk/configure.in

?, Hamish

comment:3 in reply to:  2 ; Changed 6 years ago by neteler

Replying to hamish:

before touching configure.in, I notice there are a number of recent edits to configure which were done out of sync with configure.in. As soon as I run autoconf2.13 they'll be lost. :-(

Concretely: r55521, r55487, r55487 (FreeBSD, netbsd, Solaris, AIX support), they need to be implemented in configure.in. From that configure has to be generated with autoconf-2.13.

comment:4 Changed 6 years ago by hamish

r55413 too, "Remove unused variables"

(but maybe the mods to aclocal.m4 and Platform.make.in get included so no change in configure.in needed for that one?)

thanks, Hamish

comment:5 in reply to:  3 ; Changed 6 years ago by mmetz

Replying to neteler:

Replying to hamish:

before touching configure.in, I notice there are a number of recent edits to configure which were done out of sync with configure.in. As soon as I run autoconf2.13 they'll be lost. :-(

Concretely: r55521, r55487, r55487 (FreeBSD, netbsd, Solaris, AIX support), they need to be implemented in configure.in.

These were implemented in aclocal.m4.

From that configure has to be generated with autoconf-2.13.

Configure was generated with autoconf-2.13 after changing aclocal.m4. Are you sure that configure.in needs to be touched for support of different platforms?

Markus M

comment:6 in reply to:  5 Changed 6 years ago by hamish

Cc: sprice added

Replying to mmetz:

Are you sure that configure.in needs to be touched for support of different platforms?

nope!

In that case, proceeding...

Hamish

comment:7 Changed 6 years ago by hamish

OpenCL infrastructure support added to configure[.in], include/Make/Platform.make, and raster/r.sun/Makefile,main.c in r55949,50.

It could do with a little more work,

  • my libOpenCL.so is in /opt and listed in 'ldconfig -p', but autoconf's gcc conftest doesn't find -lOpenCL. Symlinking into /usr/local/lib works, but why is that needed?
  • OCLLIBPATH is not being set from --with-opencl-libs= (see trac #1943)
  • to use LOC_CHECK_FUNC(,LOC_CHECK_LIBS()) or just LOC_CHECK_LIBS()?
  • remove unused variables from r.sun's Makefile

have fun, Hamish

comment:8 Changed 3 years ago by martinl

Milestone: 7.0.07.0.5

comment:9 Changed 3 years ago by martinl

Resolution: worksforme
Status: newclosed

No activity last 3 years. There is already --with-opencl. Feel free to reopen if needed.

Note: See TracTickets for help on using tickets.