From 6e23a9857596fdf5e9f7a3197424958d6ab1b629 Mon Sep 17 00:00:00 2001 From: shawnz Date: Tue, 12 Aug 2025 19:18:23 +0800 Subject: [PATCH 1/4] Bug 5150289: Waive the sample for unsupported SM arch --- .../LargeKernelParameter/LargeKernelParameter.cu | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Samples/6_Performance/LargeKernelParameter/LargeKernelParameter.cu b/Samples/6_Performance/LargeKernelParameter/LargeKernelParameter.cu index 177945a4..f6f6f993 100644 --- a/Samples/6_Performance/LargeKernelParameter/LargeKernelParameter.cu +++ b/Samples/6_Performance/LargeKernelParameter/LargeKernelParameter.cu @@ -100,6 +100,18 @@ int main() int rc; cudaFree(0); + // Check compute capability - large kernel parameters require SM 7.0+ + cudaDeviceProp deviceProp; + int devID; + checkCudaErrors(cudaGetDevice(&devID)); + checkCudaErrors(cudaGetDeviceProperties(&deviceProp, devID)); + + if (deviceProp.major < 7) { + printf("LargeKernelParameter requires SM 7.0 or higher. Exiting...\n"); + printf("Current device: %s (SM %d.%d)\n", deviceProp.name, deviceProp.major, deviceProp.minor); + exit(EXIT_WAIVED); + } + param_t p; param_large_t p_large; From cbc075ef599dfa0021c75a8bc951e25b1d77f707 Mon Sep 17 00:00:00 2001 From: shawnz Date: Fri, 15 Aug 2025 17:30:02 +0800 Subject: [PATCH 2/4] Bug 5454390: Add specific glfw3/X11 link for vulkan samples --- .../simpleVulkan/CMakeLists.txt | 21 ++++++++++++++++--- .../simpleVulkanMMAP/CMakeLists.txt | 21 ++++++++++++++++--- .../vulkanImageCUDA/CMakeLists.txt | 21 ++++++++++++++++--- 3 files changed, 54 insertions(+), 9 deletions(-) diff --git a/Samples/5_Domain_Specific/simpleVulkan/CMakeLists.txt b/Samples/5_Domain_Specific/simpleVulkan/CMakeLists.txt index e6595f70..387c748d 100644 --- a/Samples/5_Domain_Specific/simpleVulkan/CMakeLists.txt +++ b/Samples/5_Domain_Specific/simpleVulkan/CMakeLists.txt @@ -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 diff --git a/Samples/5_Domain_Specific/simpleVulkanMMAP/CMakeLists.txt b/Samples/5_Domain_Specific/simpleVulkanMMAP/CMakeLists.txt index 346c4749..a38c3606 100644 --- a/Samples/5_Domain_Specific/simpleVulkanMMAP/CMakeLists.txt +++ b/Samples/5_Domain_Specific/simpleVulkanMMAP/CMakeLists.txt @@ -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 diff --git a/Samples/5_Domain_Specific/vulkanImageCUDA/CMakeLists.txt b/Samples/5_Domain_Specific/vulkanImageCUDA/CMakeLists.txt index c1cd8895..240de1bd 100644 --- a/Samples/5_Domain_Specific/vulkanImageCUDA/CMakeLists.txt +++ b/Samples/5_Domain_Specific/vulkanImageCUDA/CMakeLists.txt @@ -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 From 9d703d090b5b56f9226477735a6515ffc528ba5e Mon Sep 17 00:00:00 2001 From: Shawn Zeng Date: Wed, 20 Aug 2025 15:53:31 +0800 Subject: [PATCH 3/4] Bug 5456523: Cross compile and execution for 7_libNVVM on Tegra Linux Platforms --- test_args.json | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/test_args.json b/test_args.json index ec5fd0c3..b8343170 100644 --- a/test_args.json +++ b/test_args.json @@ -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": { From 036638b7131f8f9498eb23baffb89d2c276482bd Mon Sep 17 00:00:00 2001 From: shawnz Date: Fri, 22 Aug 2025 10:48:02 +0800 Subject: [PATCH 4/4] Revert the change for LargeKernelParameter and update code format check --- .../LargeKernelParameter/LargeKernelParameter.cu | 12 ------------ test_args.json | 4 ++-- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/Samples/6_Performance/LargeKernelParameter/LargeKernelParameter.cu b/Samples/6_Performance/LargeKernelParameter/LargeKernelParameter.cu index f6f6f993..177945a4 100644 --- a/Samples/6_Performance/LargeKernelParameter/LargeKernelParameter.cu +++ b/Samples/6_Performance/LargeKernelParameter/LargeKernelParameter.cu @@ -100,18 +100,6 @@ int main() int rc; cudaFree(0); - // Check compute capability - large kernel parameters require SM 7.0+ - cudaDeviceProp deviceProp; - int devID; - checkCudaErrors(cudaGetDevice(&devID)); - checkCudaErrors(cudaGetDeviceProperties(&deviceProp, devID)); - - if (deviceProp.major < 7) { - printf("LargeKernelParameter requires SM 7.0 or higher. Exiting...\n"); - printf("Current device: %s (SM %d.%d)\n", deviceProp.name, deviceProp.major, deviceProp.minor); - exit(EXIT_WAIVED); - } - param_t p; param_large_t p_large; diff --git a/test_args.json b/test_args.json index b8343170..652b7d74 100644 --- a/test_args.json +++ b/test_args.json @@ -23,7 +23,7 @@ }, { "args": [ - "../cuda-shared-memory/extern_shared_memory.ll" + "../cuda-shared-memory/extern_shared_memory.ll" ], "description": "cuda-shared-memory extern_shared_memory test" }, @@ -36,7 +36,7 @@ { "args": [ "../syscalls/vprintf.ll" - ], + ], "description": "syscalls vprintf test" } ]