Skip to content

Commit

Permalink
docs: add debian installation guide
Browse files Browse the repository at this point in the history
  • Loading branch information
cdluminate committed Dec 21, 2016
1 parent 5a201dd commit b55fe84
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 0 deletions.
105 changes: 105 additions & 0 deletions docs/install_apt_debian.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
---
title: "Installation: Debian"
---

# Debian Installation

Caffe packages are available for `Debian/unstable`. Debian/stable users
should take a look at Ubuntu installation instruction.

Only experienced linux users are recommended to try Debian/unstable (Sid).

Last update: Dec.21 2016

## Debian/unstable

Apart from the installation methods based on source, Debian/unstable
users can install pre-compiled Caffe packages via the official archive.

### Binary installation

Make sure that there is something like the follows in your `/etc/apt/sources.list`:
```
deb http://ftp2.cn.debian.org/debian sid main contrib non-free
```
Then we update APT cache and directly install Caffe. Note, the cpu version and
the cuda version cannot be installed at the same time.
```
# apt update
# apt install [ caffe-cpu | caffe-cuda ]
```
It should work out of box.

#### Customizing caffe packages

Some users may need to customize the Caffe package. Here is a brief
guide of producing the customized `.deb` packages.

Make sure that there is something like this in your `/etc/apt/sources.list`:
```
deb http://ftp2.cn.debian.org/debian sid main contrib non-free
deb-src http://ftp2.cn.debian.org/debian sid main contrib non-free
```

Then we build caffe deb files with the following commands:
```
$ sudo apt update
$ sudo apt install build-essential debhelper devscripts # standard package building tools
$ sudo apt build-dep [ caffe-cpu | caffe-cuda ] # the most elegant way to pull caffe build dependencies
$ apt source [ caffe-cpu | caffe-cuda ] # download the source tarball and extract
$ cd caffe-XXXX
[ ... optional, customize caffe code/build ... ]
$ debuild -B -j4 # build caffe with 4 parallel jobs (similar to make -j4)
[ ... building ...]
$ debc # optional, if you want to check the package contents
$ sudo debi # optional, install the generated packages
```
The resulting deb packages can be found under the parent directory of the source tree.

### Source installation

Source installation under Debian/unstable is similar to that of Ubuntu, but
here is a more elegant way to pull caffe build dependencies:
```
$ sudo apt build-dep [ caffe-cpu | caffe-cuda ]
```
Note, this requires a `deb-src` entry in your `/etc/apt/sources.list`.

### Notes

* Consider re-compiling OpenBLAS locally with optimization flags for sake of
performance. This is highly recommended if you are writing a paper.

* If you are installing `caffe-cuda`, APT will automatically pull some of the
CUDA packages and the nvidia driver packages. Please take care if you have
manually installed or hacked nvidia driver or CUDA toolkit or any other
related stuff, because in this case it may fail.

* If you encountered any problem when installing `caffe-*`, please report bug
to Debian via Debian's bug tracking system. See https://www.debian.org/Bugs/ .

* Additionally, a manpage (`man caffe`) and a bash complementation script
(`caffe <TAB><TAB>`, `caffe train <TAB><TAB>`) are provided.
Both of the two files are still not merged into caffe master.

* The python interface is Python 3 version: `python3-caffe-{cpu,cuda}`.
No plan to support python2.

## FAQ

* where is caffe-cudnn?

CUDNN library seems not redistributable currently. If you really want the
caffe-cudnn deb packages, the workaround is to install cudnn by yourself,
and hack the packaging scripts, then build your customized package.

* I installed the CPU version, How can I switch to the CUDA version?

`sudo apt install caffe-cuda`, apt's dependency resolver is smart enough to deal with this.

* Where is the examples, the models and other documentation stuff?

```
sudo apt install caffe-doc
dpkg -L caffe-doc
```
1 change: 1 addition & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ The official Makefile and `Makefile.config` build are complemented by a [communi

- [Docker setup](https://github.com/BVLC/caffe/tree/master/docker) *out-of-the-box brewing*
- [Ubuntu installation](install_apt.html) *the standard platform*
- [Debian installation](install_apt_debian.html) *deploy caffe with a single command*
- [OS X installation](install_osx.html)
- [RHEL / CentOS / Fedora installation](install_yum.html)
- [Windows](https://github.com/BVLC/caffe/tree/windows) *see the Windows branch led by Guillaume Dumont*
Expand Down

0 comments on commit b55fe84

Please sign in to comment.