Results 1 to 8 of 8

Thread: GPGPU on Qt?

  1. #1
    Join Date
    Mar 2006
    Posts
    142
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default GPGPU on Qt?

    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?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: GPGPU on Qt?

    Use OpenCL, possibly with QtOpenCL module.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jan 2011
    Posts
    212
    Thanks
    24
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: GPGPU on Qt?

    Hi i tried as follows:

    Qt Code:
    1. sajjad@sajjad-G74Sx:~/Downloads/opencl$ ./configure -I/usr/local/cuda/include/CL -L/usr/lib/ -lOpenCL
    2.  
    3. This is the QtOpenCL configuration utility.
    4.  
    5. Qt version ............. 4.7.4
    6. qmake .................. /usr/bin/qmake
    7. OpenCL 1.0 ............. no
    8. OpenCL 1.1 ............. no
    9. OpenCL/OpenGL interop .. no
    10. Extra QMAKE_CXXFLAGS ...
    11. Extra INCLUDEPATH ...... /usr/local/cuda/include/CL
    12. Extra LIBS ............. -L/usr/lib/ -lOpenCL
    13.  
    14. Could not detect an OpenCL implementation ... aborting
    15. Use the -verbose option for more information
    To copy to clipboard, switch view to plain text mode 


    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

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: GPGPU on Qt?

    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.

  5. #5
    Join Date
    Mar 2006
    Posts
    142
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: GPGPU on Qt?

    Quote Originally Posted by wysota View Post
    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?

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: GPGPU on Qt?

    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Mar 2006
    Posts
    142
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: GPGPU on Qt?

    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:

    Qt Code:
    1. #if [ "x$CFG_OPENCL" != "xyes" ] ; then
    2. # echo "Could not detect an OpenCL implementation ... aborting"
    3. # if [ "x$OPT_VERBOSE" = "xno" ] ; then
    4. # echo "Use the -verbose option for more information"
    5. # fi
    6. # exit 1
    7. #fi
    To copy to clipboard, switch view to plain text mode 
    Last edited by Caius Aérobus; 23rd April 2012 at 17:50.

  8. #8
    Join Date
    Mar 2006
    Posts
    142
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: GPGPU on Qt?

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

    Undefined symbols:
    "_clRetainProgram", referenced from:
    QCLProgram:perator=(QCLProgram const&)in blurwidget.o
    "_clReleaseProgram", referenced from:
    QCLProgram::~QCLProgram()in blurwidget.o
    QCLProgram:perator=(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:


    Quote Originally Posted by Caius Aérobus View Post
    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.
    Last edited by Caius Aérobus; 23rd April 2012 at 21:39.

Similar Threads

  1. QtConcurrent and CUDA or GPGPU
    By olidem in forum Qt Programming
    Replies: 8
    Last Post: 27th February 2013, 22:07

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.