Limit CPU usage for correct build (raspberry pi3)

Post Reply
b0rn4
Posts: 11
Joined: Mon Feb 05, 2018 11:32 pm

Limit CPU usage for correct build (raspberry pi3)

Post by b0rn4 »

Hi,
I'm trying install openvibe in my pi3 for a few days, and finally can successfully run 1.2.2 version in ubuntu 16.04.
The problem was my pi3 run out of memory when execute build.sh resulting in freezing and reboot.
I solve this with a little line (52) change in linux-build archive:

Code: Select all

NJOBS=`grep processor /proc/cpuinfo | wc -l`
make $1 -j $NJOBS # VERBOSE=1                               #Instead of "$NJOBS" put "1", resulting in limit the jobs to 1!
if [ $? -eq 0 ]; then
	echo Make has been called successfully !
else
	exit -1
fi;
This way can successfully complete entire building process, take a bit longer, but without freeze :D.

Now, want to install openvibe 2.0.1 ---> same freeze result in building process.
I try again to limit jobs in building process but seems "build.sh" archive in 2.0.1 version have a different code structure .
My knowledge of linux is limited and don't find correct way to obtain same result as before.
I appreciate a lot is someone can tell me how can limit jobs in 2.0.1 building process?

Thanks!

jtlindgren
Posts: 775
Joined: Tue Dec 04, 2012 3:53 pm
Location: INRIA Rennes, FRANCE

Re: Limit CPU usage for correct build (raspberry pi3)

Post by jtlindgren »

Hi,

first, good to hear you found a solution for 1.2.2!

OpenViBE 2.x is actually made of 4 different packages, where 3 are code packages (sdk,designer,extras) and the fourth (meta) just binds them together.

The meta level build.sh calls the following scripts to build,

Code: Select all

sdk/scripts/unix-build
designer/scripts/unix-build
extras/scripts/linux-build
You probably need to modify these scripts (or at least the one during which it crashes), perhaps in the same way as you did with 1.2.2. However, 2.x builds sdk and designer with a tool called 'ninja' (instead of make), so you need to find out how to limit the ninja resource use.

Cheers,
Jussi

b0rn4
Posts: 11
Joined: Mon Feb 05, 2018 11:32 pm

Re: Limit CPU usage for correct build (raspberry pi3)

Post by b0rn4 »

Hi Jussi,

I have success in version 2.0.1 too. I modify all 3 builds archives, in 2 cases adding -j 1 after "ninja" sentences, and 1 case just cmake jobs like 1.2.2 version.

Results was a building process complete successfully!!

But..(always exist a but.. :( ) when try to run "openvibe-designer.sh" appears this error:

Code: Select all

6486 (process ID) old priority 0, new priority 19
[  INF  ] Created kernel loader, trying to load kernel module
[  INF  ] Kernel module loaded, trying to get kernel descriptor
[  INF  ] Got kernel descriptor, trying to create kernel
[  INF  ] Adding kernel configuration file [/home/juan/Documents/openvibe-2.0.1-src/dist/extras-Release/share/openvibe/kernel/openvibe.conf]
[  INF  ] Logging to '/home/juan/.config/openvibe-2.0/log/openvibe-designer.log'
./openvibe-designer.sh: line 58:  6492 Segmentation fault      /home/juan/Documents/openvibe-2.0.1-src/dist/extras-Release/bin/openvibe-designer
Some clue about this error o any solution suggest?

Cheers!
Agustin

jtlindgren
Posts: 775
Joined: Tue Dec 04, 2012 3:53 pm
Location: INRIA Rennes, FRANCE

Re: Limit CPU usage for correct build (raspberry pi3)

Post by jtlindgren »

Hi Agustin, sorry for the late reply, its been busy here and your question went under the radar.

In any case what you're seeing is a crash. Try to build.sh with --debug switch to get a debug build, and then run designer with switch --debug too. This will launch the application with gnu debugger. Once it crashes, you can use command 'bt' to get a backtrace. This will tell where the crash occurred and maybe help to solve the issue. You can just paste the backtrace here. You can additionally modify openvibe.conf to set all the logging levels to 'Trace' to get more information that you can send us.


Best,
Jussi

Post Reply