@CrazyHenry
2018-04-20T19:24:04.000000Z
字数 2445
阅读 2386
hhhhfaiss
- Author:李英民 | Henry
- E-mail: li
_
yingmin@
outlookdot
com- 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 -a
free -m
df -h
cat /proc/cpuinfo
lspci | grep VGA
#mem 127795
scp Anaconda3-5.1.0-Linux-x86_64.sh yingmin.li@yz-gpu023.hogpu.cc:/home/users/yingmin.li/install
scp -r Anaconda3-5.1.0-Linux-x86_64.sh yingmin.li@yz-gpu023.hogpu.cc:/home/users/yingmin.li/install
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-5.1.0-Linux-x86_64.sh
bash Anaconda3-5.1.0-Linux-x86_64.sh
echo 'export PATH="/home/users/yingmin.li/anaconda3/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
继续使用Ubuntu优化anaconda那一套即可。
安装mkl和numpy
conda install mkl
conda install numpy
# CPU version only
conda install faiss-cpu -c pytorch
# Make sure you have CUDA installed before installing faiss-gpu, otherwise it falls back to CPU version
conda 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.rpm
yum search openblas
yum install openblas-devel #开发版
cp example_makefile/Makefile.inc.Linux Makefile.inc #Makefile.inc用来辅助Makefile
make
因为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/faiss
tar -zxf sift.tar.gz
mv sift sift1M
make demos/sif..
./demos/demo_sift1M
cd gpu
make -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/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-8.0/lib64
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/cuda-8.0/lib64
source /etc/profile
以上似乎不持久:
echo 'export PATH="/usr/local/cuda-8.0/bin:$PATH"' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH="/usr/local/cuda-8.0/lib64:$LD_LIBRARY_PATH"' >> ~/.bashrc
echo 'export LIBRARY_PATH="/usr/local/cuda-8.0/lib64:$LIBRARY_PATH"' >> ~/.bashrc
source ~/.bashrc
然后就可以了!