mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-14 20:57:59 +00:00
Remove the linkage to CUDA libraries when ROCM is used. (#29009)
Summary: Currently when ROCM is used, CUDA libraries are still linked. There has been no error because USE_CUDA is set to OFF upon a preliminary check in tools/setup_helper/cuda.py, and no CUDA variable is set. Hence, these lines can pass simply because those variables are always undefined, and thus expanded to empty strings. But this cannot be safely relied on, and is causing https://github.com/pytorch/pytorch/issues/28617 to fail. Pull Request resolved: https://github.com/pytorch/pytorch/pull/29009 Differential Revision: D18273472 Pulled By: ezyang fbshipit-source-id: b8b6580e8a44d874ac678ed9073412d4d2e393ee
This commit is contained in:
parent
a49a656264
commit
dbbb2fc9e5
1 changed files with 1 additions and 3 deletions
|
|
@ -542,9 +542,7 @@ if (NOT INTERN_BUILD_MOBILE OR NOT BUILD_CAFFE2_MOBILE)
|
|||
# caffe2_nvrtc's stubs to driver APIs are useful for HIP.
|
||||
# See NOTE [ ATen NVRTC Stub and HIP ]
|
||||
add_library(caffe2_nvrtc SHARED ${ATen_NVRTC_STUB_SRCS})
|
||||
target_link_libraries(caffe2_nvrtc ${CUDA_NVRTC} ${PYTORCH_HIP_HCC_LIBRARIES} ${ROCM_HIPRTC_LIB})
|
||||
target_link_libraries(caffe2_nvrtc ${CUDA_NVRTC} ${CUDA_CUDA_LIB} ${CUDA_NVRTC_LIB})
|
||||
target_include_directories(caffe2_nvrtc PRIVATE ${CUDA_INCLUDE_DIRS})
|
||||
target_link_libraries(caffe2_nvrtc ${PYTORCH_HIP_HCC_LIBRARIES} ${ROCM_HIPRTC_LIB})
|
||||
target_compile_definitions(caffe2_nvrtc PRIVATE USE_ROCM __HIP_PLATFORM_HCC__)
|
||||
install(TARGETS caffe2_nvrtc DESTINATION "${TORCH_INSTALL_LIB_DIR}")
|
||||
endif()
|
||||
|
|
|
|||
Loading…
Reference in a new issue