Compare commits

...

3 Commits

Author SHA1 Message Date
Schabrackentapir
e1193a72f6
Merge 9fef149372771988d237225ac5dbec6a03c324f1 into 3e8f91d1a116060d3fedfe856f3721db970de030 2025-03-04 08:42:41 +08:00
XSShawnZeng
3e8f91d1a1
Several small bug fixes for Windows platforms
* Enhancement for GLFW include and lib search

* Fixing issue #321: A potential bug in memMapIPCDrv/memMapIpc.cpp

* Update CMakelist.txt for the sample 0_Introduction/template

* Copy .dll to correct dir for 5_Domain_Specific/Mandelbrot

* Fix typo

* Update changelog for cudaNvSciBufMultiplanar
2025-02-26 08:23:39 -08:00
Schabrackentapir
9fef149372 bugfix: simpleVulkan now works on windows 10
Bugfix #1:  added missing cudaExternalMemoryDedicated flag on cudaExternalMemoryHandleDesc
Bugfix #2:  IsWindows8<xxx>OrGreater queries return false on Windows 10. Always returning Windows 10 values now (might break on older Windows versions)
2022-02-13 00:11:21 +01:00
6 changed files with 20 additions and 9 deletions

View File

@ -36,6 +36,7 @@
* `cuDLALayerwiseStatsHybrid`
* `cuDLALayerwiseStatsStandalone`
* `cuDLAStandaloneMode`
* `cudaNvSciBufMultiplanar`
* `cudaNvSciNvMedia`
* `fluidsGLES`
* `nbody_opengles`

View File

@ -55,6 +55,7 @@ add_subdirectory(simpleTexture3D)
add_subdirectory(simpleTextureDrv)
add_subdirectory(simpleVoteIntrinsics)
add_subdirectory(simpleZeroCopy)
add_subdirectory(template)
add_subdirectory(systemWideAtomics)
add_subdirectory(vectorAdd)
add_subdirectory(vectorAddDrv)

View File

@ -20,7 +20,7 @@ include_directories(../../../Common)
# Source file
# Add target for template
add_executable(template template.cu)
add_executable(template template.cu template_cpu.cpp)
target_compile_options(template PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)

View File

@ -65,14 +65,14 @@ target_compile_features(Mandelbrot PRIVATE cxx_std_17 cuda_std_17)
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/freeglut.dll
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>
)
add_custom_command(TARGET Mandelbrot
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/glew64.dll
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>
)
endif()

View File

@ -117,9 +117,12 @@ VulkanBaseApp::VulkanBaseApp(const std::string &appName, bool enableValidation)
VkExternalSemaphoreHandleTypeFlagBits
VulkanBaseApp::getDefaultSemaphoreHandleType() {
#ifdef _WIN64
return IsWindows8OrGreater()
? VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT
: VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT;
// "IsWindows8<xxx>orGreater" returns false on windows 10!
// https://docs.microsoft.com/en-us/windows/win32/sysinfo/version-helper-apis
//return IsWindows8OrGreater()
// ? VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT
// : VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT;
return VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT;
#else
return VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT;
#endif /* _WIN64 */
@ -127,9 +130,12 @@ VulkanBaseApp::getDefaultSemaphoreHandleType() {
VkExternalMemoryHandleTypeFlagBits VulkanBaseApp::getDefaultMemHandleType() {
#ifdef _WIN64
return IsWindows8Point1OrGreater()
? VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT
: VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT;
// "IsWindows8<xxx>orGreater" returns false on windows 10!
// https://docs.microsoft.com/en-us/windows/win32/sysinfo/version-helper-apis
//return IsWindows8Point1OrGreater()
// ? VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT
// : VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT;
return VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT;
#else
return VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT;
#endif /* _WIN64 */

View File

@ -345,6 +345,9 @@ class VulkanCudaSineWave : public VulkanBaseApp {
externalMemoryHandleDesc.size = size;
// https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#importing-memory-objects-vul-int
externalMemoryHandleDesc.flags |= cudaExternalMemoryDedicated;
#ifdef _WIN64
externalMemoryHandleDesc.handle.win32.handle =
(HANDLE)getMemHandle(vkMem, handleType);