Linux not recognizing all of the cores?

Any technical questions about the Epiphany chip and Parallella HW Platform.

Moderator: aolofsson

Linux not recognizing all of the cores?

Postby baseballguy » Wed Jul 23, 2014 6:38 pm

Hi everyone,

I was running some benchmarks on the Parallella 16 core board and I was getting some weird results. I used the "nproc" command (described here: http://www.cyberciti.biz/faq/linux-get- ... e-command/) to see how many processing units are available. I was expecting to see 16, but instead 2 was outputted. I attached a picture of the rest of the details. I was wondering if anyone came across this problem or knows what to do to fix it?

Thanks
Attachments
sock.jpg
sock.jpg (106.16 KiB) Viewed 12613 times
baseballguy
 
Posts: 40
Joined: Tue Jul 08, 2014 1:36 pm

Re: Linux not recognizing all of the cores?

Postby toralf » Wed Jul 23, 2014 6:58 pm

Shouldn't that output just show the ARM cores ?
toralf
 
Posts: 8
Joined: Thu Nov 07, 2013 3:41 pm

Re: Linux not recognizing all of the cores?

Postby tincman » Wed Jul 23, 2014 8:05 pm

toralf wrote:Shouldn't that output just show the ARM cores ?


The confusion may be related to the Epiphany's status as a "coprocessor"

Baseballguy, the Epiphany cores are not full application processors, but "micro" RISC cores that are incapable of running a full OS like Linux. Linux will not see them nor know what to do with them.

At the moment, utilizing them requires custom bare-metal programs (coupled with a program running on the host to communicate with it), or using something that can target the Epiphany (like the OpenCL implementation, coprthr). The usage is closer to that of GPGPU than SMP type systems.

I hope this does not discourage you! This chip is pretty awesome and revives an amazing concept that was very likely ahead of its time--the transputer.

If you have little programming knowledge but wish to contribute, perhaps you can stress test the OpenCL implementation with applications that have OpenCL support, then report benchmarks and/or what breaks (as the OpenCL implementation is not fully conformat at the moment).
User avatar
tincman
 
Posts: 8
Joined: Mon Dec 17, 2012 3:30 am
Location: CO, US

Re: Linux not recognizing all of the cores?

Postby baseballguy » Thu Jul 24, 2014 1:20 pm

Sorry, I'm pretty new to parallel programming and stuff, but is it possible to run these benchmarks (PARSEC) on the Epiphany cores instead of the ARM cores?
baseballguy
 
Posts: 40
Joined: Tue Jul 08, 2014 1:36 pm

Re: Linux not recognizing all of the cores?

Postby baseballguy » Thu Jul 24, 2014 1:42 pm

Basically from what I understand, the CPU usage will indicate how many cores are running. For example, if 8 cores really are running, then the CPU usage would be 800%. If 4 cores are running , it would be at 400%. However, all of the PARSEC programs maxed out at 200% showing that only 2 cores(the ARM) are running.

Is my understanding correct or am I missing something?

Thanks
baseballguy
 
Posts: 40
Joined: Tue Jul 08, 2014 1:36 pm

Re: Linux not recognizing all of the cores?

Postby 9600 » Thu Jul 24, 2014 2:29 pm

baseballguy wrote:Basically from what I understand, the CPU usage will indicate how many cores are running. For example, if 8 cores really are running, then the CPU usage would be 800%. If 4 cores are running , it would be at 400%. However, all of the PARSEC programs maxed out at 200% showing that only 2 cores(the ARM) are running.

Is my understanding correct or am I missing something?


That is correct. By default the benchmarks, as with any existing software that is simply downloaded and compiled, will only run on the 2 ARM cores.

A "true" Parallella program that is able to make use of the Epiphany co-processor will have two parts:

  • The host code that runs on the ARM host under Linux. This is the thing you would execute.
  • Epiphany code that is loaded onto the Epiphany cores(s).

These two parts communicate with each other, and the ARM part is the one that you interact with and which can access the network and disk etc. and the Epiphany part is the one doing the heavy lifting. At present there is no second part running on the Epiphany.

Please see the Epiphany SDK Reference Manual. If you take the time to digest this everything should be a lot clearer :)

