Can I use openCL in a application that I distribute to non developer machine? - driver

I recently started to learn how to use openCL to speed up some part of my code. So far the speed gain is impressive. In one case the code ran up to 50X faster than on the CPU. However I wonder if can start using this code in a production environnement. The reason is that the first time that I tried to run the example code, nothing worked. I was able to make it run by downloading the driver on the Nvidia openCL SDK download page (I have a Geforce GTX260). It gave me a blue during installation but after that I was able to run the example program and create my own code.
Does the fact that it didn't work "out of the box" for me mean that the mainstream drivers does not yet support it, despite the fact that it is specifically written that it does on the driver download page? What about ATI support? Will everyone have to download the special driver that gave me a blue screen on install?
In short, is openCL ready for production code?
If someone can give me some details, I'd like to know. Does anyone has been able to run a simple program on a number of different device without installing anything SDK related?

You may find an accurate answer on the OpenCL forums on the Khronos Group message boards. The OpenCL work group hangs out there regularly.

Does anyone has been able to run a
simple program on a number of
different device without installing
anything SDK related?
Nop. For instance, on ATI's GPUs end-users need to install ATI Stream SDK in order to run OpenCL code (just having an up-to-date graphics driver is not sufficient).

You may want to consider trying DirectCompute (Microsoft's version of GPU programming) or doing your OpenCL work on a Snow Leopard Mac. Those are the two ways (that I know of) that you can deliver a GPU programming solution to another user without any driver or other installation hassle.

Related

How does Instruments collect data from iOS without DTrace being available?

I am trying to understand the inner workings of XCode's Instruments. On MacOS, it can rely on DTrace to gather all kinds of profiling data. On iOS, it is also capable of lots of things, but I have read repeatedly that DTrace has not been ported to iOS.
So how does that work?
The Apple documentation on DTrace isn't telling me much about the inner workings here. I have noticed, however, that when profiling my own App from XCode using Instruments, XCode seems to build it differently. Could that mean it links some standalone DTrace providers with my code?
Thanks in advance!
/e: I would bounty this question with my ENTIRE 6 REPUTATION POINTS if only i could...
For iOS apps running inside the Simulator, obviously the Simulator is a Mac OS X program, so it can use DTrace to monitor everything the Simulator does.
For iOS apps running on an iPhone, I agree the documentation provides little insight into what's happening. It's probably either loading monitoring code into the target process on iOS (either by adding the code at compile time or by linking it in at runtime) or there is an "traditional debugger" running on iOS against the target process to implement the tracing. Those are pretty much the only options if there is no kernel-level support for using DTrace.
I've never used Instruments, but the main thing that jumps out at me is that they're able to collect seemingly-OS-level statistics about I/O, which would not normally be measurable without DTrace. I'm not sure because I haven't used it, but it's possible these statistics are only tracking I/O from easy-to-detect entrypoints (ie I/O-related syscalls from the specific target process), or that there are other iOS-specific statistic sources which are published by the OS. For instance, many system statistics can be gotten from Mac OS X by calling sysctl. Depending on what statistics are actually being collected, Instruments could just be using simple counters like these to do most of the work.
If you're really determined to find the answer, it would be a fun DTrace challenge to figure this problem out by DTracing Instruments itself. Good luck :-)

bluetooth communication in nxj

I'm nxj beginner.
I have some questions about bluetooth communication between PC and brick.
First, when bluetooth communication occurs, where is the birthplace processing this datas?
In other words, I want to know whether these datas will be processed on CPU or brick.
Second, what is exact roles CPU and brick in bluethooth communication?
That means what is processed on CPU and what is processed on brick.
I have searched almost web site but I can't find this anywhere.
Please help me. Thanks.
You can see it in the package structure.
lejos.nxt.*
This package contains classes running on the NXT-brick. All code in this package will be compiled for the brick and will run on the brick.
lejos.pc.*
Here the difference is not that clear. This is java-code you compile for personal computer. So most code runs on your computer. But some classes (e.g: RemoteMotorController) only send messages to the NXT-brick which gives commands to the motors.
lejos.pc.comm provides API's that allow you to communicate/control the nxt robot from the PC.
When importing the the libs to an Android project, it allows you to build an instance of the same environment used on a pc, but within android.
I agree it can be tough finding some things out. It would be great if there was as stronger lejos presence on SO
This question is months old and has remained un-answered I actually have a lot of questions about it myself, but I might be able to provide some insight for utter novices.
when using bluetooth with Android and NXJ robots, you use either lejos.pc.comm or lejos.NXJ.
Both provide APi's to do almost the same thing, but work a little differently. I don't know nearly enough about the NXJ api, but I do know that it is the one that lets you manipulate the robot much more effectively, such as outputting data to it's LCD screen, which you can't do with the pc.comm api
As far as I can tell, the pc.comm API uses both Android Bluetooth API's and it's own protocols to allow communication with Lego LCP commands.
(I want to come back to this, but I'm writing a dissert on the topic so I'll try to update it in a couple of days. Seems not many are interested though, shame)

OpenCV porting for ARM9

I'm new to embedded software, I want to build a Image processing application for my AT91SAM9261-EK development board by Atmel. To make it simple i want to use the OpenCV functions, but i'm not sure how am I going to generate a .bim file for flashing on the brd.
Also can anyone you help me understand the flow / software structure for these kind of applications?
Like, will I need Linux or any other OS, if so where does the actual image processing code which i intend to write using opencv sit ?
Till now for simple codes like Basic LCD project, for this board i'm compiling the code using IAR workbench, so if I want to use the same for opencv functions, is there a way ?
Is there any other open source image processing libraries similar to opencv & easy to integrate with IAR or any other ARM compiler ?
Also it would be really useful if there are any links to some learning documents regarding this
Thanks in advance ?
Depending on your application, I think that CPU is not going to be powerful enough to do any kind of image processing; plus the weirdness of working with a foreign system is not going to make your life any easier.
If using this exact CPU is not super important I'd recommend a Beagleboard or Pandaboard, mainly because Ubuntu has installers targeted to the boards and Ubuntu/Debian offers OpenCV packages out of the box, and this is going to remove a whole lot of hurdles if you're new to embedded development -- basically it turns your dev board into a full-featured computer, just plug in a monitor, keyboard and mouse.
The Raspberry Pi looks to be promising in this regard as well, and you certainly can't argue with the price! (You may be able to install Debian on your board and get access to OpenCV packages this way, but I can't vouch for the ease-of-use of this method compared to Ubuntu, which is difficult enough, especially if you're new to Linux).

What are the steps should be taken to make sure that the OpenCV code running on PC will run on a particular embedded device?

I want to port a good OpenCV code on an embedded platform. Earlier such stuffs were very difficult to perform but now TI has come up with nice embedded platforms which are comparatively hassle free as they say.
I want to know following things:
Given that :
The OpenCV code is already running on PC smoothly. (obviously)
Need to determine these before purchasing the device.
Can't put the code here in stackoverflow. :P
To chose from Texas Instruments: C6000.
Questions:
How to make it sure that the porting will be done?
What steps to be taken to make it sure that after porting the code, will run (at least).
to determine whether the code might require some changes to make its run smooth.
The point 3 above is optional.
I need info which will at least give me some start up in this regard.
What I thought I should do?
I am to list the inbuilt functions down.
Then to find available online bench marking for those functions for the particular device like as shown towards the end of this doc.
...
Need to know how to proceed further?
However C6-Integra™ DSP+ARM Processor seems the best.
The best you can do is to try a device simulator (if it is available), but what you'll see there is far from perfect.
Actually, nothing can tell you how fast and how well the app will run on the embedded device before running you specific app on that specific device.
So:
Step 1 Buy it
Step 2 Try it
Things to consider:
embedded CPU architecture: Your app needs a big cache? how big is the embedded cache?
algorithm: do you use a lot of floating point operations? how good is the device at floating point ops?
do you have memory transfers? data bus on a PC is waaay faster than on embedded
hardware support: do you use a lot of double-precision calculations? they are emulated on ARMs. They are gonna kill your app (from millisecons on a PC it can go to seconds on a ARM)
Acceleration. Do your functions use SSE? (many OpenCV funcs are SSEd, even if you don't know). Do you have the NEON counterpart? (OpenCV does not have much support for that). The difference can be orders of magnitude from x86 SSE to embedded without NEON.
and many, many others.
So, again: no one can tell you how it will work. Just the combination between the specific app and the real device tells the truth.
even a run on a similar device is not relevant. It can run smoothly on a given processor, and with another, with similar freq or listed memory, it will slow down too much
This is an interesting question but run is a very generic word in this context, therefore I feel the need to break it down to other 2 questions:
Will it compile in an embedded device?
Will it run as fast/smooth as in a PC?
I've used OpenCV in a lot of different devices, including ARM, SH4, MIPS and I found out that sometimes the manufacturer of the device itself provides a compiled version of OpenCV (for my surprise), which is great. That's something you can look into, maybe the manufacturer of your device provide OpenCV binaries.
There's no way to know for sure how smooth your OpenCV application will be on the target device unless you are able to find some benchmark of OpenCV running in there. PCs have far better processing power than embedded devices, so you can expect less performance from the target device.
There are 3rd party applications like opencv-performance, that you can use to test/benchmark the environment once you get your hands on it. And if performance is such a big deal in this project, you might also be interested in this nice article which explain some timing tests done on couple of OpenCV features comparing implementations using the C and C++ interfaces of OpenCV.

Anyone ever tried to develop in C or C++ for Blackberry platforms?

Every indication I have, based on my experience in embedded computing is that doing something like this would require expensive equipment to get access to the platform (ICE debuggers, JTAG probes, I2C programmers, etc, etc), but I've always wondered if some ambitious hacker out there has found a way to load native code on a Blackberry device. Anyone?
Edit: I'm aware of the published SDK and it's attendant restrictions. I'm curious if anyone has attempted to get around them, and if so, how far they got.
I've seen this question pop up in a number of different forums over time. The original Blackberries were programmable in C++ but I think that RIM ran up against the problems of trying to implement a secure platform in the C/C++ compile to native paradigm.
The devices do have JTAG ports, but unless one could get hands on the RIM code as a place to start the problem is enormous.
I also have to wonder how useful a Blackberry with a replacement FOSS operating system would be, since it would not likely have the protocols to connect to BES or BIS, send PIN's etc. If one was simply looking for a the power of the hand held computing platform I suspect there are many more likely candidates available.
No, C++ is no longer a supported RIM development tool, as they phased it out a number of years ago. Client applications can be developed in Java (or one of a few 5GL frameworks), and web + sever-side apps can be developed using standard tools.
For those looking for updated information, the new Playbook os, also known as QNX, also known as Blackberry 10 (or it will be when the phones running it come out) is in fact c/c++ based, also using QML and a C++ add on called Cascades.
Unfortunately the official SDK website only seems to mention Java. According to wikipedia, different versions of the BlackBerry use different processors. Combined with the fact that RIM uses a proprietary operating system for the devices, it becomes pretty difficult to develop native code without official tools. There is also a partial API-level security restriction which would further prohibit advanced tinkering.
Just randomly searching for an answer to this and came across http://supportforums.blackberry.com/t5/Tablet-OS-SDK-for-Adobe-AIR/Native-C-C-SDK/td-p/778009 which mentions that BB intend to release a C/C++ SDK soon, more details will be provided at the 2011 Game Developer Conference.

Resources