Skip to content

Commit 6eeca8f

Browse files
LuLu
authored andcommitted
fix bug of "not support architecture compute_75" when use CUDA-9.0 toolkit
1 parent eb35073 commit 6eeca8f

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

source/op/cuda/CMakeLists.txt

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,25 @@ SET(CMAKE_CXX_STANDARD 11)
1414
SET(CMAKE_CUDA_STANDARD 11)
1515
# nvcc -o libdeepmd_op_cuda.so -I/usr/local/cub-1.8.0 -rdc=true -DHIGH_PREC=true -gencode arch=compute_61,code=sm_61 -shared -Xcompiler -fPIC deepmd_op.cu -L/usr/local/cuda/lib64 -lcudadevrt
1616
# very important here! Include path to cub.
17-
include_directories(cub)
18-
# nvcc flags
19-
set(CUDA_NVCC_FLAGS -gencode arch=compute_60,code=sm_60; # Pascal – GP100/Tesla P100 – DGX-1 (Generic Pascal)
20-
-gencode arch=compute_61,code=sm_61; # Pascal - GTX 1080, GTX 1070, GTX 1060, GTX 1050, GTX 1030, Titan Xp, Tesla P40, Tesla P4, Discrete GPU on the NVIDIA Drive PX2
21-
-gencode arch=compute_70,code=sm_70; # Volta - GV100/Tesla V100, GTX 1180 (GV104)
22-
-gencode arch=compute_75,code=sm_75; # Turing - RTX 2080, Titan RTX, Quadro R8000
23-
-O3; -Xcompiler -fPIC;
24-
)
17+
include_directories(cub)
18+
if (${CUDA_VERSION_MAJOR} STREQUAL "10")
19+
message(STATUS "CUDA major version is " ${CUDA_VERSION_MAJOR})
20+
# nvcc flags
21+
set(CUDA_NVCC_FLAGS -gencode arch=compute_60,code=sm_60; # Pascal – GP100/Tesla P100 – DGX-1 (Generic Pascal)
22+
-gencode arch=compute_61,code=sm_61; # Pascal - GTX 1080, GTX 1070, GTX 1060, GTX 1050, GTX 1030, Titan Xp, Tesla P40, Tesla P4, Discrete GPU on the NVIDIA Drive PX2
23+
-gencode arch=compute_70,code=sm_70; # Volta - GV100/Tesla V100, GTX 1180 (GV104)
24+
-gencode arch=compute_75,code=sm_75; # Turing - RTX 2080, Titan RTX, Quadro R8000
25+
-O3; -Xcompiler -fPIC;
26+
)
27+
else (${CUDA_VERSION_MAJOR} STREQUAL "10")
28+
message(STATUS "CUDA major version is " ${CUDA_VERSION_MAJOR})
29+
# nvcc flags
30+
set(CUDA_NVCC_FLAGS -gencode arch=compute_60,code=sm_60; # Pascal – GP100/Tesla P100 – DGX-1 (Generic Pascal)
31+
-gencode arch=compute_61,code=sm_61; # Pascal - GTX 1080, GTX 1070, GTX 1060, GTX 1050, GTX 1030, Titan Xp, Tesla P40, Tesla P4, Discrete GPU on the NVIDIA Drive PX2
32+
-gencode arch=compute_70,code=sm_70; # Volta - GV100/Tesla V100, GTX 1180 (GV104)
33+
-O3; -Xcompiler -fPIC;
34+
)
35+
endif()
2536

2637
set (SOURCE_FILES
2738
descrpt_se_a.cu descrpt_se_r.cu prod_force_se_a.cu prod_force_se_r.cu prod_virial_se_a.cu prod_virial_se_r.cu

0 commit comments

Comments
 (0)