@@ -2,9 +2,9 @@ if(NOT WITH_GPU)
22 return ()
33endif ()
44
5- set (paddle_known_gpu_archs "20 21(20) 30 35 50 52 60 61 70" )
6- set (paddle_known_gpu_archs7 "20 21(20) 30 35 50 52" )
7- set (paddle_known_gpu_archs8 "20 21(20) 30 35 50 52 60 61" )
5+ set (paddle_known_gpu_archs "30 35 50 52 60 61 70" )
6+ set (paddle_known_gpu_archs7 "30 35 50 52" )
7+ set (paddle_known_gpu_archs8 "30 35 50 52 60 61" )
88
99######################################################################################
1010# A function for automatic detection of GPUs installed (if autodetection is enabled)
@@ -40,7 +40,7 @@ function(detect_installed_gpus out_variable)
4040 STRING (REGEX REPLACE "\n " ";" nvcc_out "${nvcc_out} " )
4141 list (GET nvcc_out -1 nvcc_out)
4242 string (REPLACE "2.1" "2.1(2.0)" nvcc_out "${nvcc_out} " )
43- set (CUDA_gpu_detect_output ${nvcc_out} CACHE INTERNAL "Returned GPU architetures from caffe_detect_gpus tool" FORCE)
43+ set (CUDA_gpu_detect_output ${nvcc_out} CACHE INTERNAL "Returned GPU architetures from detect_installed_gpus tool" FORCE)
4444 endif ()
4545 endif ()
4646
@@ -137,10 +137,6 @@ function(select_nvcc_arch_flags out_variable)
137137 set (${out_variable} _readable ${nvcc_archs_readable} PARENT_SCOPE)
138138endfunction ()
139139
140- if (NOT CUDA_FOUND)
141- return ()
142- endif ()
143-
144140message (STATUS "CUDA detected: " ${CUDA_VERSION} )
145141if (${CUDA_VERSION} LESS 7.0)
146142 set (paddle_known_gpu_archs ${paddle_known_gpu_archs} )
@@ -163,37 +159,11 @@ if(NOT WITH_DSO)
163159 list (APPEND EXTERNAL_LIBS ${CUDNN_LIBRARY} ${CUDA_CUBLAS_LIBRARIES} ${CUDA_curand_LIBRARY} ${NCCL_LIBRARY} )
164160endif (NOT WITH_DSO)
165161
166- # find libcuda.so and lbnvrtc.so
167- # For libcuda.so, we will find it under lib, lib64, and then the
168- # stubs folder, in case we are building on a system that does not
169- # have cuda driver installed. On windows, we also search under the
170- # folder lib/x64.
171-
172- find_library (CUDA_CUDA_LIB cuda
173- PATHS ${CUDA_TOOLKIT_ROOT_DIR}
174- PATH_SUFFIXES lib lib64 lib/stubs lib64/stubs lib/x64)
175- find_library (CUDA_NVRTC_LIB nvrtc
176- PATHS ${CUDA_TOOLKIT_ROOT_DIR}
177- PATH_SUFFIXES lib lib64 lib/x64)
178-
179162# setting nvcc arch flags
180163select_nvcc_arch_flags(NVCC_FLAGS_EXTRA)
181164list (APPEND CUDA_NVCC_FLAGS ${NVCC_FLAGS_EXTRA} )
182165message (STATUS "Added CUDA NVCC flags for: ${NVCC_FLAGS_EXTRA_readable} " )
183166
184- if (CUDA_CUDA_LIB)
185- # message(STATUS "Found libcuda: ${CUDA_CUDA_LIB}")
186- list (APPEND Caffe2_DEPENDENCY_LIBS ${CUDA_CUDA_LIB} )
187- else ()
188- message (FATAL_ERROR "Cannot find libcuda.so." )
189- endif ()
190- if (CUDA_NVRTC_LIB)
191- # message(STATUS "Found libnvrtc: ${CUDA_NVRTC_LIB}")
192- list (APPEND Caffe2_DEPENDENCY_LIBS ${CUDA_NVRTC_LIB} )
193- else ()
194- message (FATAL_ERROR "Cannot find libnvrtc.so." )
195- endif ()
196-
197167# Set C++11 support
198168set (CUDA_PROPAGATE_HOST_FLAGS OFF )
199169
0 commit comments