@CrazyHenry
        
        2018-04-20T11:24:04.000000Z
        字数 2445
        阅读 2811
    hhhhfaiss
- Author:李英民 | Henry
 - E-mail: li
 _yingmin@outlookdotcom- Home: https://liyingmin.wixsite.com/henry
 
快速了解我: About Me
转载请保留上述引用内容,谢谢配合!
安装官方:https://github.com/facebookresearch/faiss/blob/master/INSTALL.md 
OpenBlas:http://www.openblas.net/
cat /usr/local/cuda/version.txt发现是7.5.18查看机器型号lsb_release -afree -mdf -hcat /proc/cpuinfolspci | grep VGA#mem 127795


scp Anaconda3-5.1.0-Linux-x86_64.sh yingmin.li@yz-gpu023.hogpu.cc:/home/users/yingmin.li/installscp -r Anaconda3-5.1.0-Linux-x86_64.sh yingmin.li@yz-gpu023.hogpu.cc:/home/users/yingmin.li/installwget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-5.1.0-Linux-x86_64.shbash Anaconda3-5.1.0-Linux-x86_64.sh
echo 'export PATH="/home/users/yingmin.li/anaconda3/bin:$PATH"' >> ~/.bashrcsource ~/.bashrc
继续使用Ubuntu优化anaconda那一套即可。
安装mkl和numpy
conda install mklconda install numpy# CPU version onlyconda install faiss-cpu -c pytorch# Make sure you have CUDA installed before installing faiss-gpu, otherwise it falls back to CPU versionconda install faiss-gpu -c pytorch# [DEFAULT]For CUDA8.0, comes with cudatoolkit8.0
疑问:查找机子上安装的是cuda7.5,直接使用这个安装应该用的是cudatoolkit8.0?
疑似还是需要源码编译。
conda install mkl numpy openblas openmp
发现conda安装的openblas似乎不完整,换用其他方式安装。
sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpmyum search openblasyum install openblas-devel #开发版
cp example_makefile/Makefile.inc.Linux Makefile.inc #Makefile.inc用来辅助Makefilemake
因为openblas需要权限,因此可能只有采用源码安装方式。
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm确实需要权限
然而,GPU机子上都已经安装好了需要的软件源!而且openblas已经装好了!不需要再安装了!
cp example_makefile/Makefile.inc.Linux makefile.inc #makefile.inc用来辅助Makefile,注意makefile.inc小写make
scp sift.tar.gz yingmin.li@yz-gpu023.hogpu.cc:/home/users/yingmin.li/proj/faiss_proj/faisstar -zxf sift.tar.gzmv sift sift1Mmake demos/sif.../demos/demo_sift1M

cd gpumake -j10
test:
make gpu/test/demo_ivfpq_indexing_gpu./gpu/test/demo_ivfpq_indexing_gpu
发现缺少libcublas.so文件
export PATH=$PATH:/usr/local/cuda-8.0/binexport LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-8.0/lib64export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/cuda-8.0/lib64source /etc/profile
以上似乎不持久:
echo '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
然后就可以了!
