mirror of
https://github.com/NVIDIA/cuda-samples.git
synced 2025-07-01 20:20:29 +08:00
Bug 5133197: Add cmake toolchain and and update the CMakeList of some sample for tegra linux cross build
This commit is contained in:
parent
ab9166a6b2
commit
bd0f630bf4
@ -1,5 +1,8 @@
|
|||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
|
### CUDA 12.9
|
||||||
|
* Updated toolchain for cross-compilation for Tegra Linux platforms.
|
||||||
|
|
||||||
### CUDA 12.8
|
### CUDA 12.8
|
||||||
* Updated build system across the repository to CMake. Removed Visual Studio project files and Makefiles.
|
* Updated build system across the repository to CMake. Removed Visual Studio project files and Makefiles.
|
||||||
* Removed the following outdated samples:
|
* Removed the following outdated samples:
|
||||||
|
@ -94,9 +94,9 @@ Navigate to the root of the cloned repository and create a build directory:
|
|||||||
```
|
```
|
||||||
mkdir build && cd build
|
mkdir build && cd build
|
||||||
```
|
```
|
||||||
Configure the project with CMake, specifying the Tegra toolchain file:
|
Configure the project with CMake, specifying the Tegra toolchain file. And you can use -DTARGET_FS to point to the target file system root path for necessary include and library files:
|
||||||
```
|
```
|
||||||
cmake .. -DCMAKE_TOOLCHAIN_FILE=/path/to/tegra/toolchain.cmake
|
cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/toolchain-aarch64-linux.cmake -DTARGET_FS=/path/to/target/system/file/system
|
||||||
```
|
```
|
||||||
Build the samples:
|
Build the samples:
|
||||||
```
|
```
|
||||||
|
@ -18,31 +18,10 @@ endif()
|
|||||||
# Include directories and libraries
|
# Include directories and libraries
|
||||||
include_directories(../../../Common)
|
include_directories(../../../Common)
|
||||||
|
|
||||||
|
find_package(NVSCI)
|
||||||
|
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
# Find the NVSCI libraries
|
if(NVSCI_FOUND)
|
||||||
# use CMAKE_LIBRARY_PATH so that users can also specify the NVSCI lib path in cmake command
|
|
||||||
set(CMAKE_LIBRARY_PATH "/usr/lib" ${CMAKE_LIBRARY_PATH})
|
|
||||||
foreach(LIBRARY_PATH ${CMAKE_LIBRARY_PATH})
|
|
||||||
file(GLOB_RECURSE NVSCIBUF_LIB
|
|
||||||
${LIBRARY_PATH}/libnvscibuf.so
|
|
||||||
${LIBRARY_PATH}/*/libnvscibuf.so
|
|
||||||
)
|
|
||||||
file(GLOB_RECURSE NVSCISYNC_LIB
|
|
||||||
${LIBRARY_PATH}/libnvscisync.so
|
|
||||||
${LIBRARY_PATH}/*/libnvscisync.so
|
|
||||||
)
|
|
||||||
if(NVSCIBUF_LIB AND NVSCISYNC_LIB)
|
|
||||||
break()
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
# Find the NVSCI header files
|
|
||||||
# use CMAKE_INCLUDE_PATH so that users can also specify the NVSCI include path in cmake command
|
|
||||||
set(CMAKE_INCLUDE_PATH "/usr/include" ${CMAKE_LIBRARY_PATH})
|
|
||||||
find_path(NVSCIBUF_INCLUDE_DIR nvscibuf.h PATHS ${CMAKE_INCLUDE_PATH})
|
|
||||||
find_path(NVSCISYNC_INCLUDE_DIR nvscisync.h PATHS ${CMAKE_INCLUDE_PATH})
|
|
||||||
|
|
||||||
if(NVSCIBUF_LIB AND NVSCISYNC_LIB AND NVSCIBUF_INCLUDE_DIR AND NVSCISYNC_INCLUDE_DIR)
|
|
||||||
message(STATUS "FOUND NVSCI libs: ${NVSCIBUF_LIB} ${NVSCISYNC_LIB}")
|
message(STATUS "FOUND NVSCI libs: ${NVSCIBUF_LIB} ${NVSCISYNC_LIB}")
|
||||||
message(STATUS "Using NVSCI headers path: ${NVSCIBUF_INCLUDE_DIR} ${NVSCIBUF_INCLUDE_DIR}")
|
message(STATUS "Using NVSCI headers path: ${NVSCIBUF_INCLUDE_DIR} ${NVSCIBUF_INCLUDE_DIR}")
|
||||||
# Source file
|
# Source file
|
||||||
@ -57,14 +36,12 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|||||||
|
|
||||||
target_include_directories(cudaNvSci PUBLIC
|
target_include_directories(cudaNvSci PUBLIC
|
||||||
${CUDAToolkit_INCLUDE_DIRS}
|
${CUDAToolkit_INCLUDE_DIRS}
|
||||||
${NVSCIBUF_INCLUDE_DIR}
|
${NVSCI_INCLUDE_DIRS}
|
||||||
${NVSCISYNC_INCLUDE_DIR}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(cudaNvSci
|
target_link_libraries(cudaNvSci
|
||||||
CUDA::cuda_driver
|
CUDA::cuda_driver
|
||||||
${NVSCIBUF_LIB}
|
${NVSCI_LIBRARIES}
|
||||||
${NVSCISYNC_LIB}
|
|
||||||
)
|
)
|
||||||
# Copy teapot1024.ppm to the output directory
|
# Copy teapot1024.ppm to the output directory
|
||||||
add_custom_command(TARGET cudaNvSci POST_BUILD
|
add_custom_command(TARGET cudaNvSci POST_BUILD
|
||||||
|
@ -27,25 +27,16 @@ target_compile_features(jitLto PRIVATE cxx_std_17 cuda_std_17)
|
|||||||
|
|
||||||
set_target_properties(jitLto PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
|
set_target_properties(jitLto PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
|
||||||
|
|
||||||
|
find_library(NVJITLINK_LIB
|
||||||
|
NAME nvJitLink
|
||||||
|
PATHS "${CUDAToolkit_LIBRARY_DIR}" "${CMAKE_LIBRARY_PATH}")
|
||||||
|
|
||||||
target_include_directories(jitLto PRIVATE
|
target_include_directories(jitLto PRIVATE
|
||||||
${CUDAToolkit_INCLUDE_DIRS}
|
${CUDAToolkit_INCLUDE_DIRS}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
target_link_libraries(jitLto PRIVATE
|
||||||
|
CUDA::cuda_driver
|
||||||
target_link_libraries(jitLto PRIVATE
|
CUDA::nvrtc
|
||||||
CUDA::cuda_driver
|
${NVJITLINK_LIB}
|
||||||
CUDA::nvrtc
|
)
|
||||||
)
|
|
||||||
|
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|
||||||
target_link_libraries(jitLto PRIVATE
|
|
||||||
${CUDAToolkit_LIBRARY_DIR}/libnvJitLink.so
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
|
||||||
target_link_libraries(jitLto PRIVATE
|
|
||||||
${CUDAToolkit_LIBRARY_DIR}/nvJitLink.lib
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
@ -28,9 +28,13 @@ include(CheckIncludeFile)
|
|||||||
check_include_file("GLFW/glfw3.h" HAVE_GLFW3_H)
|
check_include_file("GLFW/glfw3.h" HAVE_GLFW3_H)
|
||||||
|
|
||||||
# Find GLFW header and lib for Windows
|
# Find GLFW header and lib for Windows
|
||||||
if(WIN32)
|
if(WIN32 OR CMAKE_CROSSCOMPILING)
|
||||||
find_file(GLFW3_H "GLFW/glfw3.h" PATH "${GLFW_INCLUDE_DIR}")
|
set(GLFW_INCLUDE_DIRS "${GLFW_INCLUDE_DIR}" "${CMAKE_INCLUDE_PATH}")
|
||||||
find_library(GLFW3_LIB "glfw3" PATH "${GLFW_LIB_DIR}")
|
find_file(GLFW3_H "GLFW/glfw3.h" PATHS ${GLFW_INCLUDE_DIRS})
|
||||||
|
find_library(GLFW3_LIB
|
||||||
|
NAMES glfw3 glfw
|
||||||
|
PATHS "${GLFW_LIB_DIR}"
|
||||||
|
PATH_SUFFIXES lib lib64)
|
||||||
if(GLFW3_H AND GLFW3_LIB)
|
if(GLFW3_H AND GLFW3_LIB)
|
||||||
message(STATUS "Found GLFW/glfw3.h and GLFW library.")
|
message(STATUS "Found GLFW/glfw3.h and GLFW library.")
|
||||||
set(HAVE_GLFW3_H 1)
|
set(HAVE_GLFW3_H 1)
|
||||||
@ -58,9 +62,9 @@ if(${Vulkan_FOUND})
|
|||||||
${Vulkan_LIBRARIES}
|
${Vulkan_LIBRARIES}
|
||||||
OpenGL::GL
|
OpenGL::GL
|
||||||
)
|
)
|
||||||
if(WIN32)
|
if(WIN32 OR CMAKE_CROSSCOMPILING)
|
||||||
target_include_directories(simpleVulkan PUBLIC
|
target_include_directories(simpleVulkan PUBLIC
|
||||||
${GLFW_INCLUDE_DIR}
|
${GLFW_INCLUDE_DIRS}
|
||||||
)
|
)
|
||||||
target_link_libraries(simpleVulkan
|
target_link_libraries(simpleVulkan
|
||||||
${GLFW3_LIB}
|
${GLFW3_LIB}
|
||||||
|
@ -27,9 +27,13 @@ include(CheckIncludeFile)
|
|||||||
check_include_file("GLFW/glfw3.h" HAVE_GLFW3_H)
|
check_include_file("GLFW/glfw3.h" HAVE_GLFW3_H)
|
||||||
|
|
||||||
# Find GLFW header and lib for Windows
|
# Find GLFW header and lib for Windows
|
||||||
if(WIN32)
|
if(WIN32 OR CMAKE_CROSSCOMPILING)
|
||||||
find_file(GLFW3_H "GLFW/glfw3.h" PATH "${GLFW_INCLUDE_DIR}")
|
set(GLFW_INCLUDE_DIRS "${GLFW_INCLUDE_DIR}" "${CMAKE_INCLUDE_PATH}")
|
||||||
find_library(GLFW3_LIB "glfw3" PATH "${GLFW_LIB_DIR}")
|
find_file(GLFW3_H "GLFW/glfw3.h" PATHS ${GLFW_INCLUDE_DIRS})
|
||||||
|
find_library(GLFW3_LIB
|
||||||
|
NAMES glfw3 glfw
|
||||||
|
PATHS "${GLFW_LIB_DIR}"
|
||||||
|
PATH_SUFFIXES lib lib64)
|
||||||
if(GLFW3_H AND GLFW3_LIB)
|
if(GLFW3_H AND GLFW3_LIB)
|
||||||
message(STATUS "Found GLFW/glfw3.h and GLFW library.")
|
message(STATUS "Found GLFW/glfw3.h and GLFW library.")
|
||||||
set(HAVE_GLFW3_H 1)
|
set(HAVE_GLFW3_H 1)
|
||||||
@ -58,9 +62,9 @@ if(${Vulkan_FOUND})
|
|||||||
OpenGL::GL
|
OpenGL::GL
|
||||||
CUDA::cuda_driver
|
CUDA::cuda_driver
|
||||||
)
|
)
|
||||||
if(WIN32)
|
if(WIN32 OR CMAKE_CROSSCOMPILING)
|
||||||
target_include_directories(simpleVulkanMMAP PUBLIC
|
target_include_directories(simpleVulkanMMAP PUBLIC
|
||||||
${GLFW_INCLUDE_DIR}
|
${GLFW_INCLUDE_DIRS}
|
||||||
)
|
)
|
||||||
target_link_libraries(simpleVulkanMMAP
|
target_link_libraries(simpleVulkanMMAP
|
||||||
${GLFW3_LIB}
|
${GLFW3_LIB}
|
||||||
|
@ -27,9 +27,13 @@ include(CheckIncludeFile)
|
|||||||
check_include_file("GLFW/glfw3.h" HAVE_GLFW3_H)
|
check_include_file("GLFW/glfw3.h" HAVE_GLFW3_H)
|
||||||
|
|
||||||
# Find GLFW header and lib for Windows
|
# Find GLFW header and lib for Windows
|
||||||
if(WIN32)
|
if(WIN32 OR CMAKE_CROSSCOMPILING)
|
||||||
find_file(GLFW3_H "GLFW/glfw3.h" PATH "${GLFW_INCLUDE_DIR}")
|
set(GLFW_INCLUDE_DIRS "${GLFW_INCLUDE_DIR}" "${CMAKE_INCLUDE_PATH}")
|
||||||
find_file(GLFW3_LIB "glfw3" PATH "${GLFW_LIB_DIR}")
|
find_file(GLFW3_H "GLFW/glfw3.h" PATHS ${GLFW_INCLUDE_DIRS})
|
||||||
|
find_library(GLFW3_LIB
|
||||||
|
NAMES glfw3 glfw
|
||||||
|
PATHS "${GLFW_LIB_DIR}"
|
||||||
|
PATH_SUFFIXES lib lib64)
|
||||||
if(GLFW3_H AND GLFW3_LIB)
|
if(GLFW3_H AND GLFW3_LIB)
|
||||||
message(STATUS "Found GLFW/glfw3.h and GLFW library.")
|
message(STATUS "Found GLFW/glfw3.h and GLFW library.")
|
||||||
set(HAVE_GLFW3_H 1)
|
set(HAVE_GLFW3_H 1)
|
||||||
@ -57,9 +61,9 @@ if(${Vulkan_FOUND})
|
|||||||
${Vulkan_LIBRARIES}
|
${Vulkan_LIBRARIES}
|
||||||
OpenGL::GL
|
OpenGL::GL
|
||||||
)
|
)
|
||||||
if(WIN32)
|
if(WIN32 OR CMAKE_CROSSCOMPILING)
|
||||||
target_include_directories(vulkanImageCUDA PUBLIC
|
target_include_directories(vulkanImageCUDA PUBLIC
|
||||||
${GLFW_INCLUDE_DIR}
|
${GLFW_INCLUDE_DIRS}
|
||||||
)
|
)
|
||||||
target_link_libraries(vulkanImageCUDA
|
target_link_libraries(vulkanImageCUDA
|
||||||
${GLFW3_LIB}
|
${GLFW3_LIB}
|
||||||
|
@ -82,7 +82,12 @@ message(STATUS "Using libnvvm library: ${NVVM_LIB}")
|
|||||||
|
|
||||||
# Set the rpath to libnvvm.
|
# Set the rpath to libnvvm.
|
||||||
find_path(LIBNVVM_RPATH lib lib64 PATHS "$ENV{LIBNVVM_HOME}" "${CUDA_HOME}")
|
find_path(LIBNVVM_RPATH lib lib64 PATHS "$ENV{LIBNVVM_HOME}" "${CUDA_HOME}")
|
||||||
get_filename_component(LIBNVVM_RPATH ${NVVM_LIB} DIRECTORY)
|
if(DEFINED RUNTIME_LIBNVVM_PATH)
|
||||||
|
message(STATUS "Using RUNTIME_LIBNVVM_PATH: ${RUNTIME_LIBNVVM_PATH}")
|
||||||
|
set(LIBNVVM_RPATH ${RUNTIME_LIBNVVM_PATH})
|
||||||
|
else()
|
||||||
|
get_filename_component(LIBNVVM_RPATH ${NVVM_LIB} DIRECTORY)
|
||||||
|
endif()
|
||||||
set(CMAKE_INSTALL_RPATH "${LIBNVVM_RPATH}")
|
set(CMAKE_INSTALL_RPATH "${LIBNVVM_RPATH}")
|
||||||
message(STATUS "Using rpath: ${CMAKE_INSTALL_RPATH}")
|
message(STATUS "Using rpath: ${CMAKE_INSTALL_RPATH}")
|
||||||
|
|
||||||
|
@ -33,12 +33,18 @@ set_tests_properties(ptxgenTest PROPERTIES FIXTURES_SETUP PTXGENTEST)
|
|||||||
|
|
||||||
target_link_libraries(ptxgen ${NVVM_LIB})
|
target_link_libraries(ptxgen ${NVVM_LIB})
|
||||||
|
|
||||||
|
if (DEFINED RUNTIME_LIBNVVM_PATH)
|
||||||
|
get_filename_component(_LIBNVVM_HOME "${RUNTIME_LIBNVVM_PATH}" DIRECTORY)
|
||||||
|
else ()
|
||||||
|
set(_LIBNVVM_HOME "${LIBNVVM_HOME}")
|
||||||
|
endif ()
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
set_target_properties(ptxgen PROPERTIES
|
set_target_properties(ptxgen PROPERTIES
|
||||||
COMPILE_FLAGS "/wd4996 -DLIBNVVM_HOME=\"${LIBNVVM_HOME}\"")
|
COMPILE_FLAGS "/wd4996 -DLIBNVVM_HOME=\"${LIBNVVM_HOME}\"")
|
||||||
else (WIN32)
|
else (WIN32)
|
||||||
set_target_properties(ptxgen PROPERTIES
|
set_target_properties(ptxgen PROPERTIES
|
||||||
COMPILE_FLAGS "-DLIBNVVM_HOME=\"${LIBNVVM_HOME}\""
|
COMPILE_FLAGS "-DLIBNVVM_HOME=\"${_LIBNVVM_HOME}\""
|
||||||
LINK_FLAGS "-Wl,-rpath,${LIBNVVM_RPATH}")
|
LINK_FLAGS "-Wl,-rpath,${LIBNVVM_RPATH}")
|
||||||
endif (WIN32)
|
endif (WIN32)
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ endif()
|
|||||||
# Include directories and libraries
|
# Include directories and libraries
|
||||||
include_directories(../../../../Common)
|
include_directories(../../../../Common)
|
||||||
|
|
||||||
find_library(CUDLA_LIB cudla PATHS ${CUDAToolkit_LIBRARY_DIR})
|
find_library(CUDLA_LIB cudla PATHS ${CUDAToolkit_LIBRARY_DIR} ${CMAKE_LIBRARY_PATH})
|
||||||
|
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
if(CUDLA_LIB)
|
if(CUDLA_LIB)
|
||||||
|
@ -18,7 +18,7 @@ endif()
|
|||||||
# Include directories and libraries
|
# Include directories and libraries
|
||||||
include_directories(../../../../Common)
|
include_directories(../../../../Common)
|
||||||
|
|
||||||
find_library(CUDLA_LIB cudla PATHS ${CUDAToolkit_LIBRARY_DIR})
|
find_library(CUDLA_LIB cudla PATHS ${CUDAToolkit_LIBRARY_DIR} ${CMAKE_LIBRARY_PATH})
|
||||||
|
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
if(CUDLA_LIB)
|
if(CUDLA_LIB)
|
||||||
|
@ -18,7 +18,7 @@ endif()
|
|||||||
# Include directories and libraries
|
# Include directories and libraries
|
||||||
include_directories(../../../../Common)
|
include_directories(../../../../Common)
|
||||||
|
|
||||||
find_library(CUDLA_LIB cudla PATHS ${CUDAToolkit_LIBRARY_DIR})
|
find_library(CUDLA_LIB cudla PATHS ${CUDAToolkit_LIBRARY_DIR} ${CMAKE_LIBRARY_PATH})
|
||||||
|
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
if(CUDLA_LIB)
|
if(CUDLA_LIB)
|
||||||
|
@ -18,34 +18,12 @@ endif()
|
|||||||
# Include directories and libraries
|
# Include directories and libraries
|
||||||
include_directories(../../../../Common)
|
include_directories(../../../../Common)
|
||||||
|
|
||||||
find_library(CUDLA_LIB cudla PATHS ${CUDAToolkit_LIBRARY_DIR})
|
find_package(NVSCI)
|
||||||
|
find_library(CUDLA_LIB cudla PATHS ${CUDAToolkit_LIBRARY_DIR} ${CMAKE_LIBRARY_PATH})
|
||||||
|
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
if(CUDLA_LIB)
|
if(CUDLA_LIB)
|
||||||
# Find the NVSCI libraries
|
if(NVSCI_FOUND)
|
||||||
# use CMAKE_LIBRARY_PATH so that users can also specify the NVSCI lib path in cmake command
|
|
||||||
set(CMAKE_LIBRARY_PATH "/usr/lib" ${CMAKE_LIBRARY_PATH})
|
|
||||||
foreach(LIBRARY_PATH ${CMAKE_LIBRARY_PATH})
|
|
||||||
file(GLOB_RECURSE NVSCIBUF_LIB
|
|
||||||
${LIBRARY_PATH}/libnvscibuf.so
|
|
||||||
${LIBRARY_PATH}/*/libnvscibuf.so
|
|
||||||
)
|
|
||||||
file(GLOB_RECURSE NVSCISYNC_LIB
|
|
||||||
${LIBRARY_PATH}/libnvscisync.so
|
|
||||||
${LIBRARY_PATH}/*/libnvscisync.so
|
|
||||||
)
|
|
||||||
if(NVSCIBUF_LIB AND NVSCISYNC_LIB)
|
|
||||||
break()
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
# Find the NVSCI header files
|
|
||||||
# use CMAKE_INCLUDE_PATH so that users can also specify the NVSCI include path in cmake command
|
|
||||||
set(CMAKE_INCLUDE_PATH "/usr/include" ${CMAKE_LIBRARY_PATH})
|
|
||||||
find_path(NVSCIBUF_INCLUDE_DIR nvscibuf.h PATHS ${CMAKE_INCLUDE_PATH})
|
|
||||||
find_path(NVSCISYNC_INCLUDE_DIR nvscisync.h PATHS ${CMAKE_INCLUDE_PATH})
|
|
||||||
|
|
||||||
if(NVSCIBUF_LIB AND NVSCISYNC_LIB AND NVSCIBUF_INCLUDE_DIR AND NVSCISYNC_INCLUDE_DIR)
|
|
||||||
# Source file
|
# Source file
|
||||||
# Add target for cuDLALayerwiseStatsStandalone
|
# Add target for cuDLALayerwiseStatsStandalone
|
||||||
add_executable(cuDLALayerwiseStatsStandalone main.cpp)
|
add_executable(cuDLALayerwiseStatsStandalone main.cpp)
|
||||||
@ -58,14 +36,12 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|||||||
|
|
||||||
target_include_directories(cuDLALayerwiseStatsStandalone PUBLIC
|
target_include_directories(cuDLALayerwiseStatsStandalone PUBLIC
|
||||||
${CUDAToolkit_INCLUDE_DIRS}
|
${CUDAToolkit_INCLUDE_DIRS}
|
||||||
${NVSCIBUF_INCLUDE_DIR}
|
${NVSCI_INCLUDE_DIRS}
|
||||||
${NVSCISYNC_INCLUDE_DIR}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(cuDLALayerwiseStatsStandalone
|
target_link_libraries(cuDLALayerwiseStatsStandalone
|
||||||
${CUDLA_LIB}
|
${CUDLA_LIB}
|
||||||
${NVSCIBUF_LIB}
|
${NVSCI_LIBRARIES}
|
||||||
${NVSCISYNC_LIB}
|
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
message(STATUS "NvSCI not found - will not build sample 'cuDLALayerwiseStatsStandalone'")
|
message(STATUS "NvSCI not found - will not build sample 'cuDLALayerwiseStatsStandalone'")
|
||||||
|
@ -18,34 +18,12 @@ endif()
|
|||||||
# Include directories and libraries
|
# Include directories and libraries
|
||||||
include_directories(../../../../Common)
|
include_directories(../../../../Common)
|
||||||
|
|
||||||
find_library(CUDLA_LIB cudla PATHS ${CUDAToolkit_LIBRARY_DIR})
|
find_package(NVSCI)
|
||||||
|
find_library(CUDLA_LIB cudla PATHS ${CUDAToolkit_LIBRARY_DIR} ${CMAKE_LIBRARY_PATH})
|
||||||
|
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
if(CUDLA_LIB)
|
if(CUDLA_LIB)
|
||||||
# Find the NVSCI libraries
|
if(NVSCI_FOUND)
|
||||||
# use CMAKE_LIBRARY_PATH so that users can also specify the NVSCI lib path in cmake command
|
|
||||||
set(CMAKE_LIBRARY_PATH "/usr/lib" ${CMAKE_LIBRARY_PATH})
|
|
||||||
foreach(LIBRARY_PATH ${CMAKE_LIBRARY_PATH})
|
|
||||||
file(GLOB_RECURSE NVSCIBUF_LIB
|
|
||||||
${LIBRARY_PATH}/libnvscibuf.so
|
|
||||||
${LIBRARY_PATH}/*/libnvscibuf.so
|
|
||||||
)
|
|
||||||
file(GLOB_RECURSE NVSCISYNC_LIB
|
|
||||||
${LIBRARY_PATH}/libnvscisync.so
|
|
||||||
${LIBRARY_PATH}/*/libnvscisync.so
|
|
||||||
)
|
|
||||||
if(NVSCIBUF_LIB AND NVSCISYNC_LIB)
|
|
||||||
break()
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
# Find the NVSCI header files
|
|
||||||
# use CMAKE_INCLUDE_PATH so that users can also specify the NVSCI include path in cmake command
|
|
||||||
set(CMAKE_INCLUDE_PATH "/usr/include" ${CMAKE_LIBRARY_PATH})
|
|
||||||
find_path(NVSCIBUF_INCLUDE_DIR nvscibuf.h PATHS ${CMAKE_INCLUDE_PATH})
|
|
||||||
find_path(NVSCISYNC_INCLUDE_DIR nvscisync.h PATHS ${CMAKE_INCLUDE_PATH})
|
|
||||||
|
|
||||||
if(NVSCIBUF_LIB AND NVSCISYNC_LIB AND NVSCIBUF_INCLUDE_DIR AND NVSCISYNC_INCLUDE_DIR)
|
|
||||||
# Source file
|
# Source file
|
||||||
# Add target for cuDLAStandaloneMode
|
# Add target for cuDLAStandaloneMode
|
||||||
add_executable(cuDLAStandaloneMode main.cpp)
|
add_executable(cuDLAStandaloneMode main.cpp)
|
||||||
@ -58,14 +36,12 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|||||||
|
|
||||||
target_include_directories(cuDLAStandaloneMode PUBLIC
|
target_include_directories(cuDLAStandaloneMode PUBLIC
|
||||||
${CUDAToolkit_INCLUDE_DIRS}
|
${CUDAToolkit_INCLUDE_DIRS}
|
||||||
${NVSCIBUF_INCLUDE_DIR}
|
${NVSCI_INCLUDE_DIRS}
|
||||||
${NVSCISYNC_INCLUDE_DIR}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(cuDLAStandaloneMode
|
target_link_libraries(cuDLAStandaloneMode
|
||||||
${CUDLA_LIB}
|
${CUDLA_LIB}
|
||||||
${NVSCIBUF_LIB}
|
${NVSCI_LIBRARIES}
|
||||||
${NVSCISYNC_LIB}
|
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
message(STATUS "NvSCI not found - will not build sample 'cuDLAStandaloneMode'")
|
message(STATUS "NvSCI not found - will not build sample 'cuDLAStandaloneMode'")
|
||||||
|
@ -18,33 +18,10 @@ endif()
|
|||||||
# Include directories and libraries
|
# Include directories and libraries
|
||||||
include_directories(../../../../Common)
|
include_directories(../../../../Common)
|
||||||
|
|
||||||
|
find_package(NVSCI)
|
||||||
|
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
# Find the NVSCI libraries
|
if(NVSCI_FOUND)
|
||||||
# use CMAKE_LIBRARY_PATH so that users can also specify the NVSCI lib path in cmake command
|
|
||||||
set(CMAKE_LIBRARY_PATH "/usr/lib" ${CMAKE_LIBRARY_PATH})
|
|
||||||
foreach(LIBRARY_PATH ${CMAKE_LIBRARY_PATH})
|
|
||||||
file(GLOB_RECURSE NVSCIBUF_LIB
|
|
||||||
${LIBRARY_PATH}/libnvscibuf.so
|
|
||||||
${LIBRARY_PATH}/*/libnvscibuf.so
|
|
||||||
)
|
|
||||||
file(GLOB_RECURSE NVSCISYNC_LIB
|
|
||||||
${LIBRARY_PATH}/libnvscisync.so
|
|
||||||
${LIBRARY_PATH}/*/libnvscisync.so
|
|
||||||
)
|
|
||||||
if(NVSCIBUF_LIB AND NVSCISYNC_LIB)
|
|
||||||
break()
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
# Find the NVSCI header files
|
|
||||||
# use CMAKE_INCLUDE_PATH so that users can also specify the NVSCI include path in cmake command
|
|
||||||
set(CMAKE_INCLUDE_PATH "/usr/include" ${CMAKE_LIBRARY_PATH})
|
|
||||||
find_path(NVSCIBUF_INCLUDE_DIR nvscibuf.h PATHS ${CMAKE_INCLUDE_PATH})
|
|
||||||
find_path(NVSCISYNC_INCLUDE_DIR nvscisync.h PATHS ${CMAKE_INCLUDE_PATH})
|
|
||||||
|
|
||||||
if(NVSCIBUF_LIB AND NVSCISYNC_LIB AND NVSCIBUF_INCLUDE_DIR AND NVSCISYNC_INCLUDE_DIR)
|
|
||||||
message(STATUS "FOUND NVSCI libs: ${NVSCIBUF_LIB} ${NVSCISYNC_LIB}")
|
|
||||||
message(STATUS "Using NVSCI headers path: ${NVSCIBUF_INCLUDE_DIR} ${NVSCIBUF_INCLUDE_DIR}")
|
|
||||||
# Source file
|
# Source file
|
||||||
# Add target for cudaNvSciBufMultiplanar
|
# Add target for cudaNvSciBufMultiplanar
|
||||||
add_executable(cudaNvSciBufMultiplanar imageKernels.cu cudaNvSciBufMultiplanar.cpp main.cpp)
|
add_executable(cudaNvSciBufMultiplanar imageKernels.cu cudaNvSciBufMultiplanar.cpp main.cpp)
|
||||||
@ -57,14 +34,12 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|||||||
|
|
||||||
target_include_directories(cudaNvSciBufMultiplanar PUBLIC
|
target_include_directories(cudaNvSciBufMultiplanar PUBLIC
|
||||||
${CUDAToolkit_INCLUDE_DIRS}
|
${CUDAToolkit_INCLUDE_DIRS}
|
||||||
${NVSCIBUF_INCLUDE_DIR}
|
${NVSCI_INCLUDE_DIRS}
|
||||||
${NVSCISYNC_INCLUDE_DIR}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(cudaNvSciBufMultiplanar
|
target_link_libraries(cudaNvSciBufMultiplanar
|
||||||
CUDA::cuda_driver
|
CUDA::cuda_driver
|
||||||
${NVSCIBUF_LIB}
|
${NVSCI_LIBRARIES}
|
||||||
${NVSCISYNC_LIB}
|
|
||||||
)
|
)
|
||||||
# Copy yuv_planar_img1.yuv to the output directory
|
# Copy yuv_planar_img1.yuv to the output directory
|
||||||
add_custom_command(TARGET cudaNvSciBufMultiplanar POST_BUILD
|
add_custom_command(TARGET cudaNvSciBufMultiplanar POST_BUILD
|
||||||
|
@ -18,24 +18,18 @@ endif()
|
|||||||
# Include directories and libraries
|
# Include directories and libraries
|
||||||
include_directories(../../../../Common)
|
include_directories(../../../../Common)
|
||||||
|
|
||||||
|
find_package(NVSCI)
|
||||||
|
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
# Find the NVSCI/NVMEDIA libraries
|
# Find the NVSCI/NVMEDIA libraries
|
||||||
# use CMAKE_LIBRARY_PATH so that users can also specify the NVSCI lib path in cmake command
|
# use CMAKE_LIBRARY_PATH so that users can also specify the NVSCI lib path in cmake command
|
||||||
set(CMAKE_LIBRARY_PATH "/usr/lib" ${CMAKE_LIBRARY_PATH})
|
set(CMAKE_LIBRARY_PATH "/usr/lib" ${CMAKE_LIBRARY_PATH})
|
||||||
foreach(LIBRARY_PATH ${CMAKE_LIBRARY_PATH})
|
foreach(LIBRARY_PATH ${CMAKE_LIBRARY_PATH})
|
||||||
file(GLOB_RECURSE NVSCIBUF_LIB
|
|
||||||
${LIBRARY_PATH}/libnvscibuf.so
|
|
||||||
${LIBRARY_PATH}/*/libnvscibuf.so
|
|
||||||
)
|
|
||||||
file(GLOB_RECURSE NVSCISYNC_LIB
|
|
||||||
${LIBRARY_PATH}/libnvscisync.so
|
|
||||||
${LIBRARY_PATH}/*/libnvscisync.so
|
|
||||||
)
|
|
||||||
file(GLOB_RECURSE NVMEDIA_LIB
|
file(GLOB_RECURSE NVMEDIA_LIB
|
||||||
${LIBRARY_PATH}/libnvmedia.so
|
${LIBRARY_PATH}/libnvmedia.so
|
||||||
${LIBRARY_PATH}/*/libnvmedia.so
|
${LIBRARY_PATH}/*/libnvmedia.so
|
||||||
)
|
)
|
||||||
if(NVSCIBUF_LIB AND NVSCISYNC_LIB AND NVMEDIA_LIB)
|
if(NVMEDIA_LIB)
|
||||||
break()
|
break()
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
@ -47,13 +41,9 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|||||||
"/usr/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu/include"
|
"/usr/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu/include"
|
||||||
${CMAKE_LIBRARY_PATH}
|
${CMAKE_LIBRARY_PATH}
|
||||||
)
|
)
|
||||||
find_path(NVSCIBUF_INCLUDE_DIR nvscibuf.h PATHS ${CMAKE_INCLUDE_PATH})
|
|
||||||
find_path(NVSCISYNC_INCLUDE_DIR nvscisync.h PATHS ${CMAKE_INCLUDE_PATH})
|
|
||||||
find_path(NVMEDIA_INCLUDE_DIR nvmedia_core.h PATHS ${CMAKE_INCLUDE_PATH})
|
find_path(NVMEDIA_INCLUDE_DIR nvmedia_core.h PATHS ${CMAKE_INCLUDE_PATH})
|
||||||
|
|
||||||
if(NVSCIBUF_LIB AND NVSCISYNC_LIB AND NVSCIBUF_INCLUDE_DIR AND NVSCISYNC_INCLUDE_DIR)
|
if(NVSCI_FOUND)
|
||||||
message(STATUS "FOUND NVSCI libs: ${NVSCIBUF_LIB} ${NVSCISYNC_LIB}")
|
|
||||||
message(STATUS "Using NVSCI headers path: ${NVSCIBUF_INCLUDE_DIR} ${NVSCIBUF_INCLUDE_DIR}")
|
|
||||||
if(NVMEDIA_LIB AND NVMEDIA_INCLUDE_DIR)
|
if(NVMEDIA_LIB AND NVMEDIA_INCLUDE_DIR)
|
||||||
message(STATUS "FOUND NVMEDIA libs: ${NVMEDIA_LIB}")
|
message(STATUS "FOUND NVMEDIA libs: ${NVMEDIA_LIB}")
|
||||||
message(STATUS "Using NVMEDIA headers path: ${NVMEDIA_INCLUDE_DIR}")
|
message(STATUS "Using NVMEDIA headers path: ${NVMEDIA_INCLUDE_DIR}")
|
||||||
@ -69,15 +59,13 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|||||||
|
|
||||||
target_include_directories(cudaNvSciNvMedia PUBLIC
|
target_include_directories(cudaNvSciNvMedia PUBLIC
|
||||||
${CUDAToolkit_INCLUDE_DIRS}
|
${CUDAToolkit_INCLUDE_DIRS}
|
||||||
${NVSCIBUF_INCLUDE_DIR}
|
${NVSCI_INCLUDE_DIRS}
|
||||||
${NVSCISYNC_INCLUDE_DIR}
|
|
||||||
${NVMEDIA_INCLUDE_DIR}
|
${NVMEDIA_INCLUDE_DIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(cudaNvSciNvMedia
|
target_link_libraries(cudaNvSciNvMedia
|
||||||
CUDA::cuda_driver
|
CUDA::cuda_driver
|
||||||
${NVSCIBUF_LIB}
|
${NVSCI_LIBRARIES}
|
||||||
${NVSCISYNC_LIB}
|
|
||||||
${NVMEDIA_LIB}
|
${NVMEDIA_LIB}
|
||||||
)
|
)
|
||||||
# Copy teapot.rgba to the output directory
|
# Copy teapot.rgba to the output directory
|
||||||
|
@ -26,7 +26,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|||||||
if(${OpenGL_FOUND})
|
if(${OpenGL_FOUND})
|
||||||
if(${EGL_FOUND})
|
if(${EGL_FOUND})
|
||||||
if(${X11_FOUND})
|
if(${X11_FOUND})
|
||||||
set(DRM_INCLUDE_PATH "/usr/include/drm" "/usr/include/libdrm")
|
set(DRM_INCLUDE_PATH "/usr/include/drm" "/usr/include/libdrm" ${CMAKE_INCLUDE_PATH})
|
||||||
|
|
||||||
# use CMAKE_LIBRARY_PATH so that users can also specify the NVSCI lib path in cmake command
|
# use CMAKE_LIBRARY_PATH so that users can also specify the NVSCI lib path in cmake command
|
||||||
set(CMAKE_LIBRARY_PATH "/usr/lib/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu" ${CMAKE_LIBRARY_PATH})
|
set(CMAKE_LIBRARY_PATH "/usr/lib/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu" ${CMAKE_LIBRARY_PATH})
|
||||||
|
@ -4,7 +4,7 @@ find_path(FreeImage_INCLUDE_DIR
|
|||||||
)
|
)
|
||||||
|
|
||||||
find_library(FreeImage_LIBRARY
|
find_library(FreeImage_LIBRARY
|
||||||
NAMES freeimage
|
NAMES freeimage FreeImage
|
||||||
PATHS /usr/lib /usr/local/lib
|
PATHS /usr/lib /usr/local/lib
|
||||||
)
|
)
|
||||||
|
|
||||||
|
61
cmake/Modules/FindNVSCI.cmake
Normal file
61
cmake/Modules/FindNVSCI.cmake
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
# Find the NVSCI libraries and headers
|
||||||
|
#
|
||||||
|
# This module defines the following variables:
|
||||||
|
# NVSCI_FOUND - True if NVSCI was found
|
||||||
|
# NVSCI_INCLUDE_DIRS - NVSCI include directories
|
||||||
|
# NVSCI_LIBRARIES - NVSCI libraries
|
||||||
|
# NVSCIBUF_LIBRARY - NVSCI buffer library
|
||||||
|
# NVSCISYNC_LIBRARY - NVSCI sync library
|
||||||
|
|
||||||
|
# Find the libraries
|
||||||
|
find_library(NVSCIBUF_LIBRARY
|
||||||
|
NAMES nvscibuf libnvscibuf
|
||||||
|
PATHS
|
||||||
|
/usr/lib
|
||||||
|
/usr/lib/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu
|
||||||
|
PATH_SUFFIXES nvidia
|
||||||
|
)
|
||||||
|
|
||||||
|
find_library(NVSCISYNC_LIBRARY
|
||||||
|
NAMES nvscisync libnvscisync
|
||||||
|
PATHS
|
||||||
|
$/usr/lib
|
||||||
|
$/usr/lib/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu
|
||||||
|
PATH_SUFFIXES nvidia
|
||||||
|
)
|
||||||
|
|
||||||
|
# Find the header files
|
||||||
|
find_path(NVSCIBUF_INCLUDE_DIR
|
||||||
|
NAMES nvscibuf.h
|
||||||
|
PATHS
|
||||||
|
/usr/include
|
||||||
|
/usr/local/include
|
||||||
|
)
|
||||||
|
|
||||||
|
find_path(NVSCISYNC_INCLUDE_DIR
|
||||||
|
NAMES nvscisync.h
|
||||||
|
PATHS
|
||||||
|
/usr/include
|
||||||
|
/usr/local/include
|
||||||
|
)
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(NVSCI
|
||||||
|
REQUIRED_VARS
|
||||||
|
NVSCIBUF_LIBRARY
|
||||||
|
NVSCISYNC_LIBRARY
|
||||||
|
NVSCIBUF_INCLUDE_DIR
|
||||||
|
NVSCISYNC_INCLUDE_DIR
|
||||||
|
)
|
||||||
|
|
||||||
|
if(NVSCI_FOUND)
|
||||||
|
set(NVSCI_LIBRARIES ${NVSCIBUF_LIBRARY} ${NVSCISYNC_LIBRARY})
|
||||||
|
set(NVSCI_INCLUDE_DIRS ${NVSCIBUF_INCLUDE_DIR} ${NVSCISYNC_INCLUDE_DIR})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
mark_as_advanced(
|
||||||
|
NVSCIBUF_LIBRARY
|
||||||
|
NVSCISYNC_LIBRARY
|
||||||
|
NVSCIBUF_INCLUDE_DIR
|
||||||
|
NVSCISYNC_INCLUDE_DIR
|
||||||
|
)
|
59
cmake/toolchains/toolchain-aarch64-linux.cmake
Normal file
59
cmake/toolchains/toolchain-aarch64-linux.cmake
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
set(CMAKE_SYSTEM_NAME Linux)
|
||||||
|
set(CMAKE_SYSTEM_PROCESSOR aarch64)
|
||||||
|
|
||||||
|
# Specify the cross-compilers
|
||||||
|
set(CMAKE_C_COMPILER aarch64-linux-gnu-gcc)
|
||||||
|
set(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++)
|
||||||
|
set(CMAKE_AR aarch64-linux-gnu-ar)
|
||||||
|
set(CMAKE_RANLIB aarch64-linux-gnu-ranlib)
|
||||||
|
|
||||||
|
# Indicate cross-compiling.
|
||||||
|
set(CMAKE_CROSSCOMPILING TRUE)
|
||||||
|
|
||||||
|
# Set CUDA compiler flags
|
||||||
|
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -ccbin ${CMAKE_CXX_COMPILER}" CACHE STRING "" FORCE)
|
||||||
|
|
||||||
|
# Use a local sysroot copy
|
||||||
|
if(DEFINED TARGET_FS)
|
||||||
|
set(CMAKE_SYSROOT "${TARGET_FS}")
|
||||||
|
list(APPEND CMAKE_FIND_ROOT_PATH
|
||||||
|
"/usr/local/cuda/targets/aarch64-linux"
|
||||||
|
)
|
||||||
|
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||||
|
|
||||||
|
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Xcompiler --sysroot=${TARGET_FS}")
|
||||||
|
|
||||||
|
set(LIB_PATHS
|
||||||
|
"${TARGET_FS}/usr/lib/"
|
||||||
|
"${TARGET_FS}/usr/lib/aarch64-linux-gnu"
|
||||||
|
"${TARGET_FS}/usr/lib/aarch64-linux-gnu/nvidia"
|
||||||
|
)
|
||||||
|
# Add rpath-link flags for all library paths
|
||||||
|
foreach(lib_path ${LIB_PATHS})
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath-link,${lib_path}")
|
||||||
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-rpath-link,${lib_path}")
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
# Add the real path of CUDA installation on TARGET_FS for nvvm
|
||||||
|
find_program(TARGET_CUDA_NVCC_PATH nvcc
|
||||||
|
PATH "${TARGET_FS}/usr/local/cuda/bin"
|
||||||
|
NO_DEFAULT_PATH
|
||||||
|
NO_CMAKE_PATH
|
||||||
|
)
|
||||||
|
if(TARGET_CUDA_NVCC_PATH)
|
||||||
|
# Get the real path of CUDA installation on TARGET_FS
|
||||||
|
get_filename_component(TARGET_CUDA_PATH "${TARGET_CUDA_NVCC_PATH}" REALPATH)
|
||||||
|
get_filename_component(TARGET_CUDA_ROOT "${TARGET_CUDA_PATH}" DIRECTORY)
|
||||||
|
get_filename_component(TARGET_CUDA_ROOT "${TARGET_CUDA_ROOT}" DIRECTORY)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (DEFINED TARGET_CUDA_ROOT)
|
||||||
|
list(APPEND CMAKE_LIBRARY_PATH "${TARGET_CUDA_ROOT}/targets/aarch64-linux/lib")
|
||||||
|
# Define NVVM paths for build and runtime
|
||||||
|
set(ENV{LIBNVVM_HOME} "${TARGET_CUDA_ROOT}")
|
||||||
|
set(RUNTIME_LIBNVVM_PATH "${TARGET_CUDA_ROOT}/nvvm/lib64")
|
||||||
|
endif()
|
||||||
|
endif()
|
Loading…
x
Reference in New Issue
Block a user