torch / distro

Torch installation in a self-contained folder
BSD 3-Clause "New" or "Revised" License
556 stars 484 forks source link

Could NOT find CUDA (missing: CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY) on Ubuntu16.04 #250

Closed jamiechoi1995 closed 6 years ago

jamiechoi1995 commented 6 years ago

I follow instructions to install torch on http://torch.ch/docs/getting-started.html#_

When I execute ./install.sh messgage shows:

Found CUDA on your machine. Installing CUDA packages Warning: unmatched variable LUALIB

jopts=$(getconf _NPROCESSORS_CONF)

echo "Building on $jopts cores" cmake -E make_directory build && cd build && cmake .. -DLUALIB= -DLUA_INCDIR=/home/wcai/torch/install/include -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="/home/wcai/torch/install/bin/.." -DCMAKE_INSTALL_PREFIX="/home/wcai/torch/install/lib/luarocks/rocks/cutorch/scm-1" && make -j$jopts install

Building on 12 cores -- The C compiler identification is GNU 6.3.0 -- The CXX compiler identification is GNU 5.4.1 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found Torch7 in /home/wcai/torch/install CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message): Could NOT find CUDA (missing: CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY) (found suitable version "8.0", minimum required is "6.5") Call Stack (most recent call first): /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE) /home/wcai/torch/install/share/cmake/torch/FindCUDA.cmake:1009 (find_package_handle_standard_args) CMakeLists.txt:7 (FIND_PACKAGE)

-- Configuring incomplete, errors occurred! See also "/home/wcai/torch/extra/cutorch/build/CMakeFiles/CMakeOutput.log".

Error: Build error: Failed building.

I have installed CUDA for tensorflow before, it works well.

jamiechoi1995 commented 6 years ago

Solution: sudo apt-get install nvidia-cuda-dev