diff --git a/Samples/5_Domain_Specific/simpleVulkan/VulkanBaseApp.cpp b/Samples/5_Domain_Specific/simpleVulkan/VulkanBaseApp.cpp index e244bfe2..6c7c3cda 100644 --- a/Samples/5_Domain_Specific/simpleVulkan/VulkanBaseApp.cpp +++ b/Samples/5_Domain_Specific/simpleVulkan/VulkanBaseApp.cpp @@ -115,9 +115,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; + // "IsWindows8orGreater" 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 */ @@ -125,9 +128,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; + // "IsWindows8orGreater" 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 */ diff --git a/Samples/5_Domain_Specific/simpleVulkan/main.cpp b/Samples/5_Domain_Specific/simpleVulkan/main.cpp index f676c6bc..ebdf687f 100644 --- a/Samples/5_Domain_Specific/simpleVulkan/main.cpp +++ b/Samples/5_Domain_Specific/simpleVulkan/main.cpp @@ -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);