Wednesday, July 22, 2015

Building Hardware optimized ATLAS on Ubuntu 14.04

The Automatically Tuned Linear Algebra Software (ATLAS) is used by many scientific software packages such as Mathworks Matlab, Julia, Kaldi (speech recognition), and many more. ATLAS can be optimized to the current hardware with a few simple steps, giving much higher performance than the default available packages.

This guide helps you create and install an optimized Debian package on Ubuntu 14.04, but it might work similarly on other GNU Linux distributions. One problem with Ubuntu 14.04 on Intel processors is that it uses a new kernel module called intel_pstate for managing the CPU frequency. This driver will lower the CPU frequency for the idle CPUs (throttling) even if the profile is set to "performance". Unfortunately ATLAS will not build if the CPU frequency is not fixed to the maximum allowed. The workaround is to disable this module in the boot loader (GRUB) temporarily for the build. Here are the steps to follow:

  1. Configure the boot loader to disable the intel_pstate module:
    • edit /etc/default/grub and add the intel_pstate=disable option to the GRUB_CMDLINE_LINUX_DEFAULT variable. In my case the line before and after the change looked like this:
      GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomdmonddf nomdmonisw"
      GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomdmonddf nomdmonisw intel_pstate=disable"
    • make the change active by running:
      sudo grub-mkconfig -o /boot/grub/grub.cfg
    • reboot
  2. run the following commands:
    sudo apt-get source atlas
    sudo apt-get build-dep atlas
    sudo apt-get install devscripts gfortran f2c libcnf-dev
    cd atlas-*/
    sudo fakeroot debian/rules custom
  3. the last step (that can take a long time to finish) will build ATLAS and create a Debian package file one level up. Install the package with:
    sudo dpkg -i ../libatlas3-base_*.deb
  4. restore the /etc/default/grub file to the original, run the sudo grub-mkconfig -o /boot/grub/grub.cfg command and reboot.
This procedure was tested with ATLAS 3.10.1. Hope this works for you as well. Let me know how it goes in the comments.


  1. the building process took between 6 and 7 hours to complete on an Intel(R) Core(TM) i7-4930K CPU @ 3.40GHz.
  2. Although there were 12 such cores, setting the environmental variable DEB_BUILD_OPTIONS=parallel=12 has no effect on the building process or speed
  3. there are 6 deb files generated by the building process:
  4. when installing the libatlas-doc package I got the following errors:
    Processing triggers for doc-base (0.10.5) …
    Processing 3 added doc-base files…
    Error in `/usr/share/doc-base/atlas-install', line 14: all `Format' sections are invalid.
    Error in `/usr/share/doc-base/atlas-devel', line 10: all `Format' sections are invalid.
    Error in `/usr/share/doc-base/atlas-contrib', line 14: all `Format' sections are invalid.
    Note: `install-docs --verbose --check file_name' may give more details about the above errors.


Dhiraj Kumar said...

Fantastic post - Great explainations and thinking.I'm looking forward to what you have for us next..!

privote lai said...

Scontato per l'offerta di prestito rapido e di finanziamento tra particolare essere il promotore del vangelo di Dio nel tuo quartiere
il prestito viene effettuato € 3000 a € 800 mila dollari con un tasso di interesse del 2%
Per maggiori informazioni:

E-mail di contatto:

Build Mitra said...

Thank you for your post. This is excellent information. It is amazing and wonderful to visit your site.
best kitchen sinks providers in Guntur