View previous topic :: View next topic |
Author |
Message |
bus.dch n00b
Joined: 30 Nov 2005 Posts: 57
|
Posted: Wed Nov 30, 2005 6:32 pm Post subject: IBM Full-System CBE (Cell) Processor Simulator |
|
|
IBM has just released the full-system simulator for the CBE (Cell) processor. A free download is available at http://alphaworks.ibm.com/tech/cellsystemsim?open&S_TACT=105AGX59&S_CMP=GR&ca=dgr-lnxwSystemSim (registration required). Also known as by its code name mambo at the IBM Austin Research Lab, the file you start out with is systemsim-cell-1.0-fc4-x86.tar.bz2
I'm just getting started installing it. It was designed for Fedora Core 4, of course, but that shouldn't be too much trouble... |
|
Back to top |
|
|
bus.dch n00b
Joined: 30 Nov 2005 Posts: 57
|
Posted: Wed Nov 30, 2005 8:09 pm Post subject: Must it install in /opt? |
|
|
From http://www-128.ibm.com/developerworks/power/library/pa-cellstartsim/index.html
Quote: | The central component of the SDK, from a developer's perspective, is the install script which loads all of this software in appropriate places. The XL C compiler, the GCC toolchain, the PPC64 RPMs, and the SPE timing program are installed in /opt. The sample code, and the kernel and support libraries, are installed in the working directory from which you ran the installer. At this time, loading the SDK software elsewhere is not supported. |
So getting it to work under gentoo... |
|
Back to top |
|
|
bus.dch n00b
Joined: 30 Nov 2005 Posts: 57
|
Posted: Fri Dec 02, 2005 12:47 am Post subject: Running the Simulator under Gentoo, option 1 of 2 |
|
|
At last, everything works.
To run the system simulator, you need to download some files from IBM's website: (free registration required)
systemsim-cell-1.0-fc4-x86.tar.bz2 (8128KB)
http://www.alphaworks.ibm.com/tech/cellsystemsim/download
cell-sdk-lib-samples-1.0.tar.bz2 (3972KB)
cell-spu-timing-1.0-1.i686.rpm (85KB)
http://www.alphaworks.ibm.com/tech/cellsw/download
If you're going with option 1, keep reading. If you prefer not to su root and build the ramdisk image IBM's way, skip to the post about option 2.
xlc-cell-cmp-1.0-1.i386.rpm (13846KB)
xlc-cell-lib-1.0-1.i386.rpm (2971KB)
http://www.alphaworks.ibm.com/tech/cellcompiler/download
Barcelona Supercomputing Center has more files you will need: (no registration required)
toolchain-build.tbz (12KB)
toolchain-2.3+-src.tar.bz2 (48355KB)
ppc-fc4-rpms-1.0.0-1.i386.rpm (57452KB)
cell-linux-patches-1.0.tar.bz2 (75KB)
libspe-1.0.tar.bz2 (33KB)
(If these links are broken, it is because Barcelona Supercomputing Center is frequently updating the tools.)
And finally, some compatibility packages are required:
ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.14.tar.bz2 (38255KB) (Verify its signature: ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.14.tar.bz2.sign)
ftp://ftp.gnu.org/gnu/gcc/gcc-4.0.2/gcc-core-4.0.2.tar.bz2 (14956KB) (Verify its signature: ftp://ftp.gnu.org/gnu/gcc/gcc-4.0.2/gcc-core-4.0.2.tar.bz2.sig)
ftp://ftp.gnu.org/gnu/gcc/gcc-4.0.2/gcc-g++-4.0.2.tar.bz2 (2582KB) (Verify its signature: ftp://ftp.gnu.org/gnu/gcc/gcc-4.0.2/gcc-g++-4.0.2.tar.bz2.sig)
Total download size: 190722KB = 187MB
At this point, there are several ways to get the simulator to run. The method IBM has documented requires you install Fedora Core 4 and follow the instructions on the IBM website. I've done that. It's a nice start, but it's incomplete, inconvenient, and not gentoo.
So option 1 is the one I've spent a lot of time on. You can build the entire simulation environment from source. (Note: the simulator itself is IBM's. But the kernel + filesystem + GCC tools you build from source.) Building several GCC's targetted to the architecture takes a few hours and a fair amount of disk space. Finally, you must su or sudo root to mount the loopback device and populate the simulation filesystem.
Option 2 is the quickest and easiest. I'm still testing it, but you won't need root privileges to install and run the simulator. You get a bootstrap image inside the script below; the simulator populates its own filesystem as part of the install process. Skip to the post about option 2 if you want that.
For either of the two options I've put together, see the script I will post below. IBM's option uses this HOWTO and this install.sh.
If you copy and paste the script below (it's very long) and run it as joe user, you'll need to make a directory and put all the downloaded files and the script there. Let's say you called the script gentoo-install.sh:
Code: | ~ $ cd downloaded
~/downloaded $ ./gentoo-install.sh
Option 1:
A. Extract 12 files to /home/dhubbard/cbe [131M compr, abt 923M uncompressed]
B. Build 5 targets [cbe directory grows to about 4.6G]
(Can take 3 hours on a single CPU, 1 hour on 2-4 CPUs)
C. Make a disk image for the simulator using ppc-fc4-rpms-1.0.0-1.i386.rpm
Option 2:
A. Extract 12 files to /home/dhubbard/cbe [120M compr]
B. Build compatibility libraries for systemsim
(GLIBC 4.0.x not detected on your system.)
C. Bootstrap simulator and load disk image.
(IBM SDK will not be fully compiled using this option.) |
Now choose one of the two options. If you go with option 1, the build should go just fine up the point where it tries to mount a loopback image to create the simulator filesystem. The simulator is installed in ~/cbe. I'm abbreviating some of this with ...
Code: | Choose 1 or 2: 1
toolchain src: ~/cbe/toolchain/tools/jsre/toolchain-2.3-src/toolchain
linux install: ~/cbe
ll : not selected
spu binutils configure : run ... ok [ 4s]
...
Building glibc (gcc 4.0.2)
creating cache ./config.cache
The following languages will be built: c,c++
updating cache ./config.cache
creating ./config.status
creating Makefile
make > ~/cbe/systemsim-cell-release/glibc/build.log
make install >> ~/cbe/systemsim-cell-release/glibc/build.log
Warning: mounting loopback device may fail, as you are not root.
mount: only root can do that
~/downloaded $
|
That usually takes several hours. !!! The tools are all built (and won't be rebuilt). Jump into a root shell and re-run the script. Select option 1 again:
Code: | ~/downloaded $ su
Password:
downloaded # ./gentoo-install.sh
Option 1:
A. Extract 12 files to /home/dhubbard/cbe [131M compr, abt 923M uncompressed]
B. Build 5 targets [cbe directory grows to about 4.6G]
(Can take 3 hours on a single CPU, 1 hour on 2-4 CPUs)
C. Make a disk image for the simulator using ppc-fc4-rpms-1.0.0-1.i386.rpm
Option 2:
A. Extract 12 files to /home/dhubbard/cbe [120M compr]
B. Build compatibility libraries for systemsim
(GLIBC 4.0.x not detected on your system.)
C. Bootstrap simulator and load disk image.
(IBM SDK will not be fully compiled using this option.)
Choose 1 or 2: 1
Directory ~/cbe already exists. Skipping all file extraction.
~/cbe/systemsim-cell-release/lib/libstdc++.so.6 exists:
All build steps skipped.
Unpacking ppc-fc4-rpms-1.0.0-1.i386.rpm to ~/downloaded/diskimg
SysVinit-2.85-39.ppc.rpm
...
vim-minimal-6.3.071-3.ppc.rpm
Installation was successfull. To run the simulator:
cd ~/cbe/systemsim-cell-release/run/cell/linux
../run_gui
downloaded #
|
The first time through, ppc-fc4-rpms-1.0.0-1.i386.rpm is extracted into downloaded/diskimg. It's a pile of 45 RPMs. If you want to add or remove RPMs, that's fine. The script will complain if there aren't 45, but it proceeds anyway. Re-run the script as root, and it will build the disk image again with the new set of RPMs.
It's possible to run the whole build process in an su shell; it will run fine all the way to completion. But that's tacky.
If loopback device support is not compiled into your kernel, the script exits with "Cannot mount a loopback device until loop module is present." A simple "modprobe loop" as root could do the trick, but if that fails, you'll probably need to recompile your kernel.
Obviously, YMMV, but hit the reply button with any fixes I need to add.
Last edited by bus.dch on Thu Dec 22, 2005 4:13 am; edited 1 time in total |
|
Back to top |
|
|
bus.dch n00b
Joined: 30 Nov 2005 Posts: 57
|
|
Back to top |
|
|
bus.dch n00b
Joined: 30 Nov 2005 Posts: 57
|
Posted: Sat Dec 03, 2005 12:17 am Post subject: Running the Simulator under Gentoo, option 2 of 2 |
|
|
...
Last edited by bus.dch on Thu Dec 22, 2005 5:08 pm; edited 6 times in total |
|
Back to top |
|
|
sunwukong n00b
Joined: 22 Mar 2004 Posts: 20 Location: Alberta, Canada
|
Posted: Sat Dec 03, 2005 8:07 am Post subject: AMD64 w/ 32 bit chroot |
|
|
I have it working (finally) in a 32 bit chroot on my dual Opteron server. Took a little bit of jumping around and it's still not as convenient as I'd like it but, so far, it seems to work. |
|
Back to top |
|
|
ness01 Tux's lil' helper
Joined: 06 Oct 2004 Posts: 76
|
Posted: Sun Dec 04, 2005 8:55 pm Post subject: |
|
|
Anyone got this working without a chroot? My libspe seems not to work.
My original post in the IBM forum: click _________________ Jedem das seine und allen das selbe - so will es die moderne Demokratie
my blog |
|
Back to top |
|
|
bus.dch n00b
Joined: 30 Nov 2005 Posts: 57
|
Posted: Mon Dec 05, 2005 6:40 pm Post subject: Re: AMD64 w/ 32 bit chroot |
|
|
sunwukong wrote: | in a 32 bit chroot on my dual Opteron |
The simulator is single-threaded, right? (100% CPU on one core only) |
|
Back to top |
|
|
sunwukong n00b
Joined: 22 Mar 2004 Posts: 20 Location: Alberta, Canada
|
Posted: Mon Dec 05, 2005 8:47 pm Post subject: Re: AMD64 w/ 32 bit chroot |
|
|
bus.dch wrote: | sunwukong wrote: | in a 32 bit chroot on my dual Opteron |
The simulator is single-threaded, right? (100% CPU on one core only) |
That's right -- I should've also mentioned that 1) I only have 242s, and 2) the simulator seems to be sluggish but usable on my rig. |
|
Back to top |
|
|
bus.dch n00b
Joined: 30 Nov 2005 Posts: 57
|
Posted: Tue Dec 06, 2005 11:19 pm Post subject: systemsim-cell leeds gcc 3.4.4 |
|
|
The toolchain is based around gcc 3.4.1, but systemsim-cell uses gcc 3.4.4. So, I've patched in gcc 3.4.4. It's building now; once I get the bugs worked out of the patch, it should be usable. |
|
Back to top |
|
|
sunwukong n00b
Joined: 22 Mar 2004 Posts: 20 Location: Alberta, Canada
|
Posted: Wed Dec 07, 2005 3:41 pm Post subject: Re: systemsim-cell leeds gcc 3.4.4 |
|
|
bus.dch wrote: | The toolchain is based around gcc 3.4.1, but systemsim-cell uses gcc 3.4.4. So, I've patched in gcc 3.4.4. It's building now; once I get the bugs worked out of the patch, it should be usable. |
I'm currently running 3.4.4-r1 in the chroot -- even so, I found it necessary to manually install 4.0.2 (and I've added it to my gcc-config profile). |
|
Back to top |
|
|
bus.dch n00b
Joined: 30 Nov 2005 Posts: 57
|
Posted: Wed Dec 07, 2005 10:48 pm Post subject: Re: systemsim-cell needs gcc 3.4.4 |
|
|
sunwukong wrote: | even so, I found it necessary to manually install 4.0.2 |
When did you decide to use 4.0.2? Is 3.4.4 broken? |
|
Back to top |
|
|
sunwukong n00b
Joined: 22 Mar 2004 Posts: 20 Location: Alberta, Canada
|
Posted: Thu Dec 08, 2005 1:53 am Post subject: Re: systemsim-cell needs gcc 3.4.4 |
|
|
bus.dch wrote: | When did you decide to use 4.0.2? Is 3.4.4 broken? |
At least the gentoo package for 3.4.4 didn't build it's stdc++ lib with the 3.4.4 identifier -- so, at a suggestion from another developer who isn't using Fedora either, I manually installed 4.0.2 which does include the required identifier. |
|
Back to top |
|
|
bus.dch n00b
Joined: 30 Nov 2005 Posts: 57
|
Posted: Fri Dec 09, 2005 5:59 am Post subject: Getting the ramdisk working |
|
|
Okay, I'm able to load the kernel in the sim but the ramdisk isn't right. I never actually ran rpm, I just extracted all the files into the sysroot.
Here's what I get, after the kernel boots:
Code: | INIT: version 2.85 booting
/etc/rc.d/rc.sysinit: line 28: /etc/init.d/functions: No such file or directory
Welcome to Fedora Core
Press 'I' to enter interactive startup. |
Seems I'm missing some important files in the sysroot somewhere.
[edit] ness01 pointed out that I'm missing some of the files in the ramdisk.
Last edited by bus.dch on Fri Dec 09, 2005 7:03 pm; edited 1 time in total |
|
Back to top |
|
|
sunwukong n00b
Joined: 22 Mar 2004 Posts: 20 Location: Alberta, Canada
|
Posted: Fri Dec 09, 2005 6:41 am Post subject: Re: Getting the ramdisk working |
|
|
bus.dch wrote: | Seems I'm missing some important files in the sysroot somewhere. |
I caught a few holes in my configuration after redirecting the output of install.sh to a log file -- you should try the same after clearing out your old build.
Just to be a pain: are you sure you have all of the files you need in a complete form?
Finally, for chroot specific setups, the kernel in the chroot /usr/src/linux doesn't have a valid configuration -- I had to provide a plausible one in order to properly compile everything. |
|
Back to top |
|
|
ness01 Tux's lil' helper
Joined: 06 Oct 2004 Posts: 76
|
Posted: Fri Dec 09, 2005 4:56 pm Post subject: |
|
|
you have to overlay your sysroot with "sdk/ramdisk/custom"
btw, anyone an idea on my (new) post in the ibm forum (I don't want to duplicate it here) _________________ Jedem das seine und allen das selbe - so will es die moderne Demokratie
my blog |
|
Back to top |
|
|
bus.dch n00b
Joined: 30 Nov 2005 Posts: 57
|
Posted: Mon Dec 12, 2005 6:52 pm Post subject: libspe |
|
|
For anyone getting started in the code, a good place to start reading is docs/libspe_v1.0.pdf |
|
Back to top |
|
|
bus.dch n00b
Joined: 30 Nov 2005 Posts: 57
|
Posted: Tue Dec 13, 2005 3:12 am Post subject: Install Script |
|
|
...
Last edited by bus.dch on Thu Dec 22, 2005 4:14 am; edited 7 times in total |
|
Back to top |
|
|
bus.dch n00b
Joined: 30 Nov 2005 Posts: 57
|
Posted: Tue Dec 13, 2005 11:47 pm Post subject: Re: IBM Forum |
|
|
ness01 wrote: | btw, anyone an idea on my (new) post in the ibm forum (I don't want to duplicate it here) |
Thanks again for the tip about the missing custom stuff. At the IBM Forum it looks like you got all the benchmarks to run. Is that right? I was going to take a look at that. |
|
Back to top |
|
|
bus.dch n00b
Joined: 30 Nov 2005 Posts: 57
|
Posted: Thu Dec 15, 2005 8:26 pm Post subject: callthru |
|
|
It looks like callthru is not compiled or installed on the ramdisk image I'm using. I may be missing some packages. See this post. |
|
Back to top |
|
|
bus.dch n00b
Joined: 30 Nov 2005 Posts: 57
|
|
Back to top |
|
|
bus.dch n00b
Joined: 30 Nov 2005 Posts: 57
|
Posted: Fri Dec 16, 2005 12:56 am Post subject: rpm inside the sim |
|
|
Ah, but how does a person get rpm working in the simulated environment?
Get the rpm package and its prerequisites from ftp://mirror.linux.duke.edu/pub/fedora/linux/core/4/ppc/os/Fedora/RPMS
Total size: about 4M
beecrypt-4.1.2-8.ppc.rpm
bzip2-libs-1.0.2-16.ppc.rpm
elfutils-libelf-0.108-1.ppc.rpm
expat-1.95.8-6.ppc.rpm
krb5-libs-1.4-3.ppc.rpm
mod_auth_kerb-5.0-6.ppc.rpm
neon-0.24.7-6.ppc.rpm
openssl-0.9.7f-7.ppc.rpm
popt-1.10.1-21.ppc.rpm
rpm-4.4.1-21.ppc.rpm
rpm-libs-4.4.1-21.ppc.rpm
sqlite-3.1.2-3.ppc.rpm
zlib-1.2.2.2-3.ppc.rpm
Add these files to the 'ramdisk' directory created when you ran the script posted above--after it builds everything the first time, it runs much faster the second time.
So, run it again with more rpms in the 'ramdisk' directory. It will complain about having too many rpms, but it will extract everything and build a disk image. That disk image will now have a working /bin/rpm. |
|
Back to top |
|
|
ness01 Tux's lil' helper
Joined: 06 Oct 2004 Posts: 76
|
Posted: Sat Dec 17, 2005 9:36 am Post subject: Re: IBM Forum |
|
|
bus.dch wrote: | ness01 wrote: | btw, anyone an idea on my (new) post in the ibm forum (I don't want to duplicate it here) |
Thanks again for the tip about the missing custom stuff. At the IBM Forum it looks like you got all the benchmarks to run. Is that right? I was going to take a look at that. | yes, I got mostly everything working (sorry for the late reply)
For all those who are interested in running 64 bit progs within the simulator,
install the following rpms in the simulator (these are at least those I used and it seems to work; get them from the fedora site or a mirror. Although they have the suffix ppc64.rpm, you can find 'em in the stable fedora core 4 tree):
glibc-2.3.5-10.ppc64.rpm
libacl-2.2.23-8.ppc64.rpm
libgcc-4.0.0-8.ppc64.rpm
libsepol-1.5.9-2.ppc64.rpm
libtermcap-2.0.8-41.ppc64.rpm
glibc-devel-2.3.5-10.ppc64.rpm
libattr-2.4.16-5.ppc64.rpm
libselinux-1.23.10-2.ppc64.rpm
libstdc++-4.0.0-8.ppc64.rpm
Is anyone working on a/has tested libspe for/in 64 bit env? If not, I'll look at this when my build system is a little more complete than yet. _________________ Jedem das seine und allen das selbe - so will es die moderne Demokratie
my blog |
|
Back to top |
|
|
bus.dch n00b
Joined: 30 Nov 2005 Posts: 57
|
Posted: Mon Dec 19, 2005 7:44 pm Post subject: Turning off the "kilo-inst/sec" spam |
|
|
This tip from the IBM forum is very useful:
Quote: | You can also turn off the "kilo-inst/sec" messages by changing
the format of the output.
The output for this is defined by the kips-format, which can
be reset by:
mysim modify kips_format {n}
n is a bit map saying what you want printed:
1 - ticks
2 - instructions
4 - time
So by setting the format to 0, you get nothing printed:
mysim modify kips_format 0
You can also reset the interval that is used between messages:
modify kips {n}
where n is the number of cycles between messages. Setting this
to zero should suppress the messages, but experimentally, that
doesn't work -- I'll look into why.
Resetting the format to 0 does work to suppress the messages.
This can be either issued by hand, or put in a startup tcl script.
Note that it is "per machine", so you need to create your machine
first and then issue it.
jim |
|
|
Back to top |
|
|
bus.dch n00b
Joined: 30 Nov 2005 Posts: 57
|
Posted: Thu Dec 22, 2005 2:05 am Post subject: Documentation describes "Isolation Facility" |
|
|
The primary documentation for the Cell processor on IBM's website lists an "Isolation Facility" where the SPE loads a digitally-signed executable image in a non-interruptable, non-traceable mode. The SPE has an "authentication and decryption master key," a little reserved memory accessible only in "Isolation Mode," and a random number generator. Sounds like DRM to me.
But the documentation is really sparse. What does anybody think? |
|
Back to top |
|
|
|