can't compile the caffe in ubuntu 14.04

3,365 views
Skip to first unread message

xi sizhe

unread,
Dec 9, 2014, 5:01:32 PM12/9/14
to caffe...@googlegroups.com
My CUDA is version 5.5 and ubuntu version 14.04, and I have all the prerequisites I need, I have also install g++ 4.6. I have git clone the lastest caffe code.

Here is my Makefile.config
    USE_CUDNN := 1
    CUSTOM_CXX := g++
    CUDA_DIR := /usr
    CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \
                -gencode arch=compute_20,code=sm_21 \
                -gencode arch=compute_30,code=sm_30 \
                -gencode arch=compute_35,code=sm_35 \
    BLAS := atlas
    PYTHON_LIB := /usr/lib
    INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
    LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib
    DISTRIBUTE_DIR := distribute
    DEBUG := 1
    TEST_GPUID := 0

In my Makefile.
I have updated 

ifeq ($(LINUX), 1)
        CXX ?= /usr/bin/g++
to 

ifeq ($(LINUX), 1)
        CXX ?= /usr/bin/g++-4.6

But when I compile with make
 I got a error,

./include/caffe/util/cudnn.hpp:5:19: fatal error: cudnn.h: No such file or directory
 #include <cudnn.h>

and when I compile with cmake
I got a error

nvcc fatal   : Unsupported gpu architecture 'compute_50'
CMake Error at caffe_cu_generated_im2col.cu.o.cmake:206 (message):
  Error generating
  /home/sizhexi/caffe/build/src/caffe/CMakeFiles/caffe_cu.dir/util/./caffe_cu_generated_im2col.cu.o

I am confused that in the Makefile.config, I have already removed the lines below

-gencode arch=compute_50,code=sm_50 \ -gencode arch=compute_50,code=compute_50




quin...@gmail.com

unread,
Jan 8, 2015, 1:51:10 PM1/8/15
to caffe...@googlegroups.com
As long as cuda is actually in /usr it should work. Maybe try make clean and then make all etc

Dmitry Ulyanov

unread,
Jan 9, 2015, 2:29:54 PM1/9/15
to caffe...@googlegroups.com
At first you didn't have to uncomment every line in make config (only if you really want to build debug version and use custom compiler ?). 
In order to use cuDNN you should have compatible gpu (GTX 9xx and titans I assume, you should check if cuDNN supports your gpu. Anyway as I remember you need CUDA 6.5 for cuDNN. 

set USE_CUDNN  to 0 to get rid of the error or install cuDNN properly

Jingpeng Wu

unread,
Jun 21, 2015, 4:15:08 PM6/21/15
to caffe...@googlegroups.com
removing the following two lines works for me.

`# -gencode arch=compute_50,code=sm_50 \
        # -gencode arch=compute_50,code=compute_50`

Ubuntu 14.10, GTX 780

Ibrahim A

unread,
Mar 17, 2017, 11:37:52 AM3/17/17
to Caffe Users, jingp...@gmail.com
What works for me is:
   1- download and install cuda from nvidia  from https://developer.nvidia.com/cuda-downloads
      1.1  restart
      1.2  check if it works by compiling and runing nbody sample, you should see nice visualization 
   2- set CUDA_NVCC_EXECUTABLE  /usr/local/cuda-8.0/bin/nvcc 
Reply all
Reply to author
Forward
0 new messages