@CrazyHenry
2018-05-08T01:52:55.000000Z
字数 2160
阅读 2682
hhhhfaiss
- Author:李英民 | Henry
- E-mail: li
_yingmin@outlookdotcom- Home: https://liyingmin.wixsite.com/henry
快速了解我: About Me
转载请保留上述引用内容,谢谢配合!
在这个目录:/usr/local //看cuda的版本free -m #内存df -hcat /proc/cpuinfo #CPUlspci | grep VGA #GPU



git clone https://github.com/facebookresearch/faiss.gitcp -r faiss faiss.back //备份一份
到faiss主目录下cp example_makefiles/makefile.inc.Linux makefile.inc #makefile.inc用来辅助Makefile
scp -r l_mkl_2017.0.098.tgz liyingmin@10.31.33.120:/home/liyingmin/temp# 如果在bashrc多写了so,进去删除即可#解压安装MKLtar -xzf l_mkl_2017.0.098.tgzbash install.sh只要输入了serial number(3VGW-N6PJ7GCN)就行,选3用user安装
#修改makefile.inc取消MKL的注释注释掉OpenBlas修改以下路径$MKLROOT = /home/liyingmin/intel/compilers_and_libraries/linux/mkl#完成一些路径设置echo 'export LD_LIBRARY_PATH="/home/liyingmin/intel/compilers_and_libraries/linux/mkl/lib/intel64:$LD_LIBRARY_PATH"' >> ~/.bashrcecho 'export LD_PRELOAD="/home/liyingmin/intel/compilers_and_libraries/linux/mkl/lib/intel64/libmkl_core.so:/home/liyingmin/intel/compilers_and_libraries/linux/mkl/lib/intel64/libmkl_sequential.so:$LD_PRELOAD"' >> ~/.bashrcsource ~/.bashrcmake
scp sift.tar.gz liyingmin@10.31.33.120:/home/liyingmin/proj/faiss_proj/faisstar -zxf sift.tar.gzmv sift sift1Mmake demos/sif.../demos/demo_sift1M

cd gpumake -j10echo 'export PATH="/usr/local/cuda-8.0/bin:$PATH"' >> ~/.bashrcecho 'export LD_LIBRARY_PATH="/usr/local/cuda-8.0/lib64:$LD_LIBRARY_PATH"' >> ~/.bashrcecho 'export LIBRARY_PATH="/usr/local/cuda-8.0/lib64:$LIBRARY_PATH"' >> ~/.bashrcsource ~/.bashrc
由于这里在make的时候报错了,猜测应该是intel MKL的锅。

GPU机子上都已经安装好了需要的软件源!而且openblas已经装好了!不需要再安装了!
可以通过以下方式检测openblas的安装:
cd /usr/lib64//到这个目录下检查是否有libopenblas.so文件
修改makefile.inc文件:
把MKL的注释掉解除openblas的注释BLASCFLAGS=-DFINTEGER=intBLASLDFLAGS?=/usr/lib64/libopenblas.so.0
cd gpumake clean //clean掉以前的编译结果make -j10echo 'export PATH="/usr/local/cuda-8.0/bin:$PATH"' >> ~/.bashrcecho 'export LD_LIBRARY_PATH="/usr/local/cuda-8.0/lib64:$LD_LIBRARY_PATH"' >> ~/.bashrcecho 'export LIBRARY_PATH="/usr/local/cuda-8.0/lib64:$LIBRARY_PATH"' >> ~/.bashrcsource ~/.bashrc
编译完成后,出现libgpufaiss.a文件
make gpu/test/demo_ivfpq_indexing_gpu./gpu/test/demo_ivfpq_indexing_gpu
