Skip to content

Commit 36713ec

Browse files
committed
model-loader: keep io_uring reader active when buffer registration fails
hipHostMalloc buffers are already pinned by the HIP driver so io_uring_register_buffers fails with ENOMEM on ROCm. Fall back to unregistered io_uring reads rather than abandoning the ring entirely.
1 parent cf60eb3 commit 36713ec

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/llama-model-loader.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1533,8 +1533,7 @@ bool llama_model_loader::load_all_data(
15331533
for (size_t i = 0; i < host_ptrs.size(); i++)
15341534
io_iovs[i] = { host_ptrs[i], buffer_size };
15351535
if (!io_reader->register_buffers(io_iovs.data(), (int)io_iovs.size()))
1536-
io_reader.reset();
1537-
else
1536+
LLAMA_LOG_WARN("%s: io_uring buffer registration failed, continuing without fixed buffers\n", __func__);
15381537
LLAMA_LOG_DEBUG("%s: io_uring reader active\n", __func__);
15391538
} else {
15401539
io_reader.reset();

0 commit comments

Comments
 (0)