Ubuntu 16.04 + caffe + cuda Installation Mannual

来源:互联网 发布:电信内蒙古大数据 编辑:程序博客网 时间:2024/06/06 19:10


//============================================================================

问题描述:

Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)

 

出现场景:

使用命令:sudo apt-get update

 

原因解析:

在上一次下载资源时,由于网络问题,下载失败。当换一个较好一点网络环境之后,下载失败报错。

原因在于,上一次不正常的关闭下载,导致资源被锁不可用,删除异常的资源,重新下载即可。

 

解决方案:

运行以下命令,删除资源:

sudo rm /var/cache/apt/archives/lock

sudo rm /var/lib/dpkg/lock

之后重新使用命令:sudo apt-get update,可以重新正常下载。

 

PS:如有不正确之处,欢迎指正!

//===========================================================================

“fatal error: hdf5.h: 没有那个文件或目录”解决方法

参考自http://blog.csdn.net/hongye000000/article/details/51043913

Step 1

Makefile.config文件的第85行,添加/usr/include/hdf5/serial/INCLUDE_DIRS,也就是把下面第一行代码改为第二行代码。

INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
  • 1
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/


//==============================================================================

Error when Building GPU docker image for caffe: Unsupported gpu architecture 'compute_60'

2 down vote accepted

In the Makefile.example, try commenting out the *_60 and *_61 lines (for compatibility with CUDA < 8.0).

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 \        -gencode arch=compute_50,code=sm_50 \        -gencode arch=compute_52,code=sm_52 \        #-gencode arch=compute_60,code=sm_60 \        #-gencode arch=compute_61,code=sm_61 \        #-gencode arch=compute_61,code=compute_61


//===========================================================================

Build caffe fails on Ubuntu 16.04 (‘memcpy’ was not declared in this scope)

转载 2016年05月29日 13:50:47

You could try to pass an argument (CXX_FLAGS) to the compiler -D_FORCE_INLINES by editing the CMAKE files (for example: set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FORCE_INLINES")) or makefiles.


So, Open the Makefile and changing the line

NVCCFLAGS += -ccbin=$(CXX) -Xcompiler -fPIC $(COMMON_FLAGS)

into

NVCCFLAGS += -D_FORCE_INLINES -ccbin=$(CXX) -Xcompiler -fPIC $(COMMON_FLAGS)

For me this was on line 406

//===================================================================

在make py的时候,遇到了这个错误:

/usr/bin/ld: cannot find -lhdf5_hl/usr/bin/ld: cannot find -lhdf5collect2: error: ld returned 1 exit status

这说明连接器找不到 hdf5_hl和hdf5这两个库,没法进行链接。
我的解决方案是更改makefile:在makefile中作如下更改:

#LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_hl hdf5LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_serial_hl hdf5_serial

原创粉丝点击