Skip to content

Commit

Permalink
Install CUDA runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
srcejon committed Aug 14, 2023
1 parent 3ce2f28 commit 3e2adda
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
19 changes: 18 additions & 1 deletion cmake/cpack/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,19 @@ elseif(WIN32 OR MINGW)
)
endforeach(libsigmf_dll)

if(${VKFFT_BACKEND} EQUAL 1)
find_package(CUDA)
if(CUDA_FOUND)
file(GLOB CUDA_DLLS "${CUDA_TOOLKIT_ROOT_DIR}/bin/nvrtc*${CMAKE_SHARED_LIBRARY_SUFFIX}")
foreach(cuda_dll ${CUDA_DLLS})
get_filename_component(cuda_dll_name "${cuda_dll}" NAME)
add_custom_target(copy_cuda_${cuda_dll_name} ALL
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${cuda_dll}" "${SDRANGEL_BINARY_BIN_DIR}/"
)
endforeach(cuda_dll)
endif()
endif()

# TODO we need a way to fixup_bundle() on the build bin/ directory without call install
if(BUILD_GUI)
install(CODE "
Expand Down Expand Up @@ -295,7 +308,11 @@ elseif(WIN32 OR MINGW)
# libsigmf
install(DIRECTORY "${LIBSIGMF_DLL_DIR}/" DESTINATION "${INSTALL_LIB_DIR}"
FILES_MATCHING PATTERN "*${CMAKE_SHARED_LIBRARY_SUFFIX}")

# CUDA runtime
if((${VKFFT_BACKEND} EQUAL 1) AND CUDA_FOUND)
install(DIRECTORY "${CUDA_TOOLKIT_ROOT_DIR}/bin" DESTINATION "${INSTALL_LIB_DIR}"
FILES_MATCHING PATTERN "nvrtc*${CMAKE_SHARED_LIBRARY_SUFFIX}")
endif()

install(CODE "
# remove *.lib files
Expand Down
3 changes: 3 additions & 0 deletions sdrbase/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ if (${VKFFT_BACKEND} EQUAL 1)
dsp/cudavkfftengine.h
)
endif()
if(WIN32)
set(WINDOWS_FIXUP_BUNDLE_LIB_DIRS ${WINDOWS_FIXUP_BUNDLE_LIB_DIRS} ${CUDA_TOOLKIT_ROOT_DIR}/bin PARENT_SCOPE)
endif()
endif()

if((Vulkan_FOUND AND (${VKFFT_BACKEND} EQUAL 0)) OR (CUDA_FOUND AND (${VKFFT_BACKEND} EQUAL 1)))
Expand Down

0 comments on commit 3e2adda

Please sign in to comment.