Regards,

Andrew
Andrew Back (a.k.a. 9600 / carrierdetect)
User avatar
9600
 
Posts: 997
Joined: Mon Dec 17, 2012 3:25 am

Re: Linux not recognizing all of the cores?

Postby baseballguy » Thu Jul 24, 2014 3:04 pm

Thanks for the reply. So my next step would be to try and port the PARSEC programs so that they have host and Epiphany codes?

Also, is there any way to know if the Epiphany cores are working? (any library call?)

Thanks for the help
baseballguy
 
Posts: 40
Joined: Tue Jul 08, 2014 1:36 pm

Re: Linux not recognizing all of the cores?

Postby 9600 » Thu Jul 24, 2014 3:14 pm

baseballguy wrote:Thanks for the reply. So my next step would be to try and port the PARSEC programs so that they have host and Epiphany codes?


In essence, yes, but I say this without having looked at PARSEC to see if those particular benchmarks are a good fit.

Also, is there any way to know if the Epiphany cores are working? (any library call?)


If you mean a general core activity indicator, I believe there is a Java tool.

If you mean a means of testing them to see if they are functional, the Epiphany and Parallella examples (see the GitHub repos) will allow you to do this.

Cheers,

Andrew
Andrew Back (a.k.a. 9600 / carrierdetect)
User avatar
9600
 
Posts: 997
Joined: Mon Dec 17, 2012 3:25 am

Re: Linux not recognizing all of the cores?

Postby baseballguy » Sat Jul 26, 2014 1:04 pm

Right now, I'm trying to run the Parsec benchmarks on the Epiphany cores. The programs on Parsec have this option where you get to choose your own build configuration out of these options:

- 'gcc' Build parallel version of suite with gcc
- 'gcc-serial' Build serial version of suite with gcc
- 'gcc-hooks' Build parallel version of suite with PARSEC hooks
enabled with gcc
- 'icc' Build parallel version of suite with Intel compiler
- 'gcc-pthreads' Build with pthreads parallelization (if supported)
- 'gcc-openmp' Build with OpenMP parallelization (if supported)
- 'gcc-tbb' Build with TBB parallelization (if supported)

Let's take the pthreads one for example. Let's say that I build the program using the command with the pthreads. What would be the next step to making sure that the program runs on 16 cores?

P.S (This is what I tried to do): I tried to say "parsecmgmt -a build -p fluidanimate -c gcc-pthreads" and then I said "./run.sh". The program worked fine. However, I used the erm program(https://github.com/adapteva/epiphany-ex ... r/apps/erm) to track the cores' activity and there were no changes(all the statistics stayed at 0)

Any help you guys could give me would be appreciated.
baseballguy
 
Posts: 40
Joined: Tue Jul 08, 2014 1:36 pm

Re: Linux not recognizing all of the cores?

Postby sebraa » Tue Jul 29, 2014 5:56 pm

If you select gcc-pthreads, your benchmark is compiled to use POSIX threads using the ARM cores. So it will parallelize, just not on the Epiphany. :-)

The host application is responsible for loading the programs into the Epiphany cores, communicate with them and make use of the data it receives. It is compiled with the host compiler (gcc) and runs on the host (ARM).
Then, you have the Epiphany applications, which are doing the heavy lifting. They are compiled with the Epiphany compiler (e-gcc), which is part of the SDK.

You cannot take a ready-made program, compile it with the defaults and expect it to use your Epiphany (unless it is written for or specifically supports it). It might work with OpenCL, but I haven't looked at it yet. So unless your application supports Epiphany or OpenCL, you need to port it yourself first.
sebraa
 
Posts: 495
Joined: Mon Jul 21, 2014 7:54 pm


Return to Epiphany and Parallella Q & A

Who is online

Users browsing this forum: No registered users and 10 guests

cron