Documentation for kernel development?

Documentation for kernel development?

Are there any resources available for those who might wish to recompile the Linux kernel used on the Phi? Are there any tools in MPSS to help us recompile k1om Linux and/or boot it? I'm using MPSS 3.1.2.

I could hopefully hack my way through it, but I would hate to do so having missed some existing instructions or tools which could have made things easier.

5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

The information you want might be in the MPSS readme. Take a look at


This doesn't seem to be the case.

I've managed to rebuild from the sources provided, although I'm not at all confident that I'm using the same kernel configuration or version as the distributed version: the configuration you get (config-mic-knc-2.6.38) when you extract the sources doesn't seem to be up to date with the sources.

Best Reply

The following procedure can be used to recompile the Intel Xeon Phi's kernel; I'll describe it in terms of the upcoming 3.2 release and then how 3.1 diverges so that this response remains useful longer. Assuming that you've installed MPSS (mpss-sdk-k1om-*.x86_64.rpm specifically) and have obtained mpss-src-3.2.tar from the MPSS release site:

tar -xf mpss-src-3.2.tar
tar -xf mpss-3.2/src/linux-2.6.38+mpss3.2.tar.bz2
. /opt/mpss/3.2/environment-setup-k1om-mpss-linux  # [1]
cd linux-2.6.38+mpss3.2/
cp /opt/mpss/3.2/sysroots/k1om-mpss-linux/boot/config- .config  # [2]
make ARCH=k1om CROSS_COMPILE=k1om-mpss-linux-  # [3]

I recommend adding an appropriate amount of parallelism to [3] with e.g. “-j16”, as that significantly reduces how long it takes to complete.

For 3.1, replace [2] with the following (which works equally well on 3.2), since I'm unsure of where a pre-generated file can be found in that version:

MPSS_KCONFIGS="k1om mic-min mic-mpss"
sed -r `echo ${MPSS_KCONFIGS} | sed -e 's:\S\+:arch/x86/configs/&.uconfig:g'` \
    -e '1 i # KCONFIGS: '"${MPSS_KCONFIGS}" \
    -e 's:.*\b(CONFIG_INITRAMFS_SOURCE)\b.*:\1="":' \
    > .config.all
make ARCH=k1om CROSS_COMPILE=k1om-mpss-linux- \
    KCONFIG_ALLCONFIG=.config.all allnoconfig -j1

A final note: while [1] sets up the environment to facilitate cross-building userspace software for Xeon Phi, particularly when that software has not been autotool-ized, the only part that’s actually necessary in order to build the kernel is modifying the PATH environment variable:


Awesome, thanks. This is exactly what I was hoping for and very helpful. Without these instructions I ended up building a kernel with transparent hugepages disabled, which exacerbated my performance issues.

Leave a Comment

Please sign in to add a comment. Not a member? Join today