我正在写作,因为我在安装喇嘛时遇到了问题,其中包括CUDA的编译。我按照本页面的教程进行操作 http://libama.sourceforge.net/doc/d5/de9/page_linuxinstallation.html 和命令" make"给我以下错误:
[Kraut@Wzmbx001 build44]$ make
Scanning dependencies of target log4lama
[ 0%] Building CXX object logging/CMakeFiles/log4lama.dir/GenLogger.cpp.o
[ 1%] Building CXX object logging/CMakeFiles/log4lama.dir/GenLoggerCreator.cpp.o
[ 1%] Building CXX object logging/CMakeFiles/log4lama.dir/Level.cpp.o
[ 2%] Building CXX object logging/CMakeFiles/log4lama.dir/Logger.cpp.o
[ 2%] Building CXX object logging/CMakeFiles/log4lama.dir/LoggerProvider.cpp.o
[ 3%] Building CXX object logging/CMakeFiles/log4lama.dir/SourceLocation.cpp.o
Linking CXX shared library liblog4lama.so
[ 3%] Built target log4lama
[ 3%] Building NVCC (Device) object lama/cuda/CMakeFiles/cuda_compile.dir//./cuda_compile_generated_CUDACOOUtils.cu.o
nvcc fatal : Value 'sm_13' is not defined for option 'gpu-architecture'
CMake Error at cuda_compile_generated_CUDACOOUtils.cu.o.cmake:202 (message):
Error generating
/opt/OpenFOAM/lama/build44/lama/cuda/CMakeFiles/cuda_compile.dir//./cuda_compile_generated_CUDACOOUtils.cu.o
make[2]: *** [lama/cuda/CMakeFiles/cuda_compile.dir/./cuda_compile_generated_CUDACOOUtils.cu.o] Error 1
make[1]: *** [lama/cuda/CMakeFiles/amacuda.dir/all] Error 2
make: *** [all] Error 2
我找到了解决这个问题的方法,并找到了这三个答案,这些答案似乎最接近我的问题:
https://devtalk.nvidia.com/default/topic/762051/jetson-tk1/compile-issues/?offset=4#4786865 How can i tell PyCUDA which GPU to use? http://sourceforge.net/p/viennacl/mailman/message/34316211/
在这些主题中,提到了一个人应该在" Makefile"中更改或注释掉" -arch = sm_13" -option。或文件"〜.cmake"。但是我不知道在哪里可以找到这个文件,在那里我可以修改这个选项。任何人都可以帮助并指导我找到这个文件的位置吗?
问题似乎很常见,因为此选项指的是CUDA支持的gpu架构。我的系统上有CUDA-7.5,所以通过搜索这个问题的解决方案我明白,不再支持sm_13了。所以我希望改变这个可以解决这个问题 - 只需要知道在哪里!
答案 0 :(得分:2)
似乎支持的体系结构在CompilerFlags.cmake中定义:
### choosing the right compute capability
### we just start from version 1.3 ( 1.0 - 1.2 is not supported )
LIST ( APPEND CC_CHOICES "13" "20" "21" "30" "35" )
set ( CUDA_COMPUTE_CAPABILITY "13" CACHE STRING "CUDA compute capability (supported up from 13)" )
set ( CACHE CUDA_COMPUTE_CAPABILITY PROPERTY STRINGS ${CC_CHOICES} )
checkValue( ${CUDA_COMPUTE_CAPABILITY} "${CC_CHOICES}" )
mark_as_advanced ( CUDA_COMPUTE_CAPABILITY )
根据需要修改