Cell/BE: make use of the SPEs under Linux - linux

Currently I'm experimenting with the Cell/BE CPU under Linux. What I'm trying to do is running simulations in the near future, e.g. about the weather or black holes.
Problem is, Linux only discovers the main CPU of the Cell (the PPE), all other SPUs (7 should be available to Linux) are "sleeping". They just don't work out of the box.
What works is the PPE and it's recognized as a two-threaded CPU with one core by the OS. Also, the SPEs are shown at every boot (with small penguins showing a red "PPE" in them), but afterwards are shown nowhere.
Is it possible to "free" these specialised cores for use by the Linux OS? If so, how?

As noone seems to be interested or can answer this question I'll provide the details myself.
In fact there exists a workaround:
First, create an entry point for the SPUFS:
# sudo mkdir /spu
Create a mount point for the filesystem so you won’t have to manually mount after a reboot. Add this line to /etc/fstab
spufs /spu spufs defaults 0 0
Now reboot and test to make sure the SPUFS is mounted (in a terminal):
spu-top
You should see the 7 SPEs running with 0% load average.
Now Google for the following package to get the runtime library and headers you need for SPE development:
libspe2-2.3.0.135.tar.gz
You should find it on the first hit. Just unpack, build, and install it:
./configure
make
sudo make install
You can ignore the build warnings (or fix them if you have obsessive compulsive disorder).
You can use pkg-config to find the location of the runtime and headers though they are in /usr/local if I recall.
You of course need the gcc-spe compiler and the rest of the PPU and SPU toolchains but those you can install with apt-get as they are in the repos.
Source: comment by Exillis via redribbongnulinux.000webhostapp.com

Related

Cannot get custom kernel to boot - mkinitpcio does not add any modules

