Git Product home page Git Product logo

Comments (10)

kohrt avatar kohrt commented on August 21, 2024

Hi,
I used OpenCL methods from OpenCV. Just remove Line 32 and it should work.

But you won't get faster results when using OpenCL on the CPU. There is no OpenCL GPU driver from Intel. The one you have installed does only support the CPU. I you want to use the GPU take a look at the Beignet project.

Regards,
Thiemo

from iai_kinect2.

kohrt avatar kohrt commented on August 21, 2024

Does it still crash or is the problem solved?

from iai_kinect2.

masterhui avatar masterhui commented on August 21, 2024

Hello Thiemo,
Unfortunately, I got sidetracked with other projects, so I haven't been
able to try out what you suggested. I am hoping to get back to where I left
off nearly 4 weeks ago and will report back to you as soon as I've got
results.

Sorry for the big delay again.

Regards,
Heiko

On Mon, Nov 24, 2014 at 9:53 AM, Thiemo Wiedemeyer <[email protected]

wrote:

Does it still crash or is the problem solved?


Reply to this email directly or view it on GitHub
#11 (comment).

from iai_kinect2.

kohrt avatar kohrt commented on August 21, 2024

No problem, just wanted to check whether this issue can be closed or not.

from iai_kinect2.

masterhui avatar masterhui commented on August 21, 2024

Hi,
I tried removing the opencv2 include you suggested, however, this didn't fix the segfault issue. I then went on to try out Beignet for GPU based OpenCL support using the integrated GPU of my Intel i7-3840QM CPU. To get this setup working I did the following:

Getting it to work

  • Upgrade from Ubuntu 12.04 to 14.04 (no llvm-3.5 on 12.04)
  • Upgrade to Kernel 3.16.0-031600-generic (to get the integrated Intel USB 3.0 controller to work without producing errors with Kinect v2)
  • Download and compile the new Beignet_v1.0 release from source (there is a Beignet_v0.3 binary for Trusty, but its very old, buggy and slow; couldn't get it to run)
  • Upgrade from ROS Hydro to Indigo (while I was at it)

Dependencies

Depencies for Beignet which I had to manually install:

  • ocl-icd-dev
  • ocl-icd-libopencl1
  • libdrm / libdrm-dev
  • llvm-3.5 / llvm-3.5-dev
  • clang-3.5 / clang-3.5-dev
  • libegl1-mesa-dev
  • libedit-dev

Additional steps

Additional steps to get Beignet to compile and pass the built-in unit tests:

  • Error "clang: not found":
sudo ln -s /usr/lib/llvm-3.5/bin/clang /usr/bin/clang
  • Known Beignet issue with Kernel 3.15/3.16 (see Beignet readme); fix is to disable cmd_parser:
sudo su
echo 0 > /sys/module/i915/parameters/enable_cmd_parser

After this, Beignet compiled and installed without errors.

To get 100% pass rate on the Beignet unit tests I have to:

  • Execute directly on hw: ssh-session doesn't work
  • Execute as root

Both previous points have to to with the fact that I don't have an x-server installed. Apparently this will be fixed with next release of Beignet.

Result

In order to run kinect_bridge and linfreenect2 using Beignet_1.0, I have to:

sudo su
echo 0 > /sys/module/i915/parameters/enable_cmd_parser
source /opt/ros/indigo/setup.bash
rosrun kinect2_bridge kinect2_bridge

The reward for all the hard work: I get ~100 FPS on the OpenCLDepthPacketProcessor (compared to < 5 FPS on same hardware using CPU-based depth registration!)

...
[OpenCLDepthPacketProcessor] avg. time: 10.1716ms -> ~98.3129Hz
[TurboJpegRgbPacketProcessor] avg. time: 16.0787ms -> ~62.194Hz
...

:-) Success

Setup

FYI, output from clDeviceQuery:

./clDeviceQuery
clDeviceQuery Starting...
2 OpenCL Platforms found
 CL_PLATFORM_NAME:      Intel Gen OCL Driver
 CL_PLATFORM_VERSION:   OpenCL 1.2 beignet 1.0 (git-9068a26)
