Merge branch 'shawnz_bug_fix' into 'master'

Fix bug 5150289, 5454390 and 5456523

See merge request cuda-samples/cuda-samples!130
This commit is contained in:
Rob Armstrong 2025-08-22 09:29:59 -07:00
commit 12b046a80e
4 changed files with 85 additions and 12 deletions

View File

@ -29,8 +29,17 @@ include(CheckIncludeFile)
# Check for the GLFW/glfw3.h header
check_include_file("GLFW/glfw3.h" HAVE_GLFW3_H)
# Find GLFW header and lib for Windows
if(WIN32 OR CMAKE_CROSSCOMPILING)
# Check for SUSE Linux
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
file(READ "/etc/os-release" OS_RELEASE_CONTENTS)
if(OS_RELEASE_CONTENTS MATCHES "ID=[^ ]*suse[^ ]*")
message(STATUS "SUSE Linux detected")
set(SUSE_LINUX TRUE)
endif()
endif()
# Find GLFW header and lib for Windows and SUSE Linux
if(WIN32 OR CMAKE_CROSSCOMPILING OR SUSE_LINUX)
set(GLFW_INCLUDE_DIRS "${GLFW_INCLUDE_DIR}" "${CMAKE_INCLUDE_PATH}")
find_file(GLFW3_H "GLFW/glfw3.h" PATHS ${GLFW_INCLUDE_DIRS})
find_library(GLFW3_LIB
@ -64,7 +73,7 @@ if(${Vulkan_FOUND})
${Vulkan_LIBRARIES}
OpenGL::GL
)
if(WIN32 OR CMAKE_CROSSCOMPILING)
if(WIN32 OR CMAKE_CROSSCOMPILING OR SUSE_LINUX)
target_include_directories(simpleVulkan PUBLIC
${GLFW_INCLUDE_DIRS}
)
@ -76,6 +85,12 @@ if(${Vulkan_FOUND})
glfw
)
endif()
# Need to add X11 for SUSE Linux explicitly
if(SUSE_LINUX)
target_link_libraries(simpleVulkan
X11
)
endif()
add_custom_command(TARGET simpleVulkan POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_CURRENT_SOURCE_DIR}/sinewave.frag

View File

@ -28,8 +28,17 @@ include(CheckIncludeFile)
# Check for the GLFW/glfw3.h header
check_include_file("GLFW/glfw3.h" HAVE_GLFW3_H)
# Find GLFW header and lib for Windows
if(WIN32 OR CMAKE_CROSSCOMPILING)
# Check for SUSE Linux
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
file(READ "/etc/os-release" OS_RELEASE_CONTENTS)
if(OS_RELEASE_CONTENTS MATCHES "ID=[^ ]*suse[^ ]*")
message(STATUS "SUSE Linux detected")
set(SUSE_LINUX TRUE)
endif()
endif()
# Find GLFW header and lib for Windows and SUSE Linux
if(WIN32 OR CMAKE_CROSSCOMPILING OR SUSE_LINUX)
set(GLFW_INCLUDE_DIRS "${GLFW_INCLUDE_DIR}" "${CMAKE_INCLUDE_PATH}")
find_file(GLFW3_H "GLFW/glfw3.h" PATHS ${GLFW_INCLUDE_DIRS})
find_library(GLFW3_LIB
@ -64,7 +73,7 @@ if(${Vulkan_FOUND})
OpenGL::GL
CUDA::cuda_driver
)
if(WIN32 OR CMAKE_CROSSCOMPILING)
if(WIN32 OR CMAKE_CROSSCOMPILING OR SUSE_LINUX)
target_include_directories(simpleVulkanMMAP PUBLIC
${GLFW_INCLUDE_DIRS}
)
@ -76,6 +85,12 @@ if(${Vulkan_FOUND})
glfw
)
endif()
# Need to add X11 for SUSE Linux explicitly
if(SUSE_LINUX)
target_link_libraries(simpleVulkanMMAP
X11
)
endif()
add_custom_command(TARGET simpleVulkanMMAP POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_CURRENT_SOURCE_DIR}/montecarlo.frag

View File

@ -28,8 +28,17 @@ include(CheckIncludeFile)
# Check for the GLFW/glfw3.h header
check_include_file("GLFW/glfw3.h" HAVE_GLFW3_H)
# Find GLFW header and lib for Windows
if(WIN32 OR CMAKE_CROSSCOMPILING)
# Check for SUSE Linux
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
file(READ "/etc/os-release" OS_RELEASE_CONTENTS)
if(OS_RELEASE_CONTENTS MATCHES "ID=[^ ]*suse[^ ]*")
message(STATUS "SUSE Linux detected")
set(SUSE_LINUX TRUE)
endif()
endif()
# Find GLFW header and lib for Windows and SUSE Linux
if(WIN32 OR CMAKE_CROSSCOMPILING OR SUSE_LINUX)
set(GLFW_INCLUDE_DIRS "${GLFW_INCLUDE_DIR}" "${CMAKE_INCLUDE_PATH}")
find_file(GLFW3_H "GLFW/glfw3.h" PATHS ${GLFW_INCLUDE_DIRS})
find_library(GLFW3_LIB
@ -63,7 +72,7 @@ if(${Vulkan_FOUND})
${Vulkan_LIBRARIES}
OpenGL::GL
)
if(WIN32 OR CMAKE_CROSSCOMPILING)
if(WIN32 OR CMAKE_CROSSCOMPILING OR SUSE_LINUX)
target_include_directories(vulkanImageCUDA PUBLIC
${GLFW_INCLUDE_DIRS}
)
@ -75,6 +84,12 @@ if(${Vulkan_FOUND})
glfw
)
endif()
# Need to add X11 for SUSE Linux explicitly
if(SUSE_LINUX)
target_link_libraries(vulkanImageCUDA
X11
)
endif()
add_custom_command(TARGET vulkanImageCUDA POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_CURRENT_SOURCE_DIR}/shader.frag

View File

@ -8,9 +8,37 @@
]
},
"ptxgen": {
"args": [
"test.ll",
"-arch=compute_75"
"runs": [
{
"args": [
"test.ll"
],
"description": "ptxgen test"
},
{
"args": [
"../cuda-shared-memory/shared_memory.ll"
],
"description": "cuda-shared-memory shared_memory test"
},
{
"args": [
"../cuda-shared-memory/extern_shared_memory.ll"
],
"description": "cuda-shared-memory extern_shared_memory test"
},
{
"args": [
"../syscalls/malloc-free.ll"
],
"description": "syscalls malloc-free test"
},
{
"args": [
"../syscalls/vprintf.ll"
],
"description": "syscalls vprintf test"
}
]
},
"volumeRender": {