Integration of Stereo-Matching OpenCL application with BBQ - Android

21 views
Skip to first unread message

Edoardo Paone

unread,
Mar 5, 2013, 5:29:09 PM3/5/13
to bosp-...@googlegroups.com
Hello,

I've started the integration of Stereo-Matching OpenCL (aka MultiView) with Barbeque for the STHORM device.
I have a problem with building BOSP for the P2012 Android target platform.

The BOSP local repository is clean (no previous build) and the OS on the host platform is Ubuntu 12.04 (x86_64).

I attached the log of the BOSP build.

/Edoardo
bosp_build.txt

Massimo Maggi

unread,
Mar 5, 2013, 5:36:47 PM3/5/13
to bosp-...@googlegroups.com
Hi,
Do you have the ia32-libs package installed on your system?

Massimo Maggi


2013/3/5 Edoardo Paone <pa...@elet.polimi.it>

/Edoardo

--
You received this message because you are subscribed to the Google Groups "BOSP Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bosp-devel+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Edoardo Paone

unread,
Mar 6, 2013, 1:59:03 AM3/6/13
to bosp-...@googlegroups.com, mas...@mmmm.it
Thanks Massimo,
That solved my installation problem.

/Edoardo

Edoardo Paone

unread,
Mar 11, 2013, 1:28:20 PM3/11/13
to Germain HAUGOU, bosp-...@googlegroups.com
Hi Germain,

I am testing two implementations of MultiView on the STHORM board.
Patrick and I managed to deploy and run both versions. The application processes a certain number of frames, one frame for application cycle, and for each frame the same kernels are executed on the fabric.

However, for one of the two implementations, the application stops after a certain number of frames.
No error message is returned on the application side by the OpenCL APIs, the application is just blocked, probably waiting for some message from the OpenCL runtime. I attached the log from the OpenCL runtime that shows some messages from the p2012 linux driver.

As I said at the beginning, I have two different implementations and this problem happens just for one of them. What is specific with this implementation is that it is designed with more fine-grained kernels and workgroups (but still fixed-size workgroups = 16).

Do you have any idea about this problem?
I could provide the source code/binaries of the application, if you want to make some tests.

Thank you in advance,

Edoardo

MViewB_kernel.log

Germain HAUGOU

unread,
Mar 11, 2013, 5:01:42 PM3/11/13
to Edoardo Paone, bosp-...@googlegroups.com

Hi Edoardo,

 

this looks like a HW bug that we also have on an application. The application is running fine during several frames and then everything is blocked because one DMA transfer is not finished. It seems one DMA transaction did not get the answer to the request. We are currently trying to fix this issue as it seems to be in the FPGA side.  However we have been debugging it for 3 weeks without any a success, I think this will take some time to fix.

Meanwhile, I can check if this is the same bug, I can use the STM probe in order to get the traces. Usually we see that we enter a DMA transfer and we never go out of it. Please send me your source code, I will try it.

 

Bye,

Germain

 

 

---------------------------------------------------------

 

Edoardo Paone

Ph.D. student

 

Politecnico di Milano

Dipartimento di Elettronica e Informazione

Via Giuseppe Ponzio 34/5

20133 Milano, Italy

 

Edoardo Paone

unread,
Mar 11, 2013, 6:31:46 PM3/11/13
to Germain HAUGOU, bosp-...@googlegroups.com
Thank you Germain,

I will send the source code in a separate mail, not on this mailing-list.

However, I will write down here the instructions to run the application.

0) You should already have an Android image for the STHORM board with the latest configuration of BOSP, that Patrick shared with you.

1) Start the Barbeque daemon on the board host cpu:
> adb shell /data/bosp/sbin/barbeque

2) Compile the Mview application:
> cd mview-sthorm-uc5/mview-sthorm-bbq-b/
> make HOST_TYPE=arm FABRIC_TYPE=xp70 all

3) Deploy and run the application on the fabric, for this you can use the script in the application folder:
> ./deploy-adb.sh xp70

