Keeping my system updated automatically

It is all known that packages are upgraded daily in Ubuntu and Debian world. This is based on how Ubuntu and Debian works, and I personally like it.

The only nuisance is you need to upgrade your system frequently, otherwise you are going to use old package versions, making it difficult to report bugs, and also, being exposed to security vulnerabilities.

There is a solution on how to ask your system to automatically check for new packages, download and install them automatically.

I usually do that on my system. In order to do that, you need to install a package called cron-apt. Cron-apt, by defaul, only downloads packages which means that the actual installation must be done manually.

# apt-get install cron-apt

If you want to be install the packages automatically, you just need to add the upgrade or dist-upgrade line to be executed by the cron-apt. This is how I do this:

# echo dist-upgrade -d -y -o APT::Get::Show-Upgraded=true >> /etc/cron-apt/action.d/3-download

In this example, the system is dist-upgraded every day at 4:00 AM, as showed in the cron-apt cron entry:

$ cat /etc/cron.d/cron-apt

0 4    * * *    root    test -x /usr/sbin/cron-apt && /usr/sbin/cron-apt

Advertisements

Deep Learning on Power

Deep learning is a branch of machine learning based on a set of algorithms that attempt to model high-level abstractions in data by using multiple processing layers, with complex structures or otherwise, composed of multiple non-linear transformations[1].

Power platform is a premier architecture for Deep Learning workloads as showed by University of Maryland Baltimore County, the University of Illinois, and the STFC-Hartree Centre.  These article show that POWER8 is ideal for deep learning, big data, and machine learning due to its high performance, large caches, 2x-3x higher memory bandwidth, very high I/O bandwidth, and of course, tight integration with GPU accelerators.

The OpenPOWER Deep Learning Software Distribution is available for Ubuntu/ppc64el, and  can be downloaded easily.

You can learn more about Deep Learn more about this framework reading Dr. Michael Gschwind article entitled New OpenPOWER Software Distribution Puts Deep Learning a Click Away

Showing register name on assembly

From time to time, I need to generate an assembly code from a C code to see how the compiler is generating stuff.

One of the problems I have is related to the assembly instructions that do not show register name, but just the number, which makes you confused related to literal and register names , as for example, when I generate an assembly for the following instructions, I see:

  • Move value 0 to the register 9
  • Move value of register 9 to register 3

li 9,0
mr 3,9

The problem becomes worse when you mix GPR (General Purpose Register) with VSX registers, as:

lxvd2x 0,10,9

If you do not know the Power Assembly instructions forms quite well, it is hard to map what is a immediate value, what is a GPR and what is a VSR.

If you are facing the same problem, the problem is that GCC has the option -mno-regnames as default.

In this case, I would recommend you using the GCC parameter -mregnames, which will dump registers differently than just the number, as %r for GPR and %vs for VSR registers. The code becomes much more human readable, as

li %r9,0
mr %r3,%r9

lxvd2x %vs0,%r10,%r9

Eclipse based engine for ppc64el programming

IBM Software Development Kit for Linux on Power (IBM-SDK-LOP) is a flavor of the Eclipse IDE customized for ppc64el programming. It allows every developer to create applications for POWER architecture straight from their personal desktops.

It brings the Migration Advisor plugin, created to help port code from x86_64 to ppc64el, Source Code Analyzer, and several profiles from IBM and the community, such as CPI and FDPR.

Users can also take full advantage of the development power of the SDK engine by using the IBM Advance Toolchain compiler, also freely distributed.

In case you want to give them a try, follow the steps described below.

  1. Configure the IBM Advance Toolchain compiler repository by downloading
    and importing the gpg public key:
   $ wget ftp://public.dhe.ibm.com/software/server/iplsdk/v1.9.0/packages/deb/repo/dists/trusty/B346CA20.gpg.key

   $ sudo apt-key add B346CA20.gpg.key

2. Add the following line to /etc/apt/sources.list file:

On amd64:
 deb [arch=amd64] ftp://public.dhe.ibm.com/software/server/iplsdk/v1.9.0/packages/deb/repo trusty sdk

