CannyLab / tsne-cuda

GPU Accelerated t-SNE for CUDA with Python bindings
BSD 3-Clause "New" or "Revised" License
1.81k stars 130 forks source link

CUDA_cublas_LIBRARY NOTFOUND #99

Closed DradeAW closed 3 years ago

DradeAW commented 3 years ago

Hi,

I'm trying to install tsnecuda using cmake, and I am stuck on this error (which is similar to #61):

$ cmake .. -D_BUILD_PYTHON=ON
-- Not building with ZMQ. Interactive visualization disabled. To build with ZMQ use -DWITH_ZMQ=ON
-- Not building standalone gpufaiss lib. To build gpufaiss standalone use -DWITH_FAISS_GPU_STANDALONE=ON
-- Found OpenMP_C: -fopenmp  
-- Found OpenMP_CXX: -fopenmp  
-- Found OpenBLAS libraries: /usr/lib/x86_64-linux-gnu/libopenblas.so
-- Found OpenBLAS include: /usr/include/x86_64-linux-gnu
CMake Warning at third_party/glog/CMakeLists.txt:49 (find_package):
  By not providing "Findgflags.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "gflags", but
  CMake did not find one.

  Could not find a package configuration file provided by "gflags" (requested
  version 2.2.0) with any of the following names:

    gflagsConfig.cmake
    gflags-config.cmake

  Add the installation prefix of "gflags" to CMAKE_PREFIX_PATH or set
  "gflags_DIR" to a directory containing one of the above files.  If "gflags"
  provides a separate development package or SDK, be sure it has been
  installed.

-- Found OpenMP_C: -fopenmp  
-- Found OpenMP_CXX: -fopenmp  
-- Found OpenBLAS libraries: /usr/lib/x86_64-linux-gnu/libopenblas.so
-- Found OpenBLAS include: /usr/include/x86_64-linux-gnu
-- Not building tests. To build tests use -DBUILD_TEST=ON
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) 
-- Not building documentation. To build documentation use -DBUILD_DOC=ON
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CUDA_cublas_LIBRARY (ADVANCED)
    linked by target "tsne" in directory /users/nsr/wyngaard/dev/t-SNE/tsne-cuda
    linked by target "tsnecuda" in directory /users/nsr/wyngaard/dev/t-SNE/tsne-cuda

-- Configuring incomplete, errors occurred!
See also "/users/nsr/wyngaard/dev/t-SNE/tsne-cuda/build/CMakeFiles/CMakeOutput.log".
See also "/users/nsr/wyngaard/dev/t-SNE/tsne-cuda/build/CMakeFiles/CMakeError.log".

I am on Ubuntu 20.04, with:

Here are my environment variables:

PATH=[...]:/usr/local/cuda-10.1/bin
LD_LIBRARY_PATH=/usr/local/cuda-10.1/lib64:/usr/local/cuda-10.2/lib64
LD_LOAD_LIBRARY=/usr/local/cuda-10.1/lib64:/usr/local/cuda-10.2/lib64