1. What I am trying to achieve:
Build a custom kernel so I can install and run Anbox-git from AUR on my Arch laptop. Custom kernel is needed for the package to work.
2. What I did to achieve it:
Download Arch Linux kernel v5.8.5-arch1 from here
I followed the guidelines on tradional compilation Arch wiki to create the custom kernel
Via make nconfig I applied the changes mentioned in the Anbox Arch wiki page.
Via make nconfig I changed EFIVAR_FS option from "M" to "*" to resolve an error from earlier attemps.
Via make nconfig under Location: -> Device Drivers-> Multiple devices driver support (RAID and LVM) (MD [=y])-> Device mapper support (BLK_DEV_DM [=y]) I added a few more options (*) because on earlier builds mkinitpcio gave errors for missing modules for DM_CRYPT, and some more DM_ modules which I cannot easily reproduce (will do if necessary for the answer, but I hope it'll be irrelevant).
After creating the config this way I did:
sudo make modules_install
sudo cp -v arch/x86_64/boot/bzImage /boot/vmlinuz-linux58ac
sudo cp /etc/mkinitcpio.d/linux.preset /etc/mkinitcpio.d/linux58ac.preset
Adapted the preset file per Arch wiki instructions
sudo mkinitcpio -p linux58ac
Important: The mkinitpcio runs fine, but keeps giving me a warning:
WARNING: No modules were added to the image. This is probably not what
you want.
sudo grub-mkconfig -o /boot/grub/grub.cfg
3. Expected result:
I am able to reboot, select the new kernel from grub menu, get the usual LVM password prompt, and launch into it without problems.
4. Result I get:
I can reboot and select new kernel from grub but when I select it I get a
Warning: /lib/modules/5.8.5-arch1/modules.devname not found, ignoring.
Starting version 246.4-1-arch
ERROR device 'dev/mapper/vg0-root' not found. Skipping fsck.
mount /new_root: special device /dev/mapper/vg0-root does not exist.
You are being dropped into an emergy shell.
I checked and the /lib/modules/5.8.5-arch1/modules.devnamedoes indeed exist. But I think the actual problem is that mkinitcpio doesn't load the correct modules into the custom kernel, causing it to become unbootable.
Any help appreciated!

How does "biosdevname" really work?

I know the purpose of "biosdevname" feature in Linux, but I'm not sure how
exactly it works.
I tested it with Ubuntu 14.04 and Ubuntu 14.10 (both 64-bit server editions)
and it looks like they enable it by default - right after system startup my
network interface has a name such as p4p1 instead of eth0, no customization
is needed. As I understood it, in order for biosdevname to be enabled, BOTH
of these two conditions must be met:
a boot option biosdevname=1 must be passed to a kernel
biosdevname package must be installed
As I already mentioned, both Ubuntu 14.04 and 14.10 seem to offer biosdevname
as a default feature: they come with biosdevname package already installed, I
didn't need to modify grub.cfg either - GRUB_CMDLINE_LINUX_DEFAULT has no
parameters and my network interface still has a BIOS name (p*p*) instead of a
kernel name (eth*.)
Later I wanted to restore the old style device naming and that's where the
interesting part begins. I decided to experiment a bit while trying to disable
the biosdevname feature. Since it requires biosdevname package to work (or
so I read here and there), I assumed removing it would be enough to disable the
feature, so I typed:
sudo apt-get purge biosdevname
To my surprise, after reboot my network interface was still p4p1, so
biosdevname clearly still worked even though biosdevname package had been
wiped out.
As a next step, I applied appropriate changes to /etc/network/interfaces in
order to restore the old name of my network interface (removed entry for p4p1
and added entry for eth0). As a result, after another reboot, ifconfig
reported neither eth0 nor p4p1 which was another proof that OS still
understood BIOS names instead of kernel names.
It turned out that I also had to explicitly change GRUB entry to
GRUB_CMDLINE_LINUX_DEFAULT=biosdevname=0 and update GRUB to get the expected
result (biosdevname disabled and old name of network interface restored).
My question is: how could biosdevname work without biosdevname package? Is
it not required after all? If so, what exactly provides the biosdevname
functionality and how does it work?
The reason biosdevname keeps annoying you even after you uninstall the package, is that it installed itself in the initrd 'initial ramdisk' file as well.
When uninstalling, the /usr/share/initramfs-tools/hooks/biosdevname is removed, but there is no postrm script in the package so update-initramfs is not executed and biosdevname is still present in the /boot/initrd... file used in the first stage of system startup.
You can fully get rid of it like this:
$ sudo update-initramfs -u

xen install on centos, getting invalid magic number 9090

I am trying to install Xen on Centos6.5 based on this tutorial (http://wiki.centos.org/HowTos/Xen/Xen4QuickStart), however after installing xen and running the script to edit the grub.conf, i am not able to boot into the new kernel.
I get an error stating -
invalid magic number: 9090
Error 13: Invalid or unsupported executable format
Can someone help me please?
Current suspicion: http://wiki.centos.org/HowTos/Xen/Xen4QuickStart definitely not a 10 minute install for all platforms???
History: there is a Centos Bug on this: centos.org/print_bug_page.php?bug_id=6503
I repeated a similar process:
(1) Install Centos 6.6 (Centos kernel: 2.6.32-504.el6.x86_84) from DVD1, DVD2 with Install using only the CENTOS Repo
(2) Installed Xen (Xen4CentOS kernel:3.10.56-11.el6.centos.alt.X86_64) Issuing the following commands from the centos command line (as root, warnings from readers accepted as correct from a security standpoint) To abate the security concern, no network connection existed as an offline repo would have been used but was not actually needed for the Centos minimal install.
yum install centos-release-xen
yum install xen
/usr/bin/grub-bootxen.sh
from the Xen/Centos reference: http://wiki.centos.org/HowTos/Xen/Xen4QuickStart
I noticed that the /boot/grub/grub.conf file was non-existent and tried to reboot without it. The reference above suggests it should be there, so I am proposing that your grub.conf file was missing or incorrect because my results were similar:
'invalid magic number: 9090
Error 13: Invalid or unsupported executable format
Press any key to continue...'
So as of now I can reproduce the problem. I will be updating this as I discover what will solve it for my solution, post it with hope it fixes it for yours or others who share similar issues.
I noticed something odd, I was using a Combo USB hub and tried to reboot using the other kernel (2.6) and there were considerable failures which were squawking on the startup screen and it would not permit me to start. When I removed it I could not boot into the 3.10, but only into 2.6.
Ok, a quick find on grub.conf revealed a similar version to that shown on the reference link above in /etc. So I copied the grub.conf from /etc to /boot/grub and rebooted. But I too see similar results. The USB hub is off the system and will not be reattached, so there is something else here that needs review. I'm digging into the grub.conf file at this time...
(update) I see that there is a grub.conf file under /boot/efi/EFI/redhat. Oddly in the Centos 'bug archives' there appears to be a related resolved bug for Centos 7: bugs.centos.org/view.php?id=7242 (cannot post this as a link as my reputation is less than 10, my apologies)
Also, as this relates to magic number here are results for my type of files and magic numbers, but I have done this with vi and have some assumptions here about what I saw, so I am retrying this with the help of the other stackoverflow article which uses file-devel package LibMagic... here are the intermittent results.
File.x86_64 Magic number (if two bytes, just use first 2)
vmlinuz-2.6.32.504.el6.x86_64 /0x8c/0x8e/0x8e/0x8e
vmlinuz-3.10.56-11.el6.centos.alt.x86_64 /0x8c/0x8e/0x8e/0x8e
Note: A search of '9090' on centos.org using the provided search engine for words on the site yielded no response on 12/22/14: #wiki.centos.org/Search
There is no mention of installation problems with SELinux, even though I have set:
SELINUX=disabled
in the /etc/sysconfig/selinux file and
yum uninstall xen
yum install xen
/usr/bin/grub-bootxen.sh
No results, and no new grub file in any of the three locations listed above. /etc /boot or /boot/efi/EFI/redhat.
Comparison of the grub.conf files with other sources, show that it is reasonable. Same for the grub-bootxen.sh file based on what I could decipher from bash.
Changing the timeout in grub.conf (all I found) to 15 and removing the hiddenmenu command by #hiddenmenu, did not eliminate the '9090' error. Using: wiki.xen.org/wiki/RHEL6_Xen4_Tutorial which shows the 'kernel' modifier instead of the 'module' and changing the 'module' in front of the .img file to initrd, did not change the results.
OK. Reload.
1) reinstall minmum Centos
2) disable SE Linux
3) reboot
4) correct ifcfg-eth0 (remove NM and allow boot on startup) and service network restart
5) yum import centos-release-xen (accept import of GPG key)
6) yum install xen
7) investigate what occurs with "grub-install hd0" which produces '9090' error!
Ok, I would have to say that the question was not well defined. It is now well defined and can be posed as a question. I will convert this info and my trials to a reasonable question to see if anyone can assist with pointers...

