在Torch7中安装cutorch并在Ubuntu 14.0中安装LuaRocks时出错

在Torch7中安装cutorch并在Ubuntu 14.0中安装LuaRocks时出错,lua,ubuntu-14.04,torch,Lua,Ubuntu 14.04,Torch,我是lua的新手,这些天我刚安装了torch-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/mast

我是lua的新手,这些天我刚安装了torch-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.
我不知道该怎么处理?
任何人都可以帮我解决,谢谢

确保您使用的是NVidia图形卡,并且已经设置了驱动程序和CUDA工具包

$ lspci  | grep -i 'vga\|3d\|2d'
应打印有关安装到计算机中的视频卡的信息

如果它不是NVidia和/或它只支持OpenCL,您可以尝试或使用其他较低级别的框架,它确实支持OpenCL

顺便说一句,设置CUDA工具包包括从下载和安装以及设置搜索路径(根据您的安装方法)。示例来自:


您是否安装了CUDA驱动程序?具体是哪一个?你为那些CUDA驱动程序和整个工具包设置了搜索路径吗?我刚刚发现我在实验室使用的计算机的图形卡是AMD!sadSo,也许你可以试试。或者其他支持OpenCL的框架,但torch可以按照您的建议运行吗?不能肯定,但值得一试。根据您的视频卡,它应该是。
$ 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}}