On ppc64el:
 deb ftp://public.dhe.ibm.com/software/server/iplsdk/v1.9.0/packages/deb/repo trusty sdk

3. Update your repos:

   $ sudo apt-get update

4. Install the IBM SDK for Linux on Power:

   $ sudo apt-get install ibm-sdk-lop

How to upgrade to 16.10 from 16.04

Ubuntu 16.04 was just released, but, if you want a newer 16.10 release, you are able to upgrade from 16.04 to the upcoming bleeding edge 16.10.

It is quite easy to upgrade from a next development release, in fact. I just upgraded from a 16.04 to 16.10 running on a POWER8 in less than 20 minutes.

In order to do so, run the following steps:

At first,changes the Prompt line at /etc/update-manager/release-upgrades. It should point to lts, meaning that this distro will only be upgraded when a new LTS is released.

Change it to normal, so, you can get the 16.10 release. That said, the line should be:

Prompt=normal 

Now run the following command:

$ sudo do-release-upgrade -d 

Answer the expected questions, usually with a Y and your system will be rebooted with the 16.10 release.

How to do netboot on PowerVM

In conversations with perspective Linux on POWER clients, we are often asked if Power architecture supports PXE boot. The short answer is “not exactly”, because a true PXE environment has some x86 architecture specific functions/extensions within it.

That said, we do support the same basic functions and underlying protocols as PXE. And now that POWER , beginning with Ubuntu 14.04, has moved to grub2 for a bootloader, the appearance and function are quite similar. In other words, it is functionally equivalent to PXE.

For more information, check the Netbooting on POWER – An Introduction tutorial.

CUDA on ppc64el

Although the supported method to install CUDA drivers and compilers on Power is through directly downloading CUDA from NVIDIA website, you can also download it from the Ubuntu and Debian archive, using the traditional apt method.

The package name is nvidia-cuda-toolkit, and it is available in Debian non-free archive, and in Ubuntu multiverse archive.

Debian unstable

$ apt-cache madison nvidia-cuda-toolkit
 nvidia-cuda-toolkit |   7.5.18-2 | http://ftp.br.debian.org/debian unstable/non-free ppc64el Packages

Ubuntu 16.10

$ apt-cache madison nvidia-cuda-toolkit
nvidia-cuda-toolkit |   7.5.18-2 | http://www.las.ic.unicamp.br/pub/ubuntu-ports yakkety/multiverse ppc64el Packages

 

Want a bleeding edge kernel on your Ubuntu?

If you need a bleeding edge kernel for your Ubuntu, you can install it easily from a pre compiled repository.

Canonical kernel team builds every kernel and make it available publicly, so, if you are not applying any patch, you do not need to build your own kernel.

The best way to get access to these pre-built kernel is using the canonical-kernel-team PPA.

You can install this PPA in your environment as simple as:

$ sudo apt-add-repository ppa:canonical-kernel-team/ppa
 This ppa is used for building pre-release and test kernels.

It IS NOT RECOMMENDED that you subscribe to this PPA.

 More info: https://launchpad.net/~canonical-kernel-team/+archive/ubuntu/ppa
Press [ENTER] to continue or ctrl-c to cancel adding it
gpg: keyring `/tmp/tmpmuquzutb/secring.gpg' created
gpg: keyring `/tmp/tmpmuquzutb/pubring.gpg' created
gpg: requesting key B892ACEA from hkp server keyserver.ubuntu.com
gpg: /tmp/tmpmuquzutb/trustdb.gpg: trustdb created
gpg: key B892ACEA: public key "Launchpad PPA for Canonical Kernel Team" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
OK

Once you have the canonical-kernel-team PPA installed, you are going to have access to all the pre release kernel. Please, remember that you can install untested kernel if you run dist-upgrade now on.

Kernel Mainline PPA

Other than the CKT PPA, you can also download it manually from the mainline PPA, which is, as far as I understand, not a PPA in fact, but a traditional file repository container pre built kernel releases.

It contains all the kernel, including the RC releases, and it is very strictly following the release cycle, as for example, the kernel 4.6 was just released and it is already built and available on this repository.