mirror of
https://github.com/NVIDIA/cuda-samples.git
synced 2025-07-02 05:10:31 +08:00
Merge pull request #6 from jnbntz/aarch64_guarding
Changes for building for aarch64, specifically jetson orin nano
This commit is contained in:
commit
450038ea73
@ -22,6 +22,9 @@ find_package(GLUT)
|
|||||||
# Source file
|
# Source file
|
||||||
if(${OpenGL_FOUND})
|
if(${OpenGL_FOUND})
|
||||||
if (${GLUT_FOUND})
|
if (${GLUT_FOUND})
|
||||||
|
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
|
||||||
|
message(STATUS "Will not build sample simpleCUDA2GL - not supported on aarch64")
|
||||||
|
else()
|
||||||
# Add target for simpleCUDA2GL
|
# Add target for simpleCUDA2GL
|
||||||
add_executable(simpleCUDA2GL simpleCUDA2GL.cu main.cpp)
|
add_executable(simpleCUDA2GL simpleCUDA2GL.cu main.cpp)
|
||||||
|
|
||||||
@ -41,6 +44,7 @@ target_compile_features(simpleCUDA2GL PRIVATE cxx_std_17 cuda_std_17)
|
|||||||
${OPENGL_LIBRARIES}
|
${OPENGL_LIBRARIES}
|
||||||
${GLUT_LIBRARIES}
|
${GLUT_LIBRARIES}
|
||||||
)
|
)
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
message(STATUS "GLUT not found - will not build sample 'simpleCUDA2GL'")
|
message(STATUS "GLUT not found - will not build sample 'simpleCUDA2GL'")
|
||||||
endif()
|
endif()
|
||||||
|
@ -16,6 +16,9 @@ endif()
|
|||||||
# Include directories and libraries
|
# Include directories and libraries
|
||||||
include_directories(../../../Common)
|
include_directories(../../../Common)
|
||||||
|
|
||||||
|
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
|
||||||
|
message(STATUS "Will not build sample simpleIPC - not supported on aarch64")
|
||||||
|
else()
|
||||||
# Source file
|
# Source file
|
||||||
# Add target for simpleIPC
|
# Add target for simpleIPC
|
||||||
add_executable(simpleIPC simpleIPC.cu ../../../Common/helper_multiprocess.cpp)
|
add_executable(simpleIPC simpleIPC.cu ../../../Common/helper_multiprocess.cpp)
|
||||||
@ -25,3 +28,4 @@ target_compile_options(simpleIPC PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-l
|
|||||||
target_compile_features(simpleIPC PRIVATE cxx_std_17 cuda_std_17)
|
target_compile_features(simpleIPC PRIVATE cxx_std_17 cuda_std_17)
|
||||||
|
|
||||||
set_target_properties(simpleIPC PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
|
set_target_properties(simpleIPC PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
|
||||||
|
endif()
|
@ -18,6 +18,9 @@ include_directories(../../../Common)
|
|||||||
|
|
||||||
# Source file
|
# Source file
|
||||||
# Add target for simpleP2P
|
# Add target for simpleP2P
|
||||||
|
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
|
||||||
|
message(STATUS "Will not build sample simpleP2P - not supported on aarch64")
|
||||||
|
else()
|
||||||
add_executable(simpleP2P simpleP2P.cu)
|
add_executable(simpleP2P simpleP2P.cu)
|
||||||
|
|
||||||
target_compile_options(simpleP2P PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
|
target_compile_options(simpleP2P PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
|
||||||
@ -25,3 +28,4 @@ target_compile_options(simpleP2P PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-l
|
|||||||
target_compile_features(simpleP2P PRIVATE cxx_std_17 cuda_std_17)
|
target_compile_features(simpleP2P PRIVATE cxx_std_17 cuda_std_17)
|
||||||
|
|
||||||
set_target_properties(simpleP2P PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
|
set_target_properties(simpleP2P PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
|
||||||
|
endif()
|
@ -16,6 +16,9 @@ endif()
|
|||||||
# Include directories and libraries
|
# Include directories and libraries
|
||||||
include_directories(../../../Common)
|
include_directories(../../../Common)
|
||||||
|
|
||||||
|
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
|
||||||
|
message(STATUS "Will not build sample systemWideAtomics - not supported on aarch64")
|
||||||
|
else()
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
# Source file
|
# Source file
|
||||||
# Add target for systemWideAtomics
|
# Add target for systemWideAtomics
|
||||||
@ -30,3 +33,4 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|||||||
else()
|
else()
|
||||||
message(STATUS "Will not build sample systemWideAtomics - requires Linux OS")
|
message(STATUS "Will not build sample systemWideAtomics - requires Linux OS")
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
@ -18,6 +18,9 @@ include_directories(../../../Common)
|
|||||||
|
|
||||||
# Source file
|
# Source file
|
||||||
# Add target for vectorAddMMAP
|
# Add target for vectorAddMMAP
|
||||||
|
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
|
||||||
|
message(STATUS "Will not build sample vectorAddMMAP - not supported on aarch64")
|
||||||
|
else()
|
||||||
add_executable(vectorAddMMAP vectorAddMMAP.cpp multidevicealloc_memmap.cpp)
|
add_executable(vectorAddMMAP vectorAddMMAP.cpp multidevicealloc_memmap.cpp)
|
||||||
|
|
||||||
target_compile_options(vectorAddMMAP PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
|
target_compile_options(vectorAddMMAP PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
|
||||||
@ -48,3 +51,4 @@ add_custom_target(generate_fatbin_vectorAddMMAP ALL DEPENDS ${CUDA_FATBIN_FILE})
|
|||||||
|
|
||||||
# Ensure matrixMulDrv depends on the fatbin
|
# Ensure matrixMulDrv depends on the fatbin
|
||||||
add_dependencies(vectorAddMMAP generate_fatbin_vectorAddMMAP)
|
add_dependencies(vectorAddMMAP generate_fatbin_vectorAddMMAP)
|
||||||
|
endif()
|
@ -16,6 +16,9 @@ endif()
|
|||||||
# Include directories and libraries
|
# Include directories and libraries
|
||||||
include_directories(../../../Common)
|
include_directories(../../../Common)
|
||||||
|
|
||||||
|
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
|
||||||
|
message(STATUS "Will not build sample topologyQuery - not supported on aarch64")
|
||||||
|
else()
|
||||||
# Source file
|
# Source file
|
||||||
# Add target for topologyQuery
|
# Add target for topologyQuery
|
||||||
add_executable(topologyQuery topologyQuery.cu)
|
add_executable(topologyQuery topologyQuery.cu)
|
||||||
@ -25,3 +28,4 @@ target_compile_options(topologyQuery PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extend
|
|||||||
target_compile_features(topologyQuery PRIVATE cxx_std_17 cuda_std_17)
|
target_compile_features(topologyQuery PRIVATE cxx_std_17 cuda_std_17)
|
||||||
|
|
||||||
set_target_properties(topologyQuery PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
|
set_target_properties(topologyQuery PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
|
||||||
|
endif()
|
@ -19,6 +19,9 @@ include_directories(../../../Common)
|
|||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
# Source file
|
# Source file
|
||||||
# Add target for streamOrderedAllocationIPC
|
# Add target for streamOrderedAllocationIPC
|
||||||
|
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
|
||||||
|
message(STATUS "Will not build sample streamOrderedAllocationIPC - not supported on aarch64")
|
||||||
|
else()
|
||||||
add_executable(streamOrderedAllocationIPC streamOrderedAllocationIPC.cu ../../../Common/helper_multiprocess.cpp)
|
add_executable(streamOrderedAllocationIPC streamOrderedAllocationIPC.cu ../../../Common/helper_multiprocess.cpp)
|
||||||
|
|
||||||
target_compile_options(streamOrderedAllocationIPC PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
|
target_compile_options(streamOrderedAllocationIPC PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
|
||||||
@ -30,6 +33,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|||||||
target_link_libraries(streamOrderedAllocationIPC PUBLIC
|
target_link_libraries(streamOrderedAllocationIPC PUBLIC
|
||||||
CUDA::cuda_driver
|
CUDA::cuda_driver
|
||||||
)
|
)
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
message(STATUS "Will not build sample streamOrderedAllocationIPC - requires Linux OS")
|
message(STATUS "Will not build sample streamOrderedAllocationIPC - requires Linux OS")
|
||||||
endif()
|
endif()
|
||||||
|
@ -19,6 +19,9 @@ include_directories(../../../Common)
|
|||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
# Source file
|
# Source file
|
||||||
# Add target for StreamPriorities
|
# Add target for StreamPriorities
|
||||||
|
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
|
||||||
|
message(STATUS "Will not build sample streamPriorities - not supported on aarch64")
|
||||||
|
else()
|
||||||
add_executable(StreamPriorities StreamPriorities.cu)
|
add_executable(StreamPriorities StreamPriorities.cu)
|
||||||
|
|
||||||
target_compile_options(StreamPriorities PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
|
target_compile_options(StreamPriorities PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
|
||||||
@ -26,6 +29,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|||||||
target_compile_features(StreamPriorities PRIVATE cxx_std_17 cuda_std_17)
|
target_compile_features(StreamPriorities PRIVATE cxx_std_17 cuda_std_17)
|
||||||
|
|
||||||
set_target_properties(StreamPriorities PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
|
set_target_properties(StreamPriorities PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
message(STATUS "Will not build sample StreamPriorities - requires Linux OS")
|
message(STATUS "Will not build sample StreamPriorities - requires Linux OS")
|
||||||
endif()
|
endif()
|
||||||
|
@ -8,7 +8,12 @@ find_package(CUDAToolkit REQUIRED)
|
|||||||
|
|
||||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||||
|
|
||||||
|
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
|
||||||
|
set(CMAKE_CUDA_ARCHITECTURES 61 70 75 80 86 87 90)
|
||||||
|
else()
|
||||||
set(CMAKE_CUDA_ARCHITECTURES 50 52 60 61 70 75 80 86 89 90)
|
set(CMAKE_CUDA_ARCHITECTURES 50 52 60 61 70 75 80 86 89 90)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
# set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -G") # enable cuda-gdb (expensive)
|
# set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -G") # enable cuda-gdb (expensive)
|
||||||
endif()
|
endif()
|
||||||
|
@ -8,7 +8,12 @@ find_package(CUDAToolkit REQUIRED)
|
|||||||
|
|
||||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||||
|
|
||||||
|
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
|
||||||
|
set(CMAKE_CUDA_ARCHITECTURES 61 70 75 80 86 87 90)
|
||||||
|
else()
|
||||||
set(CMAKE_CUDA_ARCHITECTURES 50 52 60 61 70 75 80 86 89 90)
|
set(CMAKE_CUDA_ARCHITECTURES 50 52 60 61 70 75 80 86 89 90)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
# set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -G") # enable cuda-gdb (expensive)
|
# set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -G") # enable cuda-gdb (expensive)
|
||||||
endif()
|
endif()
|
||||||
|
@ -8,7 +8,12 @@ find_package(CUDAToolkit REQUIRED)
|
|||||||
|
|
||||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||||
|
|
||||||
|
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
|
||||||
|
set(CMAKE_CUDA_ARCHITECTURES 61 70 75 80 86 87 90)
|
||||||
|
else()
|
||||||
set(CMAKE_CUDA_ARCHITECTURES 50 52 60 61 70 75 80 86 89 90)
|
set(CMAKE_CUDA_ARCHITECTURES 50 52 60 61 70 75 80 86 89 90)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
# set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -G") # enable cuda-gdb (expensive)
|
# set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -G") # enable cuda-gdb (expensive)
|
||||||
endif()
|
endif()
|
||||||
|
@ -8,7 +8,12 @@ find_package(CUDAToolkit REQUIRED)
|
|||||||
|
|
||||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||||
|
|
||||||
|
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
|
||||||
|
set(CMAKE_CUDA_ARCHITECTURES 61 70 75 80 86 87 90)
|
||||||
|
else()
|
||||||
set(CMAKE_CUDA_ARCHITECTURES 50 52 60 61 70 75 80 86 89 90)
|
set(CMAKE_CUDA_ARCHITECTURES 50 52 60 61 70 75 80 86 89 90)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
# set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -G") # enable cuda-gdb (expensive)
|
# set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -G") # enable cuda-gdb (expensive)
|
||||||
endif()
|
endif()
|
||||||
|
@ -8,7 +8,12 @@ find_package(CUDAToolkit REQUIRED)
|
|||||||
|
|
||||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||||
|
|
||||||
|
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
|
||||||
|
set(CMAKE_CUDA_ARCHITECTURES 61 70 75 80 86 87 90)
|
||||||
|
else()
|
||||||
set(CMAKE_CUDA_ARCHITECTURES 50 52 60 61 70 75 80 86 89 90)
|
set(CMAKE_CUDA_ARCHITECTURES 50 52 60 61 70 75 80 86 89 90)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
# set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -G") # enable cuda-gdb (expensive)
|
# set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -G") # enable cuda-gdb (expensive)
|
||||||
endif()
|
endif()
|
||||||
|
@ -16,6 +16,10 @@ endif()
|
|||||||
# Include directories and libraries
|
# Include directories and libraries
|
||||||
include_directories(../../../Common)
|
include_directories(../../../Common)
|
||||||
|
|
||||||
|
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
|
||||||
|
message(STATUS "Will not build sample nvJPEG - not supported on aarch64")
|
||||||
|
else()
|
||||||
|
|
||||||
# Source file
|
# Source file
|
||||||
# Add target for nvJPEG
|
# Add target for nvJPEG
|
||||||
add_executable(nvJPEG nvJPEG.cpp)
|
add_executable(nvJPEG nvJPEG.cpp)
|
||||||
@ -41,3 +45,5 @@ add_custom_command(TARGET nvJPEG POST_BUILD
|
|||||||
${CMAKE_CURRENT_SOURCE_DIR}/images
|
${CMAKE_CURRENT_SOURCE_DIR}/images
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/images
|
${CMAKE_CURRENT_BINARY_DIR}/images
|
||||||
)
|
)
|
||||||
|
|
||||||
|
endif()
|
||||||
|
@ -16,6 +16,10 @@ endif()
|
|||||||
# Include directories and libraries
|
# Include directories and libraries
|
||||||
include_directories(../../../Common)
|
include_directories(../../../Common)
|
||||||
|
|
||||||
|
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
|
||||||
|
message(STATUS "Will not build sample nvJPEG_encoder - not supported on aarch64")
|
||||||
|
else()
|
||||||
|
|
||||||
# Source file
|
# Source file
|
||||||
# Add target for nvJPEG_encoder
|
# Add target for nvJPEG_encoder
|
||||||
add_executable(nvJPEG_encoder nvJPEG_encoder.cpp)
|
add_executable(nvJPEG_encoder nvJPEG_encoder.cpp)
|
||||||
@ -47,3 +51,5 @@ add_custom_command(TARGET nvJPEG_encoder POST_BUILD
|
|||||||
${CMAKE_CURRENT_SOURCE_DIR}/encode_output
|
${CMAKE_CURRENT_SOURCE_DIR}/encode_output
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/encode_output
|
${CMAKE_CURRENT_BINARY_DIR}/encode_output
|
||||||
)
|
)
|
||||||
|
|
||||||
|
endif()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user