【发布时间】:2018-05-19 20:01:30
【问题描述】:
我正在尝试安装一个名为 stn 的 luarocks 包。官方的安装方式是运行:
luarocks install https://raw.githubusercontent.com/qassemoquab/stnbhwd/master/stnbhwd-scm-1.rockspec
但这给了我不幸的,加剧的错误:
nvcc fatal : Value 'sm_20' is not defined for option 'gpu-architecture'
据我所知,解决此问题的唯一方法是手动更改 CMakeLists.txt 文件:
IF (CUDA_FOUND)
LIST(APPEND CUDA_NVCC_FLAGS "-arch=sm_20")
收件人:
IF (CUDA_FOUND)
LIST(APPEND CUDA_NVCC_FLAGS "-arch=sm_30")
这意味着我必须将 repo 克隆到本地文件中,更改 CMakeLists 文件,然后 luarock 制作它。 (作为免责声明,为了做到这一点,我不得不chown我的整个用户,因为无论出于何种原因,luarocks 似乎都没有目录写入权限。我到底有多糟糕?)。
所以,我能够通过 cding 进入主目录并安装 .rockspec 文件:
luarocks make stnbhwd-scm-1.rockspec
这给了我这个输出:
$ luarocks make stnbhwd-scm-1.rockspec
cmake -E make_directory build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="/home/tex/torch/install/bin/.." -DCMAKE_INSTALL_PREFIX="/home/tex/torch/install/lib/luarocks/rocks/stnbhwd/scm-1" && make
-- Found Torch7 in /home/tex/torch/install
-- Compiling with OpenMP support
-- Configuring done
-- Generating done
-- Build files have been written to: /home/tex/Downloads/stnbhwd-master/build
[ 50%] Built target stn
[ 75%] Building NVCC (Device) object CMakeFiles/custn.dir/custn_generated_init.cu.o
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THStorage.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THStorageCopy.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCStorage.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCStorageCopy.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THTensor.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THTensorCopy.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THTensorRandom.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THTensorMath.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THTensorConv.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THTensorLapack.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCTensor.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCTensorCopy.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCTensorRandom.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCTensorMath.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCTensorMathBlas.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCTensorMathMagma.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCTensorMathPairwise.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCTensorMathPointwise.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCTensorMathReduce.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCTensorMathCompare.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCTensorMathCompareT.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCTensorMathScan.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCTensorMasked.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCTensorScatterGather.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCTensorIndex.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCTensorSort.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCTensorMode.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCTensorTopK.h
[100%] Linking CXX shared module libcustn.so
[100%] Built target custn
cd build && make install
[ 50%] Built target stn
[100%] Built target custn
Install the project...
-- Install configuration: "Release"
-- Installing: /home/tex/torch/install/lib/luarocks/rocks/stnbhwd/scm-1/lib/libstn.so
-- Set runtime path of "/home/tex/torch/install/lib/luarocks/rocks/stnbhwd/scm-1/lib/libstn.so" to "$ORIGIN/../lib:/home/tex/torch/install/lib"
-- Installing: /home/tex/torch/install/lib/luarocks/rocks/stnbhwd/scm-1/lua/stn/test.lua
-- Installing: /home/tex/torch/install/lib/luarocks/rocks/stnbhwd/scm-1/lua/stn/AffineGridGeneratorBHWD.lua
-- Installing: /home/tex/torch/install/lib/luarocks/rocks/stnbhwd/scm-1/lua/stn/AffineTransformMatrixGenerator.lua
-- Installing: /home/tex/torch/install/lib/luarocks/rocks/stnbhwd/scm-1/lua/stn/init.lua
-- Installing: /home/tex/torch/install/lib/luarocks/rocks/stnbhwd/scm-1/lua/stn/BilinearSamplerBHWD.lua
-- Installing: /home/tex/torch/install/lib/luarocks/rocks/stnbhwd/scm-1/lib/libcustn.so
-- Set runtime path of "/home/tex/torch/install/lib/luarocks/rocks/stnbhwd/scm-1/lib/libcustn.so" to "$ORIGIN/../lib:/home/tex/torch/install/lib"
Warning: /home/tex/torch/install/share/lua/5.1/stnbhwd_scm_1-stn/init.lua is not tracked by this installation of LuaRocks. Moving it to /home/tex/torch/install/share/lua/5.1/stnbhwd_scm_1-stn/init.lua~~~~~~
Warning: /home/tex/torch/install/share/lua/5.1/stnbhwd_scm_1-stn/AffineTransformMatrixGenerator.lua is not tracked by this installation of LuaRocks. Moving it to /home/tex/torch/install/share/lua/5.1/stnbhwd_scm_1-stn/AffineTransformMatrixGenerator.lua~~~~~~
Warning: /home/tex/torch/install/share/lua/5.1/stnbhwd_scm_1-stn/BilinearSamplerBHWD.lua is not tracked by this installation of LuaRocks. Moving it to /home/tex/torch/install/share/lua/5.1/stnbhwd_scm_1-stn/BilinearSamplerBHWD.lua~~~~~~
Warning: /home/tex/torch/install/share/lua/5.1/stnbhwd_scm_1-stn/test.lua is not tracked by this installation of LuaRocks. Moving it to /home/tex/torch/install/share/lua/5.1/stnbhwd_scm_1-stn/test.lua~~~~~~
Warning: /home/tex/torch/install/share/lua/5.1/stnbhwd_scm_1-stn/AffineGridGeneratorBHWD.lua is not tracked by this installation of LuaRocks. Moving it to /home/tex/torch/install/share/lua/5.1/stnbhwd_scm_1-stn/AffineGridGeneratorBHWD.lua~~~~~~
Warning: /home/tex/torch/install/lib/lua/5.1/stnbhwd_scm_1-libstn.so is not tracked by this installation of LuaRocks. Moving it to /home/tex/torch/install/lib/lua/5.1/stnbhwd_scm_1-libstn.so~~~~~~
Warning: /home/tex/torch/install/lib/lua/5.1/stnbhwd_scm_1-libcustn.so is not tracked by this installation of LuaRocks. Moving it to /home/tex/torch/install/lib/lua/5.1/stnbhwd_scm_1-libcustn.so~~~~~
stnbhwd scm-1 is now installed in /home/tex/torch/install/ (license: MIT)
注意“警告”标志。我不知道为什么会这样,但我认为它对安装有一些明显的影响,因为当我加载 stn 时...:
Failed loading module stn in LuaRocks rock stnbhwd scm-1
no field package.preload['stn']
no file '/home/tex/.luarocks/share/lua/5.1/stn.lua'
no file '/home/tex/.luarocks/share/lua/5.1/stn/init.lua'
no file '/home/tex/torch/install/share/lua/5.1/stn.lua'
no file '/home/tex/torch/install/share/lua/5.1/stn/init.lua'
no file './stn.lua'
no file '/home/tex/torch/install/share/luajit-2.1.0-beta1/stn.lua'
no file '/usr/local/share/lua/5.1/stn.lua'
no file '/usr/local/share/lua/5.1/stn/init.lua'
no file '/home/tex/.luarocks/lib/lua/5.1/stn.so'
no file '/home/tex/torch/install/lib/lua/5.1/stn.so'
no file '/home/tex/torch/install/lib/stn.so'
no file './stn.so'
no file '/usr/local/lib/lua/5.1/stn.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
[C]: in function 'error'
/home/tex/torch/install/share/lua/5.1/trepl/init.lua:389: in function 'require'
run_model.lua:6: in main chunk
[C]: in function 'dofile'
.../tex/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
[C]: at 0x00405d50
sigh 有人知道解决办法吗?有解决方法吗? LuaRocks 仍然适用于安装包,但也许我在安装本地包时做错了。有没有办法安装 stn 包,同时在安装之前更改 cmake 文件(而不是下载包并手动更改它)?我对此表示怀疑,但是... :(
编辑:任何阅读本文的人,请参考this page。我基本上说搞砸了,并将编辑后的 repo 上传到我自己的 github 页面上。现在,我面临一个不同的错误。
【问题讨论】: