mirror of
https://github.com/ggml-org/whisper.cpp.git
synced 2026-10-20 17:23:00 +02:00
vulkan: fix amd iGPU slow checkpoint read (llama/30049)
This commit is contained in:
@@ -623,7 +623,10 @@ void ggml_vk_buffer_read_2d(vk_buffer& src, size_t offset, void * dst, size_t sp
|
|||||||
// If the device is not an UMA device the memory is host-accessible through rebar. While writing
|
// If the device is not an UMA device the memory is host-accessible through rebar. While writing
|
||||||
// through PCIe is sufficient fast reading back data from PCIe is slower than going through
|
// through PCIe is sufficient fast reading back data from PCIe is slower than going through
|
||||||
// the HW device to host copy path.
|
// the HW device to host copy path.
|
||||||
if(src->memory_property_flags & vk::MemoryPropertyFlagBits::eHostVisible && src->device->uma) {
|
// AMD UMA: uncached host-visible memory is write-combined, CPU reads are slow
|
||||||
|
const bool slow_host_read = src->device->vendor_id == VK_VENDOR_ID_AMD &&
|
||||||
|
!(src->memory_property_flags & vk::MemoryPropertyFlagBits::eHostCached);
|
||||||
|
if(src->memory_property_flags & vk::MemoryPropertyFlagBits::eHostVisible && src->device->uma && !slow_host_read) {
|
||||||
GGML_ASSERT(src->memory_property_flags & vk::MemoryPropertyFlagBits::eHostCoherent);
|
GGML_ASSERT(src->memory_property_flags & vk::MemoryPropertyFlagBits::eHostCoherent);
|
||||||
|
|
||||||
std::lock_guard<std::recursive_mutex> guard(src->device->mutex);
|
std::lock_guard<std::recursive_mutex> guard(src->device->mutex);
|
||||||
|
|||||||
Reference in New Issue
Block a user