使用LuaRocks在Torch7中安装cutorch时出现错误,安装在Ubuntu 14.0中

时间:2016-10-26 13:47:23

标签: lua ubuntu-14.04 torch

我是lua的新手,这几天我只安装了火炬-7,当我安装cutorch时发生错误:

weigq@weigq-Lenovo-G410:~/torch$ luarocks install cutorch
Installing https://raw.githubusercontent.com/torch/rocks/master/cutorch-scm-1.rockspec...
Using https://raw.githubusercontent.com/torch/rocks/master/cutorch-scm-1.rockspec... switching to 'build' mode
正克隆到 'cutorch'...
remote: Counting objects: 203, done.
remote: Compressing objects: 100% (158/158), done.
remote: Total 203 (delta 57), reused 86 (delta 43), pack-reused 0
接收对象中: 100% (203/203), 191.70 KiB | 185.00 KiB/s, done.
处理 delta 中: 100% (57/57), done.
检查连接... 完成。
cmake -E make_directory build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="/home/weigq/torch/install/bin/.." -DCMAKE_INSTALL_PREFIX="/home/weigq/torch/install/lib/luarocks/rocks/cutorch/scm-1" && make -j$(getconf _NPROCESSORS_ONLN) install

-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- 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
-- 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
-- Found Torch7 in /home/weigq/torch/install
CMake Error at /usr/share/cmake-2.8/Modules/FindCUDA.cmake:548 (message):
  Specify CUDA_TOOLKIT_ROOT_DIR
Call Stack (most recent call first):
  CMakeLists.txt:7 (FIND_PACKAGE)


-- Configuring incomplete, errors occurred!
See also "/tmp/luarocks_cutorch-scm-1-8668/cutorch/build/CMakeFiles/CMakeOutput.log".

Error: Build error: Failed building.

我不知道如何处理它? 任何人都可以帮我解决它,谢谢!

1 个答案:

答案 0 :(得分:-1)

确保您使用的是NVidia显卡,并且确实安装了驱动程序和CUDA工具包。

$ lspci  | grep -i 'vga\|3d\|2d'

应打印有关安装在本机中的视频卡的信息。

如果它不是NVidia和/或它只支持OpenCL,您可以尝试cltorch (Torch OpenCL backend)或其他支持OpenCL的低层框架。

顺便说一下,设置CUDA工具包包括从the official site下载并安装它并设置搜索路径(根据您的安装方法)。 CUDA quick guide的示例:

$ export PATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}}
$ export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
相关问题