PDA

View Full Version : GPGPU on Qt?



Caius Aérobus
19th April 2012, 18:04
I did not find any example in which frame buffer objects are used for GPGPU.
I would need to be able to use float frame buffer objects but it seems that only RGBA format is supported.
I would also need to be able to initialize the FBO with some floating point array but the only examples given just draw into the FBO.
It is possible to get back the FBO content by toImage() or toTexture() but one more time it is not floats.
Any pointer?

wysota
19th April 2012, 21:12
Use OpenCL, possibly with QtOpenCL module.

sajis997
20th April 2012, 05:50
Hi i tried as follows:



sajjad@sajjad-G74Sx:~/Downloads/opencl$ ./configure -I/usr/local/cuda/include/CL -L/usr/lib/ -lOpenCL

This is the QtOpenCL configuration utility.

Qt version ............. 4.7.4
qmake .................. /usr/bin/qmake
OpenCL 1.0 ............. no
OpenCL 1.1 ............. no
OpenCL/OpenGL interop .. no
Extra QMAKE_CXXFLAGS ...
Extra INCLUDEPATH ...... /usr/local/cuda/include/CL
Extra LIBS ............. -L/usr/lib/ -lOpenCL

Could not detect an OpenCL implementation ... aborting
Use the -verbose option for more information





The driver is opencl enabled , i have tested and run the opencl sample applications. But the qt does not find it.


Any tips to make it work ?



Regards
Sajjad

ChrisW67
20th April 2012, 06:48
At a guess the extra include path should be "/usr/local/cuda/include" and, given that location, I would expect that the libraries are in "/usr/local/cuda/lib" not "/usr/lib". However, only you know where you have installed OpenCL.

Caius Aérobus
22nd April 2012, 11:25
Use OpenCL, possibly with QtOpenCL module.

Ok but I don't have QtOpenCL installed on my Mac OS Qt 4.7 installation.
I have been looking on your ste but did not find anything about QtOpenCL.
How to install?

wysota
23rd April 2012, 11:02
http://doc.qt.nokia.com/opencl-snapshot/

Caius Aérobus
23rd April 2012, 17:54
Thx; Actually I found it by myself finally before you answered but anyway.
My problem now is the same as was mentionned before in this thread:


pc2:qt-labs-opencl $ sudo ./configure

This is the QtOpenCL configuration utility.

Qt version ............. 4.7.0
qmake .................. /usr/bin/qmake
OpenCL 1.0 ............. no
OpenCL 1.1 ............. no
OpenCL/OpenGL interop .. no
Extra QMAKE_CXXFLAGS ...
Extra INCLUDEPATH ......
Extra LIBS ............. -framework OpenCL

Could not detect an OpenCL implementation ... aborting
Use the -verbose option for more information

I do have an OpenCL native implementation on my Mac OsX 10.6.8:


pc2:qt-labs-opencl $ ll /System/Library/Frameworks|grep Open
drwxr-xr-x 7 root wheel 238 20 déc 2010 OpenAL.framework
drwxr-xr-x 9 root wheel 306 20 déc 2010 OpenCL.framework
drwxr-xr-x 8 root wheel 272 20 déc 2010 OpenDirectory.framework
drwxr-xr-x 8 root wheel 272 20 déc 2010 OpenGL.framework

I guess this is a default path for searching frameworks and there is no way in the configure tool help to specify a new framework location.
Any help?

Ok I have solved the problem: a test in the configure file simply does not work on Mac OsX.
Just comment the test from line 491 and everything goes fine:


#if [ "x$CFG_OPENCL" != "xyes" ] ; then
# echo "Could not detect an OpenCL implementation ... aborting"
# if [ "x$OPT_VERBOSE" = "xno" ] ; then
# echo "Use the -verbose option for more information"
# fi
# exit 1
#fi

Caius Aérobus
23rd April 2012, 21:39
New problem: I tried to compile the blur example but got the following link error:


Undefined symbols:
"_clRetainProgram", referenced from:
QCLProgram::operator=(QCLProgram const&)in blurwidget.o
"_clReleaseProgram", referenced from:
QCLProgram::~QCLProgram()in blurwidget.o
QCLProgram::operator=(QCLProgram const&)in blurwidget.o
"_clReleaseEvent", referenced from:
QCLEvent::~QCLEvent()in blurwidget.o
"_clSetKernelArg", referenced from:
QCLKernel::setArg(int, QCLMemoryObject const&)in blurwidget.o
QCLKernel::setArg(int, int)in blurwidget.o
QCLKernel::setArg(int, QCLVectorBase const&)in blurwidget.o
ld: symbol(s) not found

Is this example in line with the last QtOpenCL lib?

Added after 1 6 minutes:


New problem: I tried to compile the blur example but got the following link error:



Is this example in line with the last QtOpenCL lib?

Problem solved! Everything goes right now. Thx for your help.