3

My problem is similar to this one, E: Unable to locate package caffe-cuda, but I will try to give more details.

I used the folowing command to install caffe-cuda:

sudo apt install caffe-cuda

and got the error:

E: Unable to locate package caffe-cuda

So I tried apt-cache search caffe and got this:

caffe-cpu - Fast, open framework for Deep Learning (Meta)
caffe-doc - Caffe's doxygen docs and examples
caffe-tools-cpu - Tools for fast, open framework for Deep Learning (CPU_ONLY)
caffeine - prevent the desktop becoming idle in full-screen mode
git-cola - highly caffeinated git GUI
gnome-shell-extension-caffeine - GNOME Shell extension to keep your computer awake
libcaffe-cpu-dev - development files for Caffe (CPU_ONLY)
libcaffe-cpu1 - library of Caffe, deep learning framework (CPU_ONLY)
libcaffeine-java - High performance caching library
libdeepboof-java - Java library for running deep neural networks
python3-caffe-cpu - Python3 interface of Caffe (CPU_ONLY)
python3-theano - CPU/GPU math expression compiler for Python 3
ttf-aenigma - 465 free TrueType fonts by Brian Kent

Why is there no caffe-cuda here? Can anyone suggest a solution?

Here is my sources.list:

deb http://archive.ubuntu.com/ubuntu focal main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu focal main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu focal-security main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu focal-security main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu focal-updates main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu focal-updates main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu focal-proposed main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu focal-proposed main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse

chwe
  • 33
  • 1
  • 5

3 Answers3

3

Ignore my last comment. The reason why you cannot install caffe-cuda, is because it doesn’t exist (not in Ubuntu’s official repo anyway).

  • But it does exist in Ubuntu 18.04: https://packages.ubuntu.com/search?suite=all&searchon=names&keywords=caffe-cuda. So if I want to install it, then I can only change the system version? – chwe Apr 06 '21 at 04:09
3

I checked the original source and it seems you can install caffe with

sudo apt install caffe-cuda

or

sudo apt install caffe-cpu

As per https://packages.ubuntu.com/, it also gives the same information about both packages:

Package caffe-cuda

  • bionic (18.04LTS) (metapackages): Fast, open framework for Deep Learning (Meta) [multiverse]
    1.0.0-6build1: amd64 ppc64el

Package caffe-cpu

  • bionic (18.04LTS) (metapackages): Fast, open framework for Deep Learning (Meta) [universe]
    1.0.0-6: amd64 arm64 i386 ppc64el s390x

  • focal (20.04LTS) (metapackages): Fast, open framework for Deep Learning (Meta) [universe]
    1.0.0+git20180821.99bd997-5build3: amd64 arm64 armhf ppc64el s390x

So it seems to me that on Ubuntu 20.04 you should use caffe-cpu, unless there is some specific reason you want to use caffe-cuda.

In that case, you can try to add the repository for Ubuntu 18.04. Just copy the repos you have in your sources.list and append them at the end of the file. Then substitute focal with bionic in these entries.

Or maybe it is better to download the .deb file from here: https://packages.ubuntu.com/bionic/amd64/caffe-cuda/download and install it with:

dpkg -i <package_name>
1

The reason that caffe-cuda is not supported in Ubuntu 20.04 is hinted at in

https://github.com/BVLC/caffe/issues/6993

Basically, caffe-cuda depends on cudnn API methods that were dropped in / by cudnn 8.0. The caffe-cuda codebase has basically been left behind ... by NVidia.

It is apparently possible to get caffe-cuda to work on Ubuntu 20.04. However, it is long and complicated procedure. There is a article on how to do it here:

I noticed that the article seems to contradict itself. At the start it tells you how to download and install cudnn 7.6.5, but towards the end it seems to say that this causes dependency problems. Read it carefully, and make up your own mind.


My recommendation would be to take the easy path and use caffe-cpu. Or look for an alternative to Caffe.

Stephen C
  • 190