Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dgl
Commits
7ee550f0
"docs/git@developer.sourcefind.cn:OpenDAS/torchaudio.git" did not exist on "8c1db721135e61d4a3dfbc4e2bbe05cd50cfded1"
Unverified
Commit
7ee550f0
authored
Jan 05, 2023
by
Xin Yao
Committed by
GitHub
Jan 05, 2023
Browse files
update cmake for cuda12 (#5048)
parent
ec3934d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
cmake/modules/CUDA.cmake
cmake/modules/CUDA.cmake
+8
-2
No files found.
cmake/modules/CUDA.cmake
View file @
7ee550f0
...
@@ -21,6 +21,9 @@ if (NOT CUDA_VERSION VERSION_LESS "11.8")
...
@@ -21,6 +21,9 @@ if (NOT CUDA_VERSION VERSION_LESS "11.8")
list
(
APPEND dgl_known_gpu_archs
"90"
)
list
(
APPEND dgl_known_gpu_archs
"90"
)
set
(
dgl_cuda_arch_ptx
"90"
)
set
(
dgl_cuda_arch_ptx
"90"
)
endif
()
endif
()
if
(
NOT CUDA_VERSION VERSION_LESS
"12.0"
)
list
(
REMOVE_ITEM dgl_known_gpu_archs
"35"
)
endif
()
################################################################################################
################################################################################################
# A function for automatic detection of GPUs installed (if autodetection is enabled)
# A function for automatic detection of GPUs installed (if autodetection is enabled)
...
@@ -53,7 +56,7 @@ set(CUDA_gpu_detect_output "")
...
@@ -53,7 +56,7 @@ set(CUDA_gpu_detect_output "")
#find vcvarsall.bat and run it building msvc environment
#find vcvarsall.bat and run it building msvc environment
get_filename_component
(
MY_COMPILER_DIR
${
CMAKE_CXX_COMPILER
}
DIRECTORY
)
get_filename_component
(
MY_COMPILER_DIR
${
CMAKE_CXX_COMPILER
}
DIRECTORY
)
find_file
(
MY_VCVARSALL_BAT vcvarsall.bat
"
${
MY_COMPILER_DIR
}
/.."
"
${
MY_COMPILER_DIR
}
/../.."
)
find_file
(
MY_VCVARSALL_BAT vcvarsall.bat
"
${
MY_COMPILER_DIR
}
/.."
"
${
MY_COMPILER_DIR
}
/../.."
)
execute_process
(
COMMAND
${
MY_VCVARSALL_BAT
}
&&
${
CUDA_NVCC_EXECUTABLE
}
-arch
sm_35
--run
${
__cufile
}
execute_process
(
COMMAND
${
MY_VCVARSALL_BAT
}
&&
${
CUDA_NVCC_EXECUTABLE
}
-arch
native
--run
${
__cufile
}
WORKING_DIRECTORY
"
${
PROJECT_BINARY_DIR
}
/CMakeFiles/"
WORKING_DIRECTORY
"
${
PROJECT_BINARY_DIR
}
/CMakeFiles/"
RESULT_VARIABLE __nvcc_res OUTPUT_VARIABLE __nvcc_out
RESULT_VARIABLE __nvcc_res OUTPUT_VARIABLE __nvcc_out
OUTPUT_STRIP_TRAILING_WHITESPACE
)
OUTPUT_STRIP_TRAILING_WHITESPACE
)
...
@@ -61,7 +64,7 @@ set(CUDA_gpu_detect_output "")
...
@@ -61,7 +64,7 @@ set(CUDA_gpu_detect_output "")
if
(
CUDA_LIBRARY_PATH
)
if
(
CUDA_LIBRARY_PATH
)
set
(
CUDA_LINK_LIBRARY_PATH
"-L
${
CUDA_LIBRARY_PATH
}
"
)
set
(
CUDA_LINK_LIBRARY_PATH
"-L
${
CUDA_LIBRARY_PATH
}
"
)
endif
()
endif
()
execute_process
(
COMMAND
${
CUDA_NVCC_EXECUTABLE
}
-arch
sm_35
--run
${
__cufile
}
${
CUDA_LINK_LIBRARY_PATH
}
execute_process
(
COMMAND
${
CUDA_NVCC_EXECUTABLE
}
-arch
native
--run
${
__cufile
}
${
CUDA_LINK_LIBRARY_PATH
}
WORKING_DIRECTORY
"
${
PROJECT_BINARY_DIR
}
/CMakeFiles/"
WORKING_DIRECTORY
"
${
PROJECT_BINARY_DIR
}
/CMakeFiles/"
RESULT_VARIABLE __nvcc_res OUTPUT_VARIABLE __nvcc_out
RESULT_VARIABLE __nvcc_res OUTPUT_VARIABLE __nvcc_out
OUTPUT_STRIP_TRAILING_WHITESPACE
)
OUTPUT_STRIP_TRAILING_WHITESPACE
)
...
@@ -99,6 +102,9 @@ endfunction()
...
@@ -99,6 +102,9 @@ endfunction()
function
(
dgl_select_nvcc_arch_flags out_variable
)
function
(
dgl_select_nvcc_arch_flags out_variable
)
# List of arch names. Turing and Ada don't have a new major version, so they are not added to default build.
# List of arch names. Turing and Ada don't have a new major version, so they are not added to default build.
set
(
__archs_names
"Kepler"
"Maxwell"
"Pascal"
"Volta"
"Turing"
"Ampere"
"Ada"
"Hopper"
"All"
"Manual"
)
set
(
__archs_names
"Kepler"
"Maxwell"
"Pascal"
"Volta"
"Turing"
"Ampere"
"Ada"
"Hopper"
"All"
"Manual"
)
if
(
NOT CUDA_VERSION VERSION_LESS
"12.0"
)
list
(
REMOVE_ITEM __archs_names
"Kepler"
)
endif
()
set
(
__archs_name_default
"All"
)
set
(
__archs_name_default
"All"
)
if
(
NOT CMAKE_CROSSCOMPILING
)
if
(
NOT CMAKE_CROSSCOMPILING
)
list
(
APPEND __archs_names
"Auto"
)
list
(
APPEND __archs_names
"Auto"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment