Installing PyCuda on Gentoo Linux

PyCuda is a relatively new package on Gentoo, and as such is in the testing phase (ie not marked as stable). As of this post there are two ebuilds for pycuda:

  1. Ebuild for v0.92 (the "testing" version)
  2. Ebuild for live git version 9999 (will always be masked)

Once the testing version goes stable, all that will be needed to install PyCuda on Gentoo is:

$ sudo emerge -va pycuda

For now we must unmask one of these ebuilds for PyCuda as shown below.

Unmasking PyCuda

Unmask v0.92

To unmask the latest testing version of PyCuda (as of this post v0.92):

$ sudo echo "dev-python/pycuda" >> /etc/portage/package.keywords
$ sudo echo "dev-python/pytools" >> /etc/portage/package.keywords

If you wish to use the latest version in git then instead of the above:

$ sudo echo "dev-python/pycuda **" >> /etc/portage/package.keywords
$ sudo echo "dev-python/pytools **" >> /etc/portage/package.keywords

This will unmask the "live" ebuild for PyCuda and pull directly from PyCuda's git tree.

Installing PyCuda

To install PyCuda:

$ sudo emerge -va pycuda