0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

t-SNE-CUDAをCUDA 10.1, Ubuntu 18.04でビルド

Last updated at Posted at 2019-04-27

tsne-cudaの手順 に従ってすすめる。

cmake

cmakeの途中でエラー。Web検索の末に最新版のcmake 3.14.3をインストールすると先に進んだ。
cmakeの途中でさらに MKL が見つからないという旨のエラー。下のようにMKLの場所を指定すると通った。

$ cmake .. -DBUILD_PYTHON=TRUE -DMKL_INCLUDE_DIR=/usr/include/x86_64-linux-gnu -DMKL_LIBRARIES=/usr/lib/x86_64-linux-gnu/openblas/libblas.so

make

makeの途中で下のエラーが出た:

$ make
[  9%] Built target faiss
[ 11%] Built target glog
[ 12%] Built target gtest
[ 13%] Building NVCC (Device) object CMakeFiles/tsnecuda.dir/third_party/faiss/gpu/tsnecuda_generated_GpuIndexFlat.cu.o
/opt/tsne-cuda/third_party/faiss/gpu/impl/../utils/Tensor.cuh(362): error: type name is not allowed

/opt/tsne-cuda/third_party/faiss/gpu/impl/../utils/Tensor.cuh(362): error: expected an expression

2 errors detected in the compilation of "/tmp/tmpxft_00003467_00000000-4_GpuIndexFlat.cpp4.ii".
CMake Error at tsnecuda_generated_GpuIndexFlat.cu.o.cmake:275 (message):
  Error generating file
  /opt/tsne-cuda/build/CMakeFiles/tsnecuda.dir/third_party/faiss/gpu/./tsnecuda_generated_GpuIndexFlat.cu.o

下のように一行手を入れるとビルドが通った:

$ cd third_party/faiss
$ git diff
diff --git a/gpu/utils/Tensor.cuh b/gpu/utils/Tensor.cuh
index f925a37..2ddaba6 100644
--- a/gpu/utils/Tensor.cuh
+++ b/gpu/utils/Tensor.cuh
@@ -359,7 +359,7 @@ bool canUseIndexType() {
 
 template <typename IndexType, typename T, typename... U>
 bool canUseIndexType(const T& arg, const U&... args) {
-  return arg.canUseIndexType<IndexType>() &&
+  return arg.canUseIndexType() &&
     canUseIndexType(args...);
 }

開発元に pull-request を出した https://github.com/DavidMChan/faiss/pull/1

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?