vulkan: Added GGML_VK_DEVICE{idx}_MEMORY environment variable for setting device memory to manually allocate workload. #11878
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.
Users can manually specify the memory usage of a device using the
GGML_VK_DEVICE{idx}_MEMORYenvironment variable, based on their specific needs, to allocate the workload accordingly.For example, setting
GGML_VK_DEVICE0_MEMORY=2000000000configures 2000MB of memory on the Vulkan0 device, and correspondingly, a 2000MB workload is allocated for model computation on that device.Especially in environments with integrated graphics, users no longer need to reboot and enter the BIOS to configure VRAM, nor do they need to worry about portions of memory allocated as VRAM being idle. By simply using the
GGML_VK_DEVICE{idx}_MEMORYenvironment variable to manually configure the memory amount, this provides a significant benefit for future devices equipped with high-performance integrated graphics.Finally, maintain the original behavior when
GGML_VK_DEVICE{idx}_MEMORYis not set, just likeGGML_VK_VISIBLE_DEVICES.