From NA-Wiki

Revision as of 13:48, 5 June 2008 by Holst (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This howto describes how to install perfctr and papi and how you can use them to benchmark your codes.

The installation is tested in Ubuntu Hardy 8.04



perfctr kernel patch

First become root, by doing sudo su - in a terminal. Then install and unpack the linux kernel source,

apt-get install linux-source-2.6.24
cd /usr/src
tar xvjf linux-source-2.6.24.tar.bz2 

And then get the perfctr package,

cd /usr/local/src
tar xvzf perfctr-2.6.32.tar.gz

Now we apply the perfctr patch to the kernel source,

cd /usr/src/linux-source-2.6.24
/usr/local/src/perfctr-2.6.32/update-kernel --patch=2.6.24

Now build the kernel with

make oldconfig

and answer the questions as,

 Performance monitoring counters support (PERFCTR) [N/m/y/?] (NEW) m
   Additional internal consistency checks (PERFCTR_DEBUG) [N/y/?] (NEW) n
   Init-time hardware tests (PERFCTR_INIT_TESTS) [N/y/?] (NEW) y
   Virtual performance counters support (PERFCTR_VIRTUAL) [N/y/?] (NEW) y
   Global performance counters support (PERFCTR_GLOBAL) [N/y/?] (NEW) y

Now, build the kernel, and install it

make-kpkg kernel-image --initrd --append-to-version=-perfctr0
dpkg -i /usr/src/linux-image-2.6.24.*-perfctr0-*.deb

Add perfctr to /etc/modules by typing

echo perfctr >> /etc/modules

and make udev rules

echo 'KERNEL=="perfctr",MODE="0666"' > /etc/udev/rules.d/20-perfctr.rules

module assistant

Because we have compiled our own kernel, we need to rebuild the following drivers ourself.

m-a a-i -l nvidia-new-kernel
m-a a-i -l alsa
m-a a-i -l openafs

and replace the Xorg drivers as well,

apt-get install nvidia-glx-new nvidia-glx-new-dev

Since we have compiled our own nvidia new driver which isn't labeled "nvidia_new", we need to add an alias for it,

echo alias nvidia_new nvidia >> /etc/modprobe.d/aliases

Warning! You might need to rebuild additional modules!

Now you must reboot into your new kernel for the final step.


Final step, installing Papi. Again, become root and type,

cd /usr/local/src
tar xvzf papi-3.6.0.tar.gz
cd papi-3.6.0/src
make fulltest

Lets hope everything PASS! and then,

make install-all

Disclaimer: This howto is shameless stolen from We thank them very, very much for providing such excellent howtos!


To be written.

Personal tools