Different environment when running sudo as root?

I'm trying to install the Xeon Phi coprocessor. The specific behavior is probably related to the tools involved - my question is of a more general nature.
When I execute a command as root, I get a segmentation fault. When I execute it as root but (in my opinion unnecessarily) use sudo, it works:
i72:~ # whoami
root
i72:~ # micctrl -s
Segmentation fault
i72:~ # sudo micctrl -s
[no segfault]
What differences are there in the environments micctrl is being run in?
(Edit:) I think we ruled out environment variables as an option below.
The system is a SLES 11.2.
Thank you!
sudo removes LD_LIBRARY_PATH, LD_PRELOAD from the environment (I suspect it does it for root as well as ordinary users).
This may cause different libraries to be loaded for the program.
sudo can be configured on what variables it resets/clears - see http://brandonhutchinson.com/wiki/Sudo_and_environment_variables
Turns out that sudo just hides the "Segmentation fault" message. It still happens, but doesn't get displayed on the terminal. We found out because micctrl never gave us any output, even when it should have.
Edit: Also, if someone should run into the problem with micctrl: In our case, the Phi was not properly recognized by the system. lspci found it, but it was not listed in /sys/class/mic.

How to set up MIT Scheme for 6.001 in Ubuntu 8.10

I play to self-study 6.001 with the video lectures and lecture handouts. However, I have some problems setting up MIT Scheme in Ubuntu (intrepid).
I used package management and installed MIT-Scheme, but it's obviously the wrong version to use. It should be 7.5.1 instead of 7.7.90
I followed the instructions from this website (http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Computer-Science/6-001Spring-2005/Tools/detail/linuxinstall.htm)
So far, I've downloaded the tar file, and extracted to /usr/local. I have no idea what step 3 means.
Then I entered command
scheme -large -band 6001.com -edit
and the error is
Not enough memory for this configuration.
I tried to run under sudo mode, and this time the error is different
Unable to allocate process table.
Inconsistency detected
I have close to 1GB of free memory, with ample HDD space. What should I do to successfully set this up?
Step 3 means that you should type export MITSCHEME_6001_DIRECTORY=${your_problems_path}. If you don't want to type it every time you launch Scheme, you should put it as a string in your ~/.bash_profile file(in case you use bash)
About the problem itself, Google instantly suggests a solution:
sudo sysctl -w vm.mmap_min_addr=0(taken from http://ubuntuforums.org/showthread.php?p=4868292)
Instead of the package manager, you may also want to compile the portable C sources for Unix. I am using it happily.

Resources