Cuda nvcc致命:值';sm#U 20';未为选项';gpu体系结构&x27;

Cuda nvcc致命:值';sm#U 20';未为选项';gpu体系结构&x27;,cuda,nvidia,torch,nvcc,luarocks,Cuda,Nvidia,Torch,Nvcc,Luarocks,我看了很多页,要么因为不清楚而听不懂他们说的话,要么我的知识还不够 我正在尝试运行: luarock安装https://raw.githubusercontent.com/qassemoquab/stnbhwd/master/stnbhwd-scm-1.rockspec 这样我就可以使用GPU加速运行一些图像。当我运行它时,会出现以下错误: $ luarocks install https://raw.githubusercontent.com/qassemoquab/stnbhwd/maste

我看了很多页,要么因为不清楚而听不懂他们说的话,要么我的知识还不够

我正在尝试运行:

luarock安装https://raw.githubusercontent.com/qassemoquab/stnbhwd/master/stnbhwd-scm-1.rockspec

这样我就可以使用GPU加速运行一些图像。当我运行它时,会出现以下错误:

$ luarocks install https://raw.githubusercontent.com/qassemoquab/stnbhwd/master/stnbhwd-scm-1.rockspec
Using https://raw.githubusercontent.com/qassemoquab/stnbhwd/master/stnbhwd-scm-1.rockspec... switching to 'build' mode
Cloning into 'stnbhwd'...
remote: Counting objects: 24, done.
remote: Compressing objects: 100% (23/23), done.
remote: Total 24 (delta 0), reused 14 (delta 0), pack-reused 0
Receiving objects: 100% (24/24), 19.42 KiB | 0 bytes/s, done.
Checking connectivity... done.
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

-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- 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/tex/torch/install
-- Try OpenMP C flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Try OpenMP CXX flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Found OpenMP: -fopenmp  
-- Compiling with OpenMP support
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- 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 CUDA: /usr/local/cuda (found suitable version "9.0", minimum required is "5.5") 
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/luarocks_stnbhwd-scm-1-4197/stnbhwd/build
Scanning dependencies of target stn
[ 25%] Building C object CMakeFiles/stn.dir/init.c.o
[ 50%] Linking C shared module libstn.so
[ 50%] Built target stn
[ 75%] Building NVCC (Device) object CMakeFiles/custn.dir/custn_generated_init.cu.o
nvcc fatal   : Value 'sm_20' is not defined for option 'gpu-architecture'
CMake Error at custn_generated_init.cu.o.cmake:207 (message):
  Error generating
  /tmp/luarocks_stnbhwd-scm-1-4197/stnbhwd/build/CMakeFiles/custn.dir//./custn_generated_init.cu.o


CMakeFiles/custn.dir/build.make:63: recipe for target 'CMakeFiles/custn.dir/custn_generated_init.cu.o' failed
make[2]: *** [CMakeFiles/custn.dir/custn_generated_init.cu.o] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/custn.dir/all' failed
make[1]: *** [CMakeFiles/custn.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

Error: Build error: Failed building.
我能够
luarocks安装cutorch
luarocks安装cunn
,并且
luarocks安装cudnn
很好

我在GTX1080TI上运行Ubuntu 16.04

$ nvidia-smi
Tue Dec  5 16:25:42 2017       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 384.90                 Driver Version: 384.90                    |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 108...  Off  | 00000000:29:00.0  On |                  N/A |
|  0%   47C    P8    16W / 250W |    716MiB / 11169MiB |      1%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      1128      G   /usr/lib/xorg/Xorg                           479MiB |
|    0      1782      G   compiz                                       234MiB |
+-----------------------------------------------------------------------------+
出于某种原因,当我运行
$nvcc-V
时,我得到:

    The program 'nvcc' is currently not installed. You can install it by typing:
sudo apt install nvidia-cuda-toolkit
这是我面临的另一个大问题。当我安装nvcc时,它会安装Cuda 7.5的工具包,但我有Cuda 9.0。我使用来自的.deb文件安装了它

我真的希望我需要安装nvcc,但正如我所说,它安装的版本是错误的,我一辈子都不知道如何安装正确的版本,我真的很困惑,为什么我现在会出现这个错误,尽管我已经安装了cutorch、cudnn和cunn。感谢您的帮助


谢谢

尝试将代码体系结构(如sm_20)更改为您尝试安装的stnbhwd的更高版本

来自:

IF (CUDA_FOUND)
   LIST(APPEND CUDA_NVCC_FLAGS "-arch=sm_20")
致:


要安装nvcc,请尝试以下操作:

sudo apt-get install nvidia-cuda-toolkit
正如你提到的:

但我有Cuda 9.0

Cuda 9.0不支持SM_20体系结构()

您拥有全新的gpu:

我在GTX1080TI上运行Ubuntu 16.04

$ nvidia-smi
Tue Dec  5 16:25:42 2017       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 384.90                 Driver Version: 384.90                    |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 108...  Off  | 00000000:29:00.0  On |                  N/A |
|  0%   47C    P8    16W / 250W |    716MiB / 11169MiB |      1%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      1128      G   /usr/lib/xorg/Xorg                           479MiB |
|    0      1782      G   compiz                                       234MiB |
+-----------------------------------------------------------------------------+

它基于Pascal体系结构(SM_60)。因此,您可能不需要对SM_20体系结构的支持。

这不是为错误的版本安装
nvcc
。您的安装输出表明您已经安装了CUDA 9,并且CUDA 7.5中的一些旧垃圾正在为您提供自动删除功能。您找不到
nvcc
,因为您没有正确遵循《linux安装指南》中的安装说明,即安装CUDA 9后应该设置
PATH
环境变量。给出的答案描述了如何处理CUDA 9不支持且与您的GPU不匹配的
sm_20
。您能看一下吗?上面的建议是正确的-为了更快地查找,请访问CMakeLists.txt中的第55行
sudo apt-get install nvidia-cuda-toolkit