4) If you want to run the application again and do not need to re-deploy it, use the option '-x':
> ./deploy-adb.sh xp70 -x

The default configuration runs 10 cycles, you can change this parameter by specifying the command line option '--num_cycles' (see last line in the script):
> adb shell LD_PRELOAD=/data/bosp/lib/bbque/libbbque_rtlib.so OCL_KERNELS_PATH=$MVIEW_DST/mview2/ $MVIEW_DST/mview2/mview_ahead --max_hypo_value=18 --num_cycles=10

Bye,
Edoardo

Edoardo Paone

unread,
Apr 11, 2013, 6:37:29 AM4/11/13
to Germain HAUGOU, bosp-...@googlegroups.com
Hi Germain,

With the env variable P2012_EXC_ID I can now see a change in performance in the MV application.

As I said to you in my previous mail, I have to versions of MV, A and B. The difference between them is that version B as much more fine-grained kernels than version A. Thus, on P2012 version A has better performance.
Conversely, the difference in application frame-rate is more significant for version B than for version A.

At this point we should make a decision.
I prepared a BOSP image for arm-xp70, that includes MV-A, MV-B and Face-Detect (integrated with BBQ):

The commands to deploy this image are the same as those in my previous mail.

The command to run MV is the same for version A and B, except for the path:
A) adb shell LD_PRELOAD=/data/bosp/lib/bbque/libbbque_rtlib.so OCL_KERNELS_PATH=/data/bosp/mview/mview1/ busybox time /data/bosp/mview/mview1/mview_ahead --max_hypo_value=18 --bbq_awm_id=3 --num_cycles=20
B) adb shell LD_PRELOAD=/data/bosp/lib/bbque/libbbque_rtlib.so OCL_KERNELS_PATH=/data/bosp/mview/mview2/ busybox time /data/bosp/mview/mview2/mview_ahead --max_hypo_value=18 --bbq_awm_id=3 --num_cycles=20

In order to expand the performance difference between AWMs for version A, we should use a higher value for the command line parameter 'max_hypo_value'. For example '--max_hypo_value=90':

A) adb shell LD_PRELOAD=/data/bosp/lib/bbque/libbbque_rtlib.so OCL_KERNELS_PATH=/data/bosp/mview/mview1/ busybox time /data/bosp/mview/mview1/mview_ahead --max_hypo_value=90 --bbq_awm_id=3 --num_cycles=20

The command to run Face-Detect is the following:
adb shell LD_LIBRARY_PATH=/data/bosp/lib/bbque/:/data/bosp/facedetect/lib/ busybox time /data/bosp/facedetect/detectTest_ahead -p/data/bosp/facedetect/samples/cam.pgm -l100 -k/data/bosp/facedetect/kernels/ -c/data/bosp/facedetect/haarcascade_frontalface_alt.bin -a0 -m80 -M0 -t4 -b0

To change the AWM (and the associated fabric quota) use the command-line parameter:
'--bbq_awm_id=<AWM>' for MV-A and MV-B
'-b<AWM>' for Face-Detect

There are four possible AWMs in the BBQ recipe:
--bbq_awm_id=0 (-b0) for 25% fabric quota
--bbq_awm_id=1 (-b1) for 50% fabric quota
--bbq_awm_id=2 (-b2) for 75% fabric quota
--bbq_awm_id=3 (-b3) for 100% fabric quota

Regarding the OpenCL runtime on the STHORM platform, we still have the problem that after 3 application runs we have to power-off the board.
Indeed, we would need DSE on the physical platform because it seems that in many cases, for version A, configurations with 50% fabric quota perform as well as configurations with 100% fabric quota. While for version B, the difference between AWM is significant, so we need DSE to identify the optimal trade-off accuracy vs. frame-rate, in particular for those AWMs with low fabric quota.

Alternatively, if we decide not to apply DSE, we could identify some configurations by hand. These configurations will not be the optimal solutions, but will work for the prototype. The question is if we can avoid DSE for the 2PARMA deliverable.

-Edoardo

---------------------------------------------------------

Edoardo Paone
Ph.D. student

Politecnico di Milano
Dipartimento di Elettronica e Informazione
Via Giuseppe Ponzio 34/5
20133 Milano, Italy


Il giorno 11/mar/2013, alle ore 22:01, Germain HAUGOU ha scritto:

Edoardo Paone

unread,
Apr 11, 2013, 6:40:01 AM4/11/13
to bosp-...@googlegroups.com, Germain HAUGOU
I forgot to attach the log of the error we get on the STHORM platform, after 3-4 application runs, that requires to power-off and reboot the board.

-Edoardo

sthorm.log

Germain HAUGOU

unread,
Apr 11, 2013, 10:45:22 AM4/11/13
to Edoardo Paone, bosp-...@googlegroups.com

Hi Edoardo,

 

For the quota indeed, I’ve noticed the application is using 4 workings groups during 50% of the time and only 1 during 50% of the time. This gives between 50% and 60% in average. This explains why there is not a big difference between quota at 50 and quota at 100.

For the board we are looking at the issue but the problem is quite complex, I doubt we will be able to provide a fix before the deadline.

Germain HAUGOU

unread,
Apr 15, 2013, 5:31:18 AM4/15/13
to Edoardo Paone, bosp-...@googlegroups.com

Hi Edoardo,

 

for what concerns ARM-posix, this is an issue on my side, I don’t know if it is a blocking point for. Anyway, on ARM-posix, the BBQ integration has no impact on scheduling as there is no timing, I’m not sure this is useful for 2PARMA.

 

Ciao,

Germain

 

From: Edoardo Paone [mailto:pa...@elet.polimi.it]
Sent: Monday, April 15, 2013 11:14 AM
To: bosp-...@googlegroups.com
Cc: Germain HAUGOU
Subject: Re: Integration of Stereo-Matching OpenCL application with BBQ - Android

 

@Germain: I've tried the new SDK (v159) and now more than 30 application runs complete without errors. I've tried with 36 runs (36 different application configurations) and everything works fine. I'll let you know in case I find any problem with more runs, but I'm quite confident that things now work fine on this side.

 

@Patrick, Giuseppe: For the prototype release I thought we could prepare a virtual machine that shows the integration of BBQ and MV on the GePop simulator. For this I need BBQ running with GePop arm-posix (arm-xp70 is too slow). However, in the latest SDK, BBQ cannot yet read correctly the PIL (the fabric resources are not listed correctly) with GePop arm-posix. Could you please check this issue?

 

@Patrick, Giuseppe: With the latest commit of the branch 'sthorm', I get the following error when building BBQ:

 

