Menu

Guide

Antonio Barbalace

Requirements

The following guide assumes a running CentOS Linux installation on a Intel Xeon machine with a plugged Intel Xeon Phi.

Pre mpss-vt Installation

Make sure your MIC co-processor software environment is safe and functional. Furthermore you want that the cross-compilation tools are installed. The cross-compilation tools are the compilers that produce code for the co-processor but that you run on the host, i.e. in this way you can write, develop and compile an application on the host and move that for execution on the MIC co-processor. The cross-compiler tools has usually the following prefix: k1om-mpss-linux-. Make sure the cross-compilation tools are exported in the PATH environment variable (the following should work).

# export PATH=/opt/mpss/3.2/sysroots/x86_64-mpsssdk-linux/usr/bin:/opt/mpss/3.2/sysroots/x86_64-mpsssdk-linux/usr/bin/k1om-mpss-linux:$PATH

Stop MPSS

In order to proceed with an upgrade it's a good practice to stop the current MPSS software running on your system.

# sudo service mpss stop

Upgrading the Linux Kernel

Download the latest kernel version from the git repository, configure it by using the latest configuration options (in this case please skip the line starting with # cp) or one of the other available config-mic-knc- in the kernel root directory. Then compile it.

# git clone git://git.code.sf.net/p/mpssvt/linux mpssvt-linux
# cd mpssvt-linux
# cp config-mic-knc-3.2.14 .config
# make ARCH=k1om oldconfig
# make ARCH=k1om CROSS_COMPILE=k1om-mpss-linux- KBUILD_NOPEDANTIC=1 bzImage

As common practice, please add -j N at the end of the last line in order to speed up the compilation. Example, where the parallelism factor is 8 (N=8):

#  make ARCH=k1om CROSS_COMPILE=k1om-mpss-linux- KBUILD_NOPEDANTIC=1 -j 8 bzImage

To install the kernel image please use the script mpss_install_bzImage.sh available in the kernel root directory. This script assumes a standard MPSS 3.2 installation in order to work (i.e. please modify the script according to your installation).

# ./mpss_install_bzImage.sh

In order to tell the MPSS that we would like to use this new kernel instead of the previous one we should update the MIC co-processor configuration; hereafter we assume we would like to update mic0. Open /etc/mpss/mic0.conf with your favorite editor and identify the following lines:

# MIC OS image
OSimage /usr/share/mpss/boot/bzImage-knightscorner /usr/share/mpss/boot/System.map-knightscorner

they must be modified in:

# MIC OS image
OSimage /usr/share/mpss/boot/bzImage-3.2.14+mpss3.2-knightscorner /usr/share/mpss/boot/System.map-3.2.14+mpss3.2-knightscorner

at this point save the file. (The script we run above already copied the bzImage and System.map in /usr/share/mpss/boot/ for us).

Upgrading the Modules

Download the latest Modules version from the git repository, compile and install it. In this case there is no configuration step. The following assumes that the Linux kernel directory is contained in the same folder as the Modules directory. (Remember to exit mpssvt-linux directory first.)

# cd ..
# git clone git://git.code.sf.net/p/mpssvt/modules mpssvt-modules
# cd mpssvt-modules
# make MIC_CARD_ARCH=k1om KDIR=`pwd`/../mpssvt-linux/ all
# sudo make MIC_CARD_ARCH=k1om KDIR=`pwd`/../mpssvt-linux/ DESTDIR=/var/mpss/mic0/ modules_install

The above commands provide for installation in the default /var/mpss/mic0/ folder. Please change it accordingly to your setup.

In order for this changes to take effect please use the script mpss_base_cpio.sh in the mpssvt-linux directory. Again, this script assumes a standard MPSS 3.2 installation in order to work (i.e. please modify the script according to your installation).

# cd ../mpssvt-linux
# ./mpss_base_cpio.sh install

This step should conclude the installation.

Upgrading the CPIO

This step is optional and should be considered only if after restarting the MPSS, during the next step, the MIC is not able to boot (i.e. restarting failure).

Download the latest base image from the repository and copy it in the default images location.

# cd ..
# wget http://sourceforge.net/projects/mpssvt/files/initramfs-3.2.14%2Bmpss3.2.cpio.gz/download
# cp initramfs-3.2.14+mpss3.2.cpio.gz /usr/share/mpss/boot/

In order to tell the MPSS that we would like to use this new base CPIO image instead of the previous one we should update the MIC co-processor configuration. Open /etc/mpss/mic0.conf with your favorite editor and identify the following line:

Base CPIO /usr/share/mpss/boot/initramfs-knightscorner.cpio.gz

it should be modified in:

Base CPIO /usr/share/mpss/boot/initramfs-3.2.14+mpss3.2.cpio.gz

at this point we should re-run the script mpss_base_cpio.sh in order to update the final image loaded on the MIC co-processor.

# cd ../mpssvt-linux
# ./mpss_base_cpio.sh install

Restarting MPSS

We now have to restart the MPSS in order for the changes we made to take effect and exploit the advantages of having a newer Linux version on Xeon Phi.

# sudo service mpss start

Debugging

The MPSS offers different way to debug what is going on the Xeon Phi. Most of the information can be read at the following url:

Collecting Debug Data When Running With Intel Xeon Phi Coprocessor

A dmesg dump of a mic is available throught

# cat /sys/kernel/debug/mic_debug/mic0/log_buf

If this file entry is not present, debugfs should be mounted (or it is mounted somewhere else). To mount it

# sudo mount -t debugfs none /sys/kernel/debug

This works by fetching __log_buf and log_buf_len from the loaded System.map, these two parameters can be read from:

# cat /sys/class/mic/mic0/log_buf_addr
# cat /sys/class/mic/mic0/log_buf_len

respectively. By echoing a value the parameters can be changed.

A console, hypervisor style type, i.e. HVC, is available. It is not clear why this console do not work until a complete boot (is it compiled as a module or user space program?!). To access the console, use /dev/ttyMIC0, and minicom without initialization (-s allow you to configure it):

# minicom -so

Another tool, called micrasd, i.e. a daemon can be used in maintenence mode in order to receive messages from the scif module when loaded. Use the following command:

# micrasd -maint

Related

Wiki: Home