Skip to content

Commit 0565037

Browse files
committed
fix
1 parent 3a03870 commit 0565037

3 files changed

Lines changed: 22 additions & 6 deletions

File tree

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ To conserve context space, load these resources as needed:
112112
<!-- gitnexus:start -->
113113
# GitNexus — Code Intelligence
114114

115-
This project is indexed by GitNexus as **llama.cpp** (30786 symbols, 80613 relationships, 300 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely.
115+
This project is indexed by GitNexus as **llama.cpp** (31123 symbols, 82708 relationships, 300 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely.
116116

117117
> If any GitNexus tool warns the index is stale, run `npx gitnexus analyze` in terminal first.
118118

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ IMPORTANT: Ensure you’ve thoroughly reviewed the [AGENTS.md](AGENTS.md) file b
33
<!-- gitnexus:start -->
44
# GitNexus — Code Intelligence
55

6-
This project is indexed by GitNexus as **llama.cpp** (30786 symbols, 80613 relationships, 300 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely.
6+
This project is indexed by GitNexus as **llama.cpp** (31123 symbols, 82708 relationships, 300 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely.
77

88
> If any GitNexus tool warns the index is stale, run `npx gitnexus analyze` in terminal first.
99

ggml/src/ggml-cuda/ggml-cuda.cu

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1642,10 +1642,26 @@ static cudaError_t ggml_cuda_Memcpy2DPeerAsync(
16421642
p.extent = make_cudaExtent(width, height, 1);
16431643
return cudaMemcpy3DPeerAsync(&p, stream);
16441644
#else
1645-
// HIP does not support cudaMemcpy3DPeerAsync or vmm pools
1646-
GGML_UNUSED(dstDevice);
1647-
GGML_UNUSED(srcDevice);
1648-
return cudaMemcpy2DAsync(dst, dpitch, src, spitch, width, height, cudaMemcpyDeviceToDevice, stream);
1645+
// HIP does not support cudaMemcpy3DPeerAsync or vmm pools.
1646+
// hipMemcpy2DAsync with hipMemcpyDeviceToDevice requires P2P access between devices.
1647+
// For mixed-architecture multi-GPU setups (e.g. gfx1201 + gfx1030) without P2P,
1648+
// hipMemcpy2DAsync submits successfully but fails asynchronously with
1649+
// hipErrorNoBinaryForGpu when the internal copy kernel isn't compiled for the
1650+
// destination device. Use hipMemcpyPeerAsync row-by-row instead, which handles
1651+
// non-P2P cross-device copies correctly via CPU staging.
1652+
if (dstDevice == srcDevice) {
1653+
return hipMemcpy2DAsync(dst, dpitch, src, spitch, width, height, hipMemcpyDeviceToDevice, stream);
1654+
}
1655+
for (size_t i = 0; i < height; ++i) {
1656+
cudaError_t err = cudaMemcpyPeerAsync(
1657+
(char *) dst + i*dpitch, dstDevice,
1658+
(const char *) src + i*spitch, srcDevice,
1659+
width, stream);
1660+
if (err != cudaSuccess) {
1661+
return err;
1662+
}
1663+
}
1664+
return cudaSuccess;
16491665
#endif // !defined(GGML_USE_HIP) && !defined(GGML_USE_MUSA)
16501666
}
16511667

0 commit comments

Comments
 (0)