Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 91af6e4

Browse filesBrowse files
committed
More changes
1 parent c366fb3 commit 91af6e4
Copy full SHA for 91af6e4

File tree

Expand file treeCollapse file tree

2 files changed

+12
-9
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+12
-9
lines changed

‎caffe2/CMakeLists.txt

Copy file name to clipboardExpand all lines: caffe2/CMakeLists.txt
-5Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,11 +1083,6 @@ elseif(USE_CUDA)
10831083
CUDA::cusolver
10841084
)
10851085
endif()
1086-
# NS: TODO, is this really necessary?
1087-
if(USE_MAGMA AND CAFFE2_STATIC_LINK_CUDA)
1088-
target_link_libraries(torch_cuda_linalg PRIVATE
1089-
CUDA::culibos ${CMAKE_DL_LIBS})
1090-
endif()
10911086
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/../aten/src/ATen/native/cuda/LinearAlgebraStubs.cpp PROPERTIES COMPILE_FLAGS "-DBUILD_LAZY_CUDA_LINALG")
10921087
install(TARGETS torch_cuda_linalg DESTINATION "${TORCH_INSTALL_LIB_DIR}")
10931088
endif()

‎cmake/public/cuda.cmake

Copy file name to clipboardExpand all lines: cmake/public/cuda.cmake
+12-4Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,25 @@ endif()
5656
find_package(CUDAToolkit REQUIRED)
5757

5858
cmake_policy(POP)
59+
if(NOT CUDAToolkit_FOUND)
60+
message(WARNING
61+
"PyTorch: CUDA cannot be found. Depending on whether you are building "
62+
"PyTorch or a PyTorch dependent library, the next warning / error will "
63+
"give you more info.")
64+
set(CAFFE2_USE_CUDA OFF)
65+
return()
66+
endif()
5967

6068
if(NOT CMAKE_CUDA_COMPILER_VERSION VERSION_EQUAL CUDAToolkit_VERSION)
6169
message(FATAL_ERROR "Found two conflicting CUDA versions:\n"
6270
"V${CMAKE_CUDA_COMPILER_VERSION} in '${CUDA_INCLUDE_DIRS}' and\n"
6371
"V${CUDAToolkit_VERSION} in '${CUDAToolkit_INCLUDE_DIRS}'")
6472
endif()
6573

66-
message(STATUS "PyTorch: CUDA detected: " ${CUDA_VERSION})
67-
message(STATUS "PyTorch: CUDA nvcc is: " ${CUDA_NVCC_EXECUTABLE})
68-
message(STATUS "PyTorch: CUDA toolkit directory: " ${CUDA_TOOLKIT_ROOT_DIR})
69-
if(CUDA_VERSION VERSION_LESS 11.0)
74+
message(STATUS "PyTorch: CUDA detected: " ${CUDAToolkit_VERSION})
75+
message(STATUS "PyTorch: CUDA nvcc is: " ${CUDAToolkit_NVCC_EXECUTABLE})
76+
message(STATUS "PyTorch: CUDA toolkit directory: " ${CUDAToolkit_ROOT})
77+
if(CUDAToolkit_VERSION VERSION_LESS 11.0)
7078
message(FATAL_ERROR "PyTorch requires CUDA 11.0 or above.")
7179
endif()
7280

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.