Skip to content

Commit

Permalink
Add Pascal to all cuda architectures
Browse files Browse the repository at this point in the history
The known gpu architectures were missing the Pascal sm_60 and sm_61 compute capabilities. When building for this GPU, but on a separate machine, like a CI server or inside a docker image, caffe would be built for at most capability sm_50 and crash when run on the Pascal GPU.
  • Loading branch information
Queuecumber authored and Max Ehrlich committed Dec 2, 2016
1 parent 24d2f67 commit 8cd5c3d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmake/Cuda.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ endif()

# Known NVIDIA GPU achitectures Caffe can be compiled for.
# This list will be used for CUDA_ARCH_NAME = All option
set(Caffe_known_gpu_archs "20 21(20) 30 35 50")
set(Caffe_known_gpu_archs "20 21(20) 30 35 50 60 61")

################################################################################################
# A function for automatic detection of GPUs installed (if autodetection is enabled)
Expand Down Expand Up @@ -56,7 +56,7 @@ endfunction()
# caffe_select_nvcc_arch_flags(out_variable)
function(caffe_select_nvcc_arch_flags out_variable)
# List of arch names
set(__archs_names "Fermi" "Kepler" "Maxwell" "All" "Manual")
set(__archs_names "Fermi" "Kepler" "Maxwell" "Pascal" "All" "Manual")
set(__archs_name_default "All")
if(NOT CMAKE_CROSSCOMPILING)
list(APPEND __archs_names "Auto")
Expand Down Expand Up @@ -89,6 +89,8 @@ function(caffe_select_nvcc_arch_flags out_variable)
set(__cuda_arch_bin "30 35")
elseif(${CUDA_ARCH_NAME} STREQUAL "Maxwell")
set(__cuda_arch_bin "50")
elseif(${CUDA_ARCH_NAME} STREQUAL "Pascal")
set(__cuda_arch_bin "60 61")
elseif(${CUDA_ARCH_NAME} STREQUAL "All")
set(__cuda_arch_bin ${Caffe_known_gpu_archs})
elseif(${CUDA_ARCH_NAME} STREQUAL "Auto")
Expand Down

0 comments on commit 8cd5c3d

Please sign in to comment.