[ 75%] Building CXX object bbque/CMakeFiles/barbeque.dir/resource_manager.cc.o
/home/paone/sthorm/bosp/barbeque/bbque/application_proxy.cc: In member function 'RTLIB_ExitCode_t bbque::ApplicationProxy::SyncP_PreChangeRecv(bbque::ApplicationProxy::pcmdSn_t, bbque::ApplicationProxy::pPreChangeRsp_t)':
/home/paone/sthorm/bosp/barbeque/bbque/application_proxy.cc:274:43: error: expected primary-expression before ')' token
/home/paone/sthorm/bosp/barbeque/bbque/application_proxy.cc: In member function 'RTLIB_ExitCode_t bbque::ApplicationProxy::SyncP_SyncChangeRecv(bbque::ApplicationProxy::pcmdSn_t, bbque::ApplicationProxy::pSyncChangeRsp_t)':
/home/paone/sthorm/bosp/barbeque/bbque/application_proxy.cc:461:43: error: expected primary-expression before ')' token
/home/paone/sthorm/bosp/barbeque/bbque/application_proxy.cc: In member function 'RTLIB_ExitCode_t bbque::ApplicationProxy::SyncP_PostChangeRecv(bbque::ApplicationProxy::pcmdSn_t, bbque::ApplicationProxy::pPostChangeRsp_t)':
/home/paone/sthorm/bosp/barbeque/bbque/application_proxy.cc:726:43: error: expected primary-expression before ')' token
make[3]: *** [bbque/CMakeFiles/barbeque.dir/application_proxy.cc.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory `/home/paone/sthorm/bosp/barbeque/build/Release'
make[2]: *** [bbque/CMakeFiles/barbeque.dir/all] Error 2
make[2]: Leaving directory `/home/paone/sthorm/bosp/barbeque/build/Release'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/paone/sthorm/bosp/barbeque/build/Release'
make: *** [bbque] Error 1

 

-Edoardo

Edoardo Paone

unread,
Apr 15, 2013, 5:14:24 AM4/15/13
to bosp-...@googlegroups.com, Germain HAUGOU
@Germain: I've tried the new SDK (v159) and now more than 30 application runs complete without errors. I've tried with 36 runs (36 different application configurations) and everything works fine. I'll let you know in case I find any problem with more runs, but I'm quite confident that things now work fine on this side.

@Patrick, Giuseppe: For the prototype release I thought we could prepare a virtual machine that shows the integration of BBQ and MV on the GePop simulator. For this I need BBQ running with GePop arm-posix (arm-xp70 is too slow). However, in the latest SDK, BBQ cannot yet read correctly the PIL (the fabric resources are not listed correctly) with GePop arm-posix. Could you please check this issue?

@Patrick, Giuseppe: With the latest commit of the branch 'sthorm', I get the following error when building BBQ:

[ 75%] Building CXX object bbque/CMakeFiles/barbeque.dir/resource_manager.cc.o
/home/paone/sthorm/bosp/barbeque/bbque/application_proxy.cc: In member function 'RTLIB_ExitCode_t bbque::ApplicationProxy::SyncP_PreChangeRecv(bbque::ApplicationProxy::pcmdSn_t, bbque::ApplicationProxy::pPreChangeRsp_t)':
/home/paone/sthorm/bosp/barbeque/bbque/application_proxy.cc:274:43: error: expected primary-expression before ')' token
/home/paone/sthorm/bosp/barbeque/bbque/application_proxy.cc: In member function 'RTLIB_ExitCode_t bbque::ApplicationProxy::SyncP_SyncChangeRecv(bbque::ApplicationProxy::pcmdSn_t, bbque::ApplicationProxy::pSyncChangeRsp_t)':
/home/paone/sthorm/bosp/barbeque/bbque/application_proxy.cc:461:43: error: expected primary-expression before ')' token
/home/paone/sthorm/bosp/barbeque/bbque/application_proxy.cc: In member function 'RTLIB_ExitCode_t bbque::ApplicationProxy::SyncP_PostChangeRecv(bbque::ApplicationProxy::pcmdSn_t, bbque::ApplicationProxy::pPostChangeRsp_t)':
/home/paone/sthorm/bosp/barbeque/bbque/application_proxy.cc:726:43: error: expected primary-expression before ')' token
make[3]: *** [bbque/CMakeFiles/barbeque.dir/application_proxy.cc.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory `/home/paone/sthorm/bosp/barbeque/build/Release'
make[2]: *** [bbque/CMakeFiles/barbeque.dir/all] Error 2
make[2]: Leaving directory `/home/paone/sthorm/bosp/barbeque/build/Release'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/paone/sthorm/bosp/barbeque/build/Release'
make: *** [bbque] Error 1

-Edoardo

Edoardo Paone

unread,
Apr 15, 2013, 8:57:38 AM4/15/13
to bosp-...@googlegroups.com
Hi Patrick,
Sometimes I get an error, see the log file attached. It is very strange… can I pass by your office by 18.30?
Barbeque crashes, however I don't know what the reason is… might it be due to some latency? This failure happens while MV is in the onSetup.

I'm working on the latest commit of the branch 'sthorm'.

-Edoardo

mv_log.txt
sthrom_log.txt
Reply all
Reply to author
Forward
0 new messages