Caffe: Difference between revisions

From UMIACS
Jump to navigation Jump to search
No edit summary
No edit summary
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
[https://caffe.berkeleyvision.org/ Caffe] is a deep learning framework.


==Cuda + cuDNN==
==Cuda + cuDNN==
On machines running RHEL7 and the nvidia driver installed you can build Caffe with Cuda and cuDNN. This has been tested as of Nov 12th 2015 commit 19028e7975fa464ce6835d513a25111e6aedda47.
On machines with GPUs and the NVIDIA driver installed, you can build Caffe with [[CUDA]] and cuDNN. Please note that there may be newer versions of CUDA and cuDNN available in the [[Modules | module tree]] than the listed ones below.


Run <code>nvidia-smi -L</code> to verify the NVIDIA driver is installed and can see your GPUs:
<pre>
<pre>
$ nvidia-smi -L
$ nvidia-smi -L
GPU 0: GeForce GTX TITAN X (UUID: GPU-dd20c890-3d0f-942f-6e85-7b43c6bd03c5)
GPU 0: GeForce GTX TITAN X (UUID: GPU-dd20c890-3d0f-942f-6e85-7b43c6bd03c5)
GPU 1: GeForce GTX TITAN X (UUID: GPU-b1d93efa-3d89-bb58-d4cb-b517ead36b27)
GPU 1: GeForce GTX TITAN X (UUID: GPU-b1d93efa-3d89-bb58-d4cb-b517ead36b27)
GPU 2: NVS 310 (UUID: GPU-3c199b93-5899-ba43-bbe3-870a98f76457)
</pre>
</pre>


To build caffe follow these instructions.
Add the modules, clone the Caffe repository, configure the Makefile options, and build.
<pre>
<pre>
module add cuda/7.5.18 cudnn/v3
$ module add cuda/8.0.44 cudnn/v5.1
git clone https://github.com/BVLC/caffe.git  
$ git clone https://github.com/BVLC/caffe.git
cd caffe
Cloning into 'caffe'...
cp Makefile.config.example Makefile.config
remote: Counting objects: 37328, done.
# set the following options in a Makefile.config
remote: Compressing objects: 100% (11/11), done.
#  !!! Make sure there are no trailing whitespace after these options
remote: Total 37328 (delta 11), reused 7 (delta 7), pack-reused 37310
# CUDNN := 1
Receiving objects: 100% (37328/37328), 47.48 MiB | 17.52 MiB/s, done.
Resolving deltas: 100% (24927/24927), done.
$ cd caffe/
$ cp Makefile.config.example Makefile.config
 
# Set the following options in Makefile.config (uncomment). Make sure there are no trailing whitespace after these options.
# USE_CUDNN := 1
# BLAS := open
# BLAS := open
# CUDA_DIR := /opt/common/cuda/cuda-7.5.18/
# CUDA_DIR := /opt/common/cuda/cuda-8.0.44/
make  
 
make test  
$ make
make runtest
...
$ make test
...
</pre>
 
===Matlab===
If you need to use then please use Matlab 2015a and make sure you do the following commands in addition to what is above.  Currently Matlab 2015a only supports GCC 4.7.x for compiling mex files.
 
<pre>
module add matlab/2015a gcc/4.7.4
make matcaffe
</pre>
</pre>


== CPU Only ==
==CPU Only==
To build caffe follow these instructions.
To build Caffe with CPU-only capability, follow these instructions.
<pre>
<pre>
git clone https://github.com/BVLC/caffe.git  
git clone https://github.com/BVLC/caffe.git  

Latest revision as of 15:42, 12 January 2023

Caffe is a deep learning framework.

Cuda + cuDNN

On machines with GPUs and the NVIDIA driver installed, you can build Caffe with CUDA and cuDNN. Please note that there may be newer versions of CUDA and cuDNN available in the module tree than the listed ones below.

Run nvidia-smi -L to verify the NVIDIA driver is installed and can see your GPUs:

$ nvidia-smi -L
GPU 0: GeForce GTX TITAN X (UUID: GPU-dd20c890-3d0f-942f-6e85-7b43c6bd03c5)
GPU 1: GeForce GTX TITAN X (UUID: GPU-b1d93efa-3d89-bb58-d4cb-b517ead36b27)

Add the modules, clone the Caffe repository, configure the Makefile options, and build.

$ module add cuda/8.0.44 cudnn/v5.1
$ git clone https://github.com/BVLC/caffe.git
Cloning into 'caffe'...
remote: Counting objects: 37328, done.
remote: Compressing objects: 100% (11/11), done.
remote: Total 37328 (delta 11), reused 7 (delta 7), pack-reused 37310
Receiving objects: 100% (37328/37328), 47.48 MiB | 17.52 MiB/s, done.
Resolving deltas: 100% (24927/24927), done.
$ cd caffe/
$ cp Makefile.config.example Makefile.config

# Set the following options in Makefile.config (uncomment). Make sure there are no trailing whitespace after these options.
# USE_CUDNN := 1
# BLAS := open
# CUDA_DIR := /opt/common/cuda/cuda-8.0.44/

$ make
...
$ make test
...

Matlab

If you need to use then please use Matlab 2015a and make sure you do the following commands in addition to what is above. Currently Matlab 2015a only supports GCC 4.7.x for compiling mex files.

module add matlab/2015a gcc/4.7.4
make matcaffe

CPU Only

To build Caffe with CPU-only capability, follow these instructions.

git clone https://github.com/BVLC/caffe.git 
cd caffe
cp Makefile.config.example Makefile.config
# set the following options in a Makefile.config 
# CPUONLY := 1 
# BLAS := open 
make 
make test 
make runtest