Friday, December 9, 2016

Ubuntu 16.10 + GTX 1080

USB install Ubuntu 16.10

$ uname -r
4.8.0-30-generic

Ctrl+Alt+T to start terminal as mouse not working

sudo apt-get install ssh
sudo service ssh restart

Fix mouse not working problem

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
sudo apt-get install nvidia-367

https://yangcha.github.io/GTX-1080/


wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_8.0.44-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1604_8.0.44-1_amd64.deb
sudo apt-get update
sudo apt-get install cuda
$ nvidia-smi
Fri Dec  9 23:21:17 2016       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 367.57                 Driver Version: 367.57                    |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 1080    Off  | 0000:01:00.0      On |                  N/A |
| 27%   25C    P8     6W / 180W |    284MiB /  8111MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID  Type  Process name                               Usage      |
|=============================================================================|
|    0      1078    G   /usr/lib/xorg/Xorg                             146MiB |
|    0      2170    G   /usr/bin/compiz                                136MiB |

+-----------------------------------------------------------------------------+

cudnn 5.1
https://developer.nvidia.com/rdp/cudnn-download
Download cuDNN v5.1 (August 10, 2016)
cuDNN v5.1 Library for Linux

tar xvzf cudnn-8.0-linux-x64-v5.1.tgz
sudo cp cuda/include/cudnn.h /usr/local/cuda/include
sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64
sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*

Install Caffe
https://github.com/BVLC/caffe/wiki/Ubuntu-16.04-or-15.10-Installation-Guide

CXX src/caffe/util/db.cpp
CXX src/caffe/util/db_leveldb.cpp
CXX src/caffe/util/db_lmdb.cpp
CXX src/caffe/util/hdf5.cpp
CXX src/caffe/util/im2col.cpp
CXX src/caffe/util/insert_splits.cpp
CXX src/caffe/util/io.cpp
CXX src/caffe/util/math_functions.cpp
CXX src/caffe/util/signal_handler.cpp
CXX src/caffe/util/upgrade_proto.cpp
NVCC src/caffe/layers/absval_layer.cu
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
In file included from /usr/local/cuda-8.0/include/cuda_runtime.h:78:0,
                 from <command-line>:0:
/usr/local/cuda-8.0/include/host_config.h:119:2: error: #error -- unsupported GNU version! gcc versions later than 5 are not supported!
 #error -- unsupported GNU version! gcc versions later than 5 are not supported!
  ^~~~~
Makefile:589: recipe for target '.build_release/cuda/src/caffe/layers/absval_layer.o' failed
make: *** [.build_release/cuda/src/caffe/layers/absval_layer.o] Error 1
 


Fix: https://github.com/BVLC/caffe/wiki/GeForce-GTX-1080,---CUDA-8.0,---Ubuntu-16.04,---Caffe

#if __GNUC__ > 5

//#error -- unsupported GNU version! gcc versions later than 5 are not supported!

#endif /* __GNUC__ > 5 */


Ubuntu 16.10 gcc version is 6.2 

Use this step to change gcc version to 5.4
https://gist.github.com/beci/2a2091f282042ed20cda

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-5 g++-5
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 1

$ gcc --version
gcc (Ubuntu 5.4.1-2ubuntu2) 5.4.1 20160929


$ g++ --version
g++ (Ubuntu 5.4.1-2ubuntu2) 5.4.1 20160929



Problem when running caffe runtest
[----------] 5 tests from ImageDataLayerTest/2, where TypeParam = caffe::GPUDevice<float>
[ RUN      ] ImageDataLayerTest/2.TestSpace
[       OK ] ImageDataLayerTest/2.TestSpace (32 ms)
[ RUN      ] ImageDataLayerTest/2.TestShuffle
[       OK ] ImageDataLayerTest/2.TestShuffle (104 ms)
[ RUN      ] ImageDataLayerTest/2.TestRead
[       OK ] ImageDataLayerTest/2.TestRead (104 ms)
[ RUN      ] ImageDataLayerTest/2.TestResize
*** Aborted at 1481571270 (unix time) try "date -d @1481571270" if you are using GNU date ***
PC: @     0x7fa785a370ba (unknown)
*** SIGSEGV (@0xfffffffffffffff7) received by PID 20554 (TID 0x7fa75d032700) from PID 18446744073709551607; stack trace: ***
    @     0x7fa786f1d630 (unknown)
    @     0x7fa785a370ba (unknown)
    @     0x7fa785a3718b (unknown)
    @     0x7fa785a38ce8 (unknown)
    @     0x7fa785a37692 (unknown)
    @     0x7fa785a32020 (unknown)
    @     0x7fa785a30165 tbb::internal::allocate_root_with_context_proxy::allocate()
    @     0x7fa78937ce22 cv::parallel_for_()
    @     0x7fa788c63b2a (unknown)
    @     0x7fa788c60bb7 cv::resize()
    @     0x7fa787b3a5e1 caffe::ReadImageToCVMat()
    @     0x7fa787a58550 caffe::ImageDataLayer<>::load_batch()
    @     0x7fa787a10019 caffe::BasePrefetchingDataLayer<>::InternalThreadEntry()
    @     0x7fa7879e8dbe caffe::InternalThread::entry()
    @     0x7fa7879ebd0f boost::_mfi::mf5<>::operator()()
    @     0x7fa7879ebbe7 boost::_bi::list6<>::operator()<>()
    @     0x7fa7879ebadc boost::_bi::bind_t<>::operator()()
    @     0x7fa7879eba8e boost::detail::thread_data<>::run()
    @     0x7fa788923596 (unknown)
    @     0x7fa786f136ca start_thread
    @     0x7fa786c4d0af clone
    @                0x0 (unknown)
Makefile:527: recipe for target 'runtest' failed
make: *** [runtest] Segmentation fault (core dumped)



Tried recompile protobuf verion 2.5 : https://github.com/BVLC/caffe/wiki/GeForce-GTX-1080,---CUDA-8.0,---Ubuntu-16.04,---Caffe
But it does not solve the problem.



1 comment:

  1. I am having the same problem as well, hope someone can help to get this working soon.

    ReplyDelete