fix: add missing CUDA error check + correct Vulkan enum type mismatch#414
Open
Scottcjn wants to merge 1 commit intoNVIDIA:masterfrom
Open
fix: add missing CUDA error check + correct Vulkan enum type mismatch#414Scottcjn wants to merge 1 commit intoNVIDIA:masterfrom
Scottcjn wants to merge 1 commit intoNVIDIA:masterfrom
Conversation
1. simple.c: Wrap cuDeviceGetName() with checkCudaErrors() to catch failures instead of silently using uninitialized device name. Fixes NVIDIA#413 2. simpleVulkan/main.cpp: Replace VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_* with VK_EXTERNAL_MEMORY_HANDLE_TYPE_* when checking memory handle type. The parameter is VkExternalMemoryHandleTypeFlagBits, not semaphore flags. Works by coincidence (same bit values) but is incorrect per the Vulkan spec. Fixes NVIDIA#409
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two small bug fixes:
1. Missing error check on
cuDeviceGetName(#413)File:
Samples/7_libNVVM/simple/simple.c:72cuDeviceGetName()was called withoutcheckCudaErrors(). If the call fails, the sample continues with an uninitialized device name.Fix: Wrap with
checkCudaErrors()matching the pattern used on the surrounding CUDA API calls.2. Wrong Vulkan enum type in external memory import (#409)
File:
Samples/5_Domain_Specific/simpleVulkan/main.cpp:331-337The function parameter
handleTypeisVkExternalMemoryHandleTypeFlagBitsbut the comparisons usedVK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_*flags (a different enum). This works by coincidence because the bit values happen to match, but is incorrect per the Vulkan spec and will cause warnings with strict enum type checking.Fix: Replace with
VK_EXTERNAL_MEMORY_HANDLE_TYPE_*constants.Test plan
VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT = 0x00000001(same as semaphore variant)Fixes #413, Fixes #409