(it has both 10.1 and 10.2 because it solved an issue with another software that wasn't finding libculas.so)

Thank you !

DavidMChan commented 3 years ago

It looks like you're using a pretty old version of CMake - can you try with a newer version (>3.20)?

DradeAW commented 3 years ago

The error persists with cmake 3.20.2.

DavidMChan commented 3 years ago

Is it exactly the same error? (I.e is Gflags now located?). Also, are you using the version of tsne in main, or are you following the conversation in #95? It seems like cmake is having trouble locating cublas (which isn’t uncommon, as it actually moved to /usr/lib/x86_64-linux-gnu) - see: https://forums.developer.nvidia.com/t/cublas-for-10-1-is-missing/71015

Can you verify that cublas is installed in this directory?

On Thu, May 27 2021 at 07:52, Dradeliomecus < @.*** > wrote:

The error persists with cmake 3.20.2.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub ( https://github.com/CannyLab/tsne-cuda/issues/99#issuecomment-849701456 ) , or unsubscribe ( https://github.com/notifications/unsubscribe-auth/AAYK3IWIXZMYVH4M4O63WJDTPZMEFANCNFSM45TVO2NQ ).

DradeAW commented 3 years ago

Yes, the same:

$ cmake ..
-- Not building with ZMQ. Interactive visualization disabled. To build with ZMQ use -DWITH_ZMQ=ON
-- Not building standalone gpufaiss lib. To build gpufaiss standalone use -DWITH_FAISS_GPU_STANDALONE=ON
-- Found OpenMP_C: -fopenmp (found version "4.5") 
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
-- Found OpenBLAS libraries: /usr/lib/x86_64-linux-gnu/libopenblas.so
-- Found OpenBLAS include: /usr/include/x86_64-linux-gnu
CMake Warning at third_party/glog/CMakeLists.txt:49 (find_package):
  By not providing "Findgflags.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "gflags", but
  CMake did not find one.

  Could not find a package configuration file provided by "gflags" (requested
  version 2.2.0) with any of the following names:

    gflagsConfig.cmake
    gflags-config.cmake

  Add the installation prefix of "gflags" to CMAKE_PREFIX_PATH or set
  "gflags_DIR" to a directory containing one of the above files.  If "gflags"
  provides a separate development package or SDK, be sure it has been
  installed.

CMake Deprecation Warning at third_party/gtest/CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

CMake Deprecation Warning at third_party/gtest/googlemock/CMakeLists.txt:42 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

CMake Deprecation Warning at third_party/gtest/googletest/CMakeLists.txt:49 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

CMake Deprecation Warning at third_party/faiss/CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

-- Found OpenMP_C: -fopenmp (found version "4.5") 
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
-- Found OpenBLAS libraries: /usr/lib/x86_64-linux-gnu/libopenblas.so
-- Found OpenBLAS include: /usr/include/x86_64-linux-gnu
-- Not building tests. To build tests use -DBUILD_TEST=ON
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) 
-- Not building documentation. To build documentation use -DBUILD_DOC=ON
-- Configuring done
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CUDA_cublas_LIBRARY (ADVANCED)
    linked by target "tsne" in directory /users/nsr/wyngaard/dev/t-SNE/tsne-cuda
    linked by target "tsnecuda" in directory /users/nsr/wyngaard/dev/t-SNE/tsne-cuda

-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.

$ cmake --version
cmake version 3.20.2

CMake suite maintained and supported by Kitware (kitware.com/cmake).

/usr/lib/x86_64-linux-gnu contains libcuda but not libcublas. Does this have something to do with the fact that I have multiple version of CUDA installed on my computer (because different applications need different versions), and I change the version being used by changing the symlink /usr/local/cuda?

EDIT: Cublas is in /usr/local/cuda-10.2/targets/x86_64-linux/include/cublas.h, which should be included in my LD_LIBRARY_PATH

DavidMChan commented 3 years ago

Possibly - can you validate that libcublas is found somewhere on your machine? Also, you might try installing using the instructions in #95 (dev branch + FAISS install using their instructions) since the version of tsnecuda there is actually a bit faster, and the installation process is a bit less tedious.

The only reason that we haven't promoted this version to main, is that I can't get the anaconda installation working.

On Thu, May 27 2021 at 08:13, Dradeliomecus < @.*** > wrote:

Yes, the same:

$ cmake .. -- Not building with ZMQ. Interactive visualization disabled. To build with ZMQ use -DWITH_ZMQ=ON -- Not building standalone gpufaiss lib. To build gpufaiss standalone use -DWITH_FAISS_GPU_STANDALONE=ON

Found OpenMP_C: -fopenmp (found version "4.5") -- Found OpenMP_CXX: -fopenmp (found version "4.5") -- Found OpenBLAS libraries: /usr/lib/x86_64-linux-gnu/libopenblas.so -- Found OpenBLAS include: /usr/include/x86_64-linux-gnu CMake Warning at third_party/glog/CMakeLists.txt:49 (find_package): By not providing "Findgflags.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "gflags", but CMake did not find one.

Could not find a package configuration file provided by "gflags" (requested version 2.2.0) with any of the following names:

gflagsConfig.cmake gflags-config.cmake

Add the installation prefix of "gflags" to CMAKE_PREFIX_PATH or set "gflags_DIR" to a directory containing one of the above files. If "gflags" provides a separate development package or SDK, be sure it has been installed.

CMake Deprecation Warning at third_party/gtest/CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 2.8.12 will be removed from a future version of CMake.

Update the VERSION argument

value or use a ... suffix to tell CMake that the project does not need compatibility with older versions. CMake Deprecation Warning at third_party/gtest/googlemock/CMakeLists.txt:42 (cmake_minimum_required): Compatibility with CMake < 2.8.12 will be removed from a future version of CMake. Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions. CMake Deprecation Warning at third_party/gtest/googletest/CMakeLists.txt:49 (cmake_minimum_required): Compatibility with CMake < 2.8.12 will be removed from a future version of CMake. Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions. CMake Deprecation Warning at third_party/faiss/CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 2.8.12 will be removed from a future version of CMake. Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions. -- Found OpenMP_C: -fopenmp (found version "4.5") -- Found OpenMP_CXX: -fopenmp (found version "4.5") -- Found OpenBLAS libraries: /usr/lib/x86_64-linux-gnu/libopenblas.so -- Found OpenBLAS include: /usr/include/x86_64-linux-gnu -- Not building tests. To build tests use -DBUILD_TEST=ON -- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) -- Not building documentation. To build documentation use -DBUILD_DOC=ON -- Configuring done CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: CUDA_cublas_LIBRARY (ADVANCED) linked by target "tsne" in directory /users/nsr/wyngaard/dev/t-SNE/tsne-cuda linked by target "tsnecuda" in directory /users/nsr/wyngaard/dev/t-SNE/tsne-cuda -- Generating done CMake Generate step failed. Build files cannot be regenerated correctly. $ cmake --version cmake version 3.20.2 CMake suite maintained and supported by Kitware (kitware.com/cmake). /usr/lib/x86_64-linux-gnu contains libcuda but not libcublas. Does this have something to do with the fact that I have multiple version of CUDA installed on my computer (because different applications need different versions), and I change the version being used by changing the symlink /usr/local/cuda? — You are receiving this because you commented. Reply to this email directly, view it on GitHub ( https://github.com/CannyLab/tsne-cuda/issues/99#issuecomment-849717290 ) , or unsubscribe ( https://github.com/notifications/unsubscribe-auth/AAYK3ISVPMG4RGY4RIV75ULTPZOQFANCNFSM45TVO2NQ ).
DradeAW commented 3 years ago

I'll try this and get back to you, thank you!

DradeAW commented 3 years ago

It seems that i'm unable to build FAISS: "#error -- unsupported GNU version! gcc versions later than 8 are not supported!"

I tried to build the dev version without having installed FAISS, and it gave be this error:

$ cmake ..
-- The CUDA compiler identification is NVIDIA 10.1.243
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: /usr/local/cuda/bin/nvcc - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
-- Found CUDAToolkit: /usr/local/cuda/include (found version "10.1.243") 
-- Found OpenMP_C: -fopenmp (found version "4.5") 
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
CMake Error at CMakeLists.txt:139 (find_package):
  By not providing "Findgfla$ cmake ..
-- The CUDA compiler identification is NVIDIA 10.1.243
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: /usr/local/cuda/bin/nvcc - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
-- Found CUDAToolkit: /usr/local/cuda/include (found version "10.1.243") 
-- Found OpenMP_C: -fopenmp (found version "4.5") 
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
CMake Error at CMakeLists.txt:139 (find_package):
  By not providing "Findgflags.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "gflags", but
  CMake did not find one.

  Could not find a package configuration file provided by "gflags" with any
  of the following names:

    gflagsConfig.cmake
    gflags-config.cmake

  Add the installation prefix of "gflags" to CMAKE_PREFIX_PATH or set
  "gflags_DIR" to a directory containing one of the above files.  If "gflags"
  provides a separate development package or SDK, be sure it has been
  installed.

-- Configuring incomplete, errors occurred!
See also "/users/nsr/wyngaard/dev/t-SNE/tsne-cuda/build/CMakeFiles/CMakeOutput.log".
See also "/users/nsr/wyngaard/dev/t-SNE/tsne-cuda/build/CMakeFiles/CMakeError.log".gs.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "gflags", but
  CMake did not find one.

  Could not find a package configuration file provided by "gflags" with any
  of the following names:

    gflagsConfig.cmake
    gflags-config.cmake

  Add the installation prefix of "gflags" to CMAKE_PREFIX_PATH or set
  "gflags_DIR" to a directory containing one of the above files.  If "gflags"
  provides a separate development package or SDK, be sure it has been
  installed.

-- Configuring incomplete, errors occurred!
See also "/users/nsr/wyngaard/dev/t-SNE/tsne-cuda/build/CMakeFiles/CMakeOutput.log".
See also "/users/nsr/wyngaard/dev/t-SNE/tsne-cuda/build/CMakeFiles/CMakeError.log".

At least it seems that the dev version found cuda since it says "CUDA compiler identification is NVIDIA 10.1.243".

DradeAW commented 3 years ago

I tried installing it via conda, but it also does not work:

$ conda install tnsecuda cuda101 -c cannylab
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

  - tnsecuda

Current channels:

  - https://conda.anaconda.org/cannylab/linux-64
  - https://conda.anaconda.org/cannylab/noarch
  - https://repo.anaconda.com/pkgs/main/linux-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/linux-64
  - https://repo.anaconda.com/pkgs/r/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.
DavidMChan commented 3 years ago

It looks like for conda, you've misspelled "tsnecuda".

For the other versions, it seems like FindGFlags is missing - does the file "FindGFlags.cmake" exist in the folder "tsne-cuda/cmake/Modules"? If so, does changing line 139 of the CMakeLists.txt file from "find_package(gflags REQUIRED)" to "find_package(GFlags REQUIRED)" make a difference?

DradeAW commented 3 years ago

It looks like for conda, you've misspelled "tsnecuda". Wow, I'm an idiot ^^ Thanks, it installed and now works in conda (tsnecuda.test() ran succesfully).

But I would really like to make it work outside of conda. FindGFlags.cmake is indeed in the directory, but it contains 51 lines (I am on the dev branch as you told me to). I changed find_library(GFLAGS_LIBRARY gflags) to find_library(GFLAGS_LIBRARY GFlags) but the same error popped up while building.

DavidMChan commented 3 years ago

Hmm, can you try following the below steps for a clean installation (from scratch):

git clone https://github.com/cannylab/tsne-cuda
cd tsne-cuda && git checkout dev
mkdir -p build && cd build
cmake --version // Verify that the CMAKE version is 3.20.x
cmake ..

If you don't mind, can you also attach a GIST file with the output of the env command (feel free to censor this as reqd, or not include it if you feel that the variables are sensitive), and the output of the following:

gcc --version
g++ --version
nvcc --version

To validate the libraries are on your system, can you give the output of:

ldconfig -v -p | grep gflags

Additionally, at the beginning of the CMAKE file, you can add:

get_cmake_property(_variableNames VARIABLES)
list (SORT _variableNames)
foreach (_variableName ${_variableNames})
    message(STATUS "${_variableName}=${${_variableName}}")
endforeach()

which will print out the CMAKE variables that are present. We want to confirm that CMAKE_MODULE_PATH is set, and includes the path to the FindGFlags.cmake file.

Sorry for the huge number of debugging steps, but it's likely an issue with how your cmake/environment is configured (since find_package and our cmake build is usually pretty stable)

DradeAW commented 3 years ago
$ git clone https://github.com/cannylab/tsne-cuda
Cloning into 'tsne-cuda'...
remote: Enumerating objects: 3152, done.
remote: Counting objects: 100% (219/219), done.
remote: Compressing objects: 100% (101/101), done.
remote: Total 3152 (delta 139), reused 184 (delta 116), pack-reused 2933
Receiving objects: 100% (3152/3152), 15.42 MiB | 22.42 MiB/s, done.
Resolving deltas: 100% (2138/2138), done.

$ cd tsne-cuda && git checkout dev
Branch 'dev' set up to track remote branch 'dev' from 'origin'.
Switched to a new branch 'dev'

$ mkdir -p build && cd build

$ cmake --version
cmake version 3.20.2

CMake suite maintained and supported by Kitware (kitware.com/cmake).

$ cmake ..
-- The C compiler identification is GNU 8.4.0
-- The CXX compiler identification is GNU 9.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The CUDA compiler identification is NVIDIA 10.1.243
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: /usr/local/cuda/bin/nvcc - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
-- Found Git: /usr/bin/git (found version "2.25.1") 
-- Found CUDAToolkit: /usr/local/cuda/include (found version "10.1.243") 
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found OpenMP_C: -fopenmp (found version "4.5") 
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
-- Found OpenMP: TRUE (found version "4.5")  
CMake Error at CMakeLists.txt:139 (find_package):
  By not providing "Findgflags.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "gflags", but
  CMake did not find one.

  Could not find a package configuration file provided by "gflags" with any
  of the following names:

    gflagsConfig.cmake
    gflags-config.cmake

  Add the installation prefix of "gflags" to CMAKE_PREFIX_PATH or set
  "gflags_DIR" to a directory containing one of the above files.  If "gflags"
  provides a separate development package or SDK, be sure it has been
  installed.

-- Configuring incomplete, errors occurred!
See also "/users/nsr/wyngaard/dev/t-SNE/tsne-cuda/build/CMakeFiles/CMakeOutput.log".
See also "/users/nsr/wyngaard/dev/t-SNE/tsne-cuda/build/CMakeFiles/CMakeError.log".
$ gcc --version
gcc (Ubuntu 8.4.0-3ubuntu2) 8.4.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ g++ --version
g++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Sun_Jul_28_19:07:16_PDT_2019
Cuda compilation tools, release 10.1, V10.1.243

$ ldconfig -v -p | grep gflags
    libgflags_nothreads.so.2.2 (libc6,x86-64) => /lib/x86_64-linux-gnu/libgflags_nothreads.so.2.2
    libgflags.so.2.2 (libc6,x86-64) => /lib/x86_64-linux-gnu/libgflags.so.2.2

CMAKE_MODULE_PATH does indeed point to the folder that contains FingGFlags.cmake.

Here is for env:

$ env
SHELL=/bin/tcsh
SESSION_MANAGER=local/nspc05:@/tmp/.ICE-unix/1100020,unix/nspc05:/tmp/.ICE-unix/1100020
QT_ACCESSIBILITY=1
COLORTERM=truecolor
XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg:/usr/share/kubuntu-default-settings/kf5-settings
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session1
XDG_MENU_PREFIX=gnome-
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
CONDA_EXE=/users/nsr/wyngaard/dev/miniconda3/bin/conda
_CE_M=
GTK2_MODULES=overlay-scrollbar
LANGUAGE=en_GB:en
MANDATORY_PATH=/usr/share/gconf/ubuntu.mandatory.path
GNOME_SHELL_SESSION_MODE=ubuntu
SSH_AUTH_SOCK=/run/user/11068/keyring/ssh
XMODIFIERS=@im=ibus
DESKTOP_SESSION=ubuntu
SSH_AGENT_PID=1099975
GTK_MODULES=appmenu-gtk-module:gail:atk-bridge:appmenu-gtk-module
PWD=/users/nsr/wyngaard/dev/t-SNE/tsne-cuda
LOGNAME=wyngaard
XDG_SESSION_DESKTOP=ubuntu
XDG_SESSION_TYPE=x11
GPG_AGENT_INFO=/run/user/11068/gnupg/S.gpg-agent:0:1
XAUTHORITY=/users/nsr/wyngaard/.Xauthority
XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/wyngaard
GJS_DEBUG_TOPICS=JS ERROR;JS LOG
GDM_LANG=en_GB
HOME=/users/nsr/wyngaard
IM_CONFIG_PHASE=1
LANG=en_GB.UTF-8
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
XDG_CURRENT_DESKTOP=ubuntu:GNOME
LD_LOAD_LIBRARY=:/usr/local/cuda/lib64:/usr/local/cuda-10.2/lib64:/usr/local/cuda-10.2/lib64
VTE_VERSION=6003
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
GNOME_TERMINAL_SCREEN=/org/gnome/Terminal/screen/0217a25e_d79f_4675_a616_2e2a3edf7973
INVOCATION_ID=03b11f9cbdc74180aacd04a0b83aaada
MANAGERPID=1099768
GJS_DEBUG_OUTPUT=stderr
LESSCLOSE=/usr/bin/lesspipe %s %s
XDG_SESSION_CLASS=user
TERM=xterm-256color
_CE_CONDA=
DEFAULTS_PATH=/usr/share/gconf/ubuntu.default.path
LESSOPEN=| /usr/bin/lesspipe %s
USER=wyngaard
BLAS_VERSION=/usr/lib/x86_64-linux-gnu/mkl/libblas.so
GNOME_TERMINAL_SERVICE=:1.103
CONDA_SHLVL=0
DISPLAY=:0
SHLVL=1
QT_IM_MODULE=ibus
UBUNTU_MENUPROXY=1
CONDA_PYTHON_EXE=/users/nsr/wyngaard/dev/miniconda3/bin/python
LD_LIBRARY_PATH=:/usr/local/cuda/lib64:/usr/local/cuda-10.2/lib64
XDG_RUNTIME_DIR=/run/user/11068
CUDA_HOME=/usr/local/cuda
JOURNAL_STREAM=9:12684258
XDG_DATA_DIRS=/usr/share/ubuntu:/users/nsr/wyngaard/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share:/var/lib/snapd/desktop
PATH=/users/nsr/wyngaard/dev/miniconda3/condabin:/users/nsr/wyngaard/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/users/nsr/wyngaard/dev/mountainlab/bin:/users/nsr/wyngaard/dev/mountainlab/packages/mountainview/bin:/usr/local/cuda/bin:/opt/cmake/bin
GDMSESSION=ubuntu
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/11068/bus
OLDPWD=/users/nsr/wyngaard/dev/t-SNE/tsne-cuda/cmake
_=/usr/bin/env
DradeAW commented 3 years ago

Any idea what's going wrong?

LiUzHiAn commented 3 years ago

@Dradeliomecus

I ran into pretty much the same issue (i.e. cublas cannot be found) as you and check #61 for some information. My env was ubuntu-16.04, g++ 5.4.0 and cmake 3.20 initially. I also installed multiple CUDA versions on my machine (cuda-10.1 as default).

First, I thought the problem was caused by the cmake...So, as jmcorgan posted in #61, I tried to downgrade my cmake to 3.15, but it not works.

Then, I check if the libcublas.so exists in my machine, which is located at /usr/local/cuda-10.1/lib64. The result is I cannot find it in /usr/local/cuda-10.1/lib64, but I find one in /usr/local/cuda-10.0/lib64.

Hence, I changed the symbolic link /usr/local/cuda to /usr/local/cuda-10.0, and the errors during cmake .. were fixed eventually.

Hope it helps!

DradeAW commented 3 years ago

Hi,

Thanks for the information. I know that cuda 10.1 doesn't have a libcublas.so in lib64, that's why in my $LD_LIBRARY_PATH and $LD_LOAD_LIBRARY, I have both the cuda 10.1 and cuda 10.2 lib64 folder (it works for all other softwares I use that uses cuda).

Unfortunately, I would like to use this library of tsne with another library that requires cuda 10.1 exactly ...

LiUzHiAn commented 3 years ago

...and it takes ~1hr to finish the compilation process...

The python test case runs successfully as follows:

Python 3.6.13 |Anaconda, Inc.| (default, Jun  4 2021, 14:25:59) 
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tsnecuda
>>> tsnecuda.test()
Initializing cuda handles... done.
KNN Computation... done.
Computing Pij matrix... done.
Initializing low dim points... done.
Initializing CUDA memory... done.
[Step 0] Avg. Gradient Norm: 5.64623e-05
[Step 10] Avg. Gradient Norm: 2.66581e-06
...
[Step 930] Avg. Gradient Norm: 0.000386877
[Step 940] Avg. Gradient Norm: 0.00051006
[Step 950] Avg. Gradient Norm: 0.000584353
[Step 960] Avg. Gradient Norm: 0.000444957
[Step 970] Avg. Gradient Norm: 0.000387314
[Step 980] Avg. Gradient Norm: 0.000379959
[Step 990] Avg. Gradient Norm: 0.000393951
_time_initialization: 0.568221s
_time_knn: 0.13632s
_time_symmetry: 0.030019s
_time_init_low_dim: 0.00204s
_time_init_fft: 0.142495s
_time_compute_charges: 0.002022s
_time_precompute_2d: 0.150264s
_time_nbodyfft: 0.183949s
_time_norm: 0.028474s
_time_attr: 0.071821s
_time_apply_forces: 0.064219s
_time_other: 0.005133s
total_time: 1.38498s
LiUzHiAn commented 3 years ago

Hi,

Thanks for the information. I know that cuda 10.1 doesn't have a libcublas.so in lib64, that's why in my $LD_LIBRARY_PATH and $LD_LOAD_LIBRARY, I have both the cuda 10.1 and cuda 10.2 lib64 folder (it works for all other softwares I use that uses cuda).

Unfortunately, I would like to use this library of tsne with another library that requires cuda 10.1 exactly ...

Yeah, cuda-10.2 also provides the libcublas.so in lib64, but the official doc says that "Our code has been tested compiling with CUDA versions 8.0, 9.0, 9.1, 9.2, 10.0, and 10.1. Other versions may not be supported."

I guess the cuda-10.2 is not supported?

DavidMChan commented 3 years ago

Whoops - I've updated the installation instructions, and the main branch. There are also several docker files now which you can explore for installing the libraries if required. CUDA 10.2 should be supported, in addition to several other CUDA versions.

DavidMChan commented 3 years ago

After testing, this should be fixed in 3.0.0. Feel free to reopen if you're still having issues.