Repository navigation
[ggml] Fix Vulkan-Hpp handle usage on 32-bit targets. - #22892
Merged
Merged
Conversation
Contributor
Author
|
the ubuntu-24-webgpu ci error: |
5 of 7 tasks
Contributor
|
You missed some cases, but instead of manually casting everything, wouldn't it be easier to add the operator for vk::Buffer, e.g. (untested): |
Contributor
|
This fell off our radar, sorry. I assume it is still valid? Can you check if it still applies to the master branch? |
On 32-bit platforms, Vulkan non-dispatchable handles such as VkBuffer are represented as uint64_t, and Vulkan-Hpp disables implicit conversions for type safety. This exposes two issues in ggml-vulkan: 1. vk::Buffer is streamed directly into std::ostream in debug/memory logs. 2. vk::Buffer is cast to VkBuffer before being passed to Vulkan-Hpp CommandBuffer::copyBuffer APIs. Fix these by add the operator<< for vk::Buffer, and by passing vk::Buffer directly to Vulkan-Hpp copyBuffer calls.
Contributor
Author
I rebased onto master, and the patch still applies. Without this patch, still get errors on 32 bit: |
0cc4m
approved these changes
Sep 7, 2026
0cc4m
left a comment
Contributor
There was a problem hiding this comment.
Thank you, sorry for the delay
jeffbolznv
approved these changes
Sep 7, 2026
x1250
pushed a commit
to x1250/llama.cpp
that referenced
this pull request
Sep 9, 2026
On 32-bit platforms, Vulkan non-dispatchable handles such as VkBuffer are represented as uint64_t, and Vulkan-Hpp disables implicit conversions for type safety. This exposes two issues in ggml-vulkan: 1. vk::Buffer is streamed directly into std::ostream in debug/memory logs. 2. vk::Buffer is cast to VkBuffer before being passed to Vulkan-Hpp CommandBuffer::copyBuffer APIs. Fix these by add the operator<< for vk::Buffer, and by passing vk::Buffer directly to Vulkan-Hpp copyBuffer calls.
zbrad
pushed a commit
to zbrad/llama.cpp
that referenced
this pull request
Sep 10, 2026
On 32-bit platforms, Vulkan non-dispatchable handles such as VkBuffer are represented as uint64_t, and Vulkan-Hpp disables implicit conversions for type safety. This exposes two issues in ggml-vulkan: 1. vk::Buffer is streamed directly into std::ostream in debug/memory logs. 2. vk::Buffer is cast to VkBuffer before being passed to Vulkan-Hpp CommandBuffer::copyBuffer APIs. Fix these by add the operator<< for vk::Buffer, and by passing vk::Buffer directly to Vulkan-Hpp copyBuffer calls.
1 task done
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.
Overview
On 32-bit platforms, Vulkan non-dispatchable handles such as VkBuffer are represented as uint64_t, and Vulkan-Hpp disables implicit conversions for type safety. This exposes two issues in ggml-vulkan:
Fix these by adding the operator<< for vk::Buffer, and by passing vk::Buffer directly to Vulkan-Hpp copyBuffer calls.
Additional information
Requirements