OpenCL Device Info:
 1 devices found supporting OpenCL on: Intel Gen OCL Driver
 ----------------------------------
 Device Intel(R) HD Graphics IvyBridge M GT2
 ---------------------------------
  CL_DEVICE_NAME:                       Intel(R) HD Graphics IvyBridge M GT2
  CL_DEVICE_VENDOR:                     Intel
  CL_DRIVER_VERSION:                    1.0
  CL_DEVICE_TYPE:                       CL_DEVICE_TYPE_GPU
  CL_DEVICE_MAX_COMPUTE_UNITS:          16
  CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS:   3
  CL_DEVICE_MAX_WORK_ITEM_SIZES:        512 / 512 / 512
  CL_DEVICE_MAX_WORK_GROUP_SIZE:        512
  CL_DEVICE_MAX_CLOCK_FREQUENCY:        1000 MHz
  CL_DEVICE_ADDRESS_BITS:               32
  CL_DEVICE_MAX_MEM_ALLOC_SIZE:         256 MByte
  CL_DEVICE_GLOBAL_MEM_SIZE:            1024 MByte
  CL_DEVICE_ERROR_CORRECTION_SUPPORT:   no
  CL_DEVICE_LOCAL_MEM_TYPE:             global
  CL_DEVICE_LOCAL_MEM_SIZE:             64 KByte
  CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE:   512 KByte
  CL_DEVICE_QUEUE_PROPERTIES:           CL_QUEUE_PROFILING_ENABLE
  CL_DEVICE_IMAGE_SUPPORT:              1
  CL_DEVICE_MAX_READ_IMAGE_ARGS:        128
  CL_DEVICE_MAX_WRITE_IMAGE_ARGS:       8
  CL_DEVICE_IMAGE <dim>                 2D_MAX_WIDTH     8192
                                        2D_MAX_HEIGHT    8192
                                        3D_MAX_WIDTH     8192
                                        3D_MAX_HEIGHT    8192
                                        3D_MAX_DEPTH     2048
  CL_DEVICE_PREFERRED_VECTOR_WIDTH_<t>  CHAR 8, SHORT 8, INT 4, FLOAT 2, DOUBLE 4

clDeviceQuery, Platform Name = Intel Gen OCL Driver, Platform Version = OpenCL 1.2 beignet 1.0 (git-9068a26), NumDevs = 1, Device = Intel(R) HD Graphics IvyBridge M GT2 

from iai_kinect2.

kohrt avatar kohrt commented on August 21, 2024

Great that you managed to get it working with the Intel GPU. For me and others the Intel USB 3.0 works also with kernel >=3.13.0-35-generic. So maybe the cmd_parser fix for Beignet is not needed. I will add your instructions to the READMEs.
Thanks a lot.

from iai_kinect2.

masterhui avatar masterhui commented on August 21, 2024

You're right, I had also read that kernel >=3.13 should fix the USB 3.0 issue. However, I tried these kernels:

3.16.0-031600-generic -> OK
3.14.3-031403-generic -> FAIL
3.10.1-031001-generic -> FAIL
3.8.0-35-generic -> FAIL

and 3.14 didn't work for me for some reason. That's why I went to 3.16 - maybe it also depends on Ubuntu release that's being used?!?

from iai_kinect2.

kohrt avatar kohrt commented on August 21, 2024

I am using 14.04.1 with 3.13.0-40-generic at the moment.

from iai_kinect2.

masterhui avatar masterhui commented on August 21, 2024

OK, when I tried the kernels above I still was on 13.10. Will try 3.14 again now that I'm on 14.04 and report back.

from iai_kinect2.

masterhui avatar masterhui commented on August 21, 2024

I did some more testing using the same kernel 3.13.0-40-generic that you use -> It works. So, for some reason 3.14.3-031403-generic is the odd one out >=3.13.0-35-generic that doesn't work... strange that is. At least I don't have to disable cmd_parser any more. Cheers!

from iai_kinect2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.