Meshroom/AliceVision photogrammetry on AMD Radeon GPUs via HIP: CUDA->HIP compatibility layer, VRAM->system-RAM memory bridge, Windows + Linux bundles, validated on RDNA1/2/4 against a CUDA node.
0
stars
64
commits
C++
primary language
Sep 14, 2026
updated
Meshroom / AliceVision photogrammetry on AMD Radeon GPUs, via HIP.
AliceVision's dense reconstruction (DepthMap, the stage Meshroom needs a GPU for) is
written in CUDA and has only ever run on NVIDIA. Cheshire compiles those same CUDA kernels as
HIP through a small compatibility layer, adds a memory bridge that lets the stage spill from
VRAM into system RAM instead of failing, and packages the result for Windows and Linux.
Validated against a CUDA node's output on RDNA1, RDNA2 and RDNA4 cards.
The cat that grins on any hardware.
Same photos, same SfM, same DepthMap parameters as the CUDA reference (Meshroom 2023.3 on a GTX 1080 Ti); only the GPU stage differs. Metrics are per view over pixels valid in both maps.
| GPU | OS | 6 views | 41 views | valid masks | median rel. depth error | within 1 % (median view, 6 / 41) |
|---|---|---|---|---|---|---|
| GTX 1080 Ti (CUDA reference) | Linux | 31.9 s | 105.5 s | |||
| Radeon RX 9070, RDNA4 | Windows | 17.4 s | 124.4 s | identical | 0.0000 | 98.9 % / 98.7 % |
| Radeon RX 6750 XT, RDNA2 | Linux | 31.0 s | 226.1 s | identical | 0.0000 | 97.5 % / 98.1 % |
| Radeon RX 5500 XT, RDNA1 | Linux | 60.7 s | 447.7 s | identical | 0.0000 | 97.5 % / 98.1 % |
RDNA1 and RDNA2 produce bit-identical depth maps. The remaining 1-3 % of pixels that differ by more than 1 % between GPU generations (and against CUDA) is the algorithm's cross-hardware noise floor: texture-filter and FMA rounding, not a port defect. Full per-view tables and side-by-side panels: docs/validation.
Measured on the RX 9070 (hip/tests/membridge_probe.hip), the tiers the bridge chooses between:
| memory | kernel streaming read |
|---|---|
VRAM (hipMalloc) | 585-619 GB/s |
mapped system RAM (hipHostMalloc, PCIe 4.0 x16) | 24.6-26.6 GB/s |
hipMallocManaged | 26.6 GB/s (no page migration on Windows) |
| pinned host copies | 28 GB/s each way |
On Windows the driver already lets hipMalloc run past VRAM into system RAM; on Linux it fails
hard. The bridge (hip/compat/include/cheshire/bridge.h) makes both behave the same, and v2
decides what spills by buffer class instead of by arrival order. Measured, one class at a
time behind PCIe, every run bit-identical:
| spilled to system RAM (6 views) | fine-grained host memory | coarse-grained (shipped) |
|---|---|---|
| nothing | 20.6 s | 20.2 s |
| depth/sim maps (879 MB) | 35.9 s (1.7x) | 25.5 s (1.3x) |
| similarity volumes (6.0 GB) | 96.4 s (4.7x) | 76.6 s (3.8x) |
| camera images (186 MB) | 460 s (22x) | 20.4 s (1.0x) |
The host tier is coarse-grained (hipHostMallocNonCoherent): the GPU caches it, atomics work,
and the texture-sampled camera images stop costing anything. Images stay resident regardless
(the planner reserves VRAM for them), volumes and maps spill, and the DepthMap planner sizes
its tile parallelism from the bridge's budget instead of hipMemGetInfo:
| VRAM available | v1 (arrival order, planner unaware) | v2 |
|---|---|---|
| 1.5 GB | 47.7 s, 188 spills | 20.0 s, 0 spills |
| 1 GB | 20.3 s, 0 spills | |
| 500 MB (below one tile) | fails upstream | 47.2 s, runs |
Tile parallelism costs nothing to give up on this GPU, so a card with 1 GB to spare runs the stage at full speed. Design, knobs and every table: docs/02-memory-bridge.md.
hip/tests/)surf2Dwrite stores into 16-bit float arrays, on Windows and Linux alike;
reads are fine. AliceVision's mip chain is built through a buffer copy instead.hipMallocMipmappedArray on RDNA1 (and WSL2 has no textures at
all). Mipmaps are emulated in the compat layer as one texture per level, in array or pitched
linear memory: bit-identical to native mipmaps on the RX 9070, 15 % slower there, so the
Windows build keeps native. Linear levels are what lets the bridge account for camera images.atomicMin into default (fine-grained) host memory
fails on every element while atomicAdd works, and both are right on
hipHostMallocNonCoherent memory (hip/tests/host_atomics.hip; Windows passes all cases).
Anything that spills a buffer kernels do atomics on, LLM runtimes included, needs to know.cl.exe with clang for HIP: use clang-cl for both. -fgpu-rdc is broken on Windows, so
the device code is compiled as one unity translation unit.libamd_comgr / amd_comgr0702.dll) at runtime on both OSes, and
without it the GPU simply "does not exist". On Linux a WSL build box also ships the
/dev/dxg flavour of libhsa-runtime64, which must be swapped for the KFD one. With those
in place RDNA1 works natively on ROCm 7.2.Binaries are on the v0.2.1 release (bridge v2 plus APU code objects); the data sets and references are on v0.1.0 and unchanged, the depth maps being bit-identical between the two:
| asset | size | contents |
|---|---|---|
cheshire-alicevision-hip-windows-x64-rocm7.2.1-gfx1201.zip (v0.2.1) | 100 MB | self-contained AliceVision + HIP DepthMap for RDNA4 on Windows; unzip, needs only the Adrenalin driver |
cheshire-alicevision-hip-windows-x64-rocm7.2.1-rdna3-rdna4.zip (v0.2.1) | 100 MB | the same, with code objects for RDNA3/RDNA4 discrete parts and the RDNA3 APUs (gfx1100/1101/1102/1103/1150/1151/1152/1153/1200/1201): RX 7000 owners and Ryzen 7040/8040/AI laptops, this is the one to try |
cheshire-alicevision-hip-linux-x64-rocm7.2.tar.gz (v0.2.1) | ~120 MB | relocatable Linux bundle, code objects for RDNA1-RDNA4 discrete parts, the RDNA2/RDNA3 APUs (gfx1035/1036/1103/1150/1151/1152/1153) and Vega (gfx900/906, untested); needs only amdgpu + /dev/kfd |
monstree-mini6-meshroom-cache.tar.gz (v0.1.0) | 383 MB | 6-view Meshroom 2023.3 cache: CameraInit, SfM, PrepareDenseScene and the CUDA DepthMap reference |
monstree-full-cuda-reference.tar.gz (v0.1.0) | 680 MB | 41-view SfM + CUDA DepthMap reference (GTX 1080 Ti) |
cheshire-hip-depthmap-outputs.tar.gz (v0.1.0) | 966 MB | the HIP depth maps behind the table above (RX 9070 6 + 41 views, RX 5500 XT, RX 6750 XT) |
Reproduce a row: unpack a cache under data/ref/<dataset>/, then scripts\run-depthmap.cmd <dataset>
(Windows, set CHESHIRE_INSTALL to the unzipped folder) or scripts/linux/run-depthmap.sh (Linux).
Both run the exact Meshroom 2023.3 DepthMap command line and finish with scripts/compare_depthmaps.py,
which prints the per-view table and writes the side-by-side panels. Photos are
alicevision/dataset_monstree.
Every package carries RDNA3 code objects (gfx1100/1101/1102, plus the APUs gfx1103/1150/1151/1152/1153) and none has run on RDNA3 hardware; there is no such chip here. Ten minutes on an RX 7600/7700/7800/7900, or a Ryzen 7040/8040/AI 300 laptop, closes the gap:
monstree-mini6-meshroom-cache.tar.gz from the release pages above.data/ref/monstree-mini6/, unzip the package anywhere, then
set CHESHIRE_INSTALL=<unzipped folder> and scripts\run-depthmap.cmd monstree-mini6
(Linux: scripts/linux/run-depthmap.sh <bundle> <cache> <out> <cache>/DepthMap/<id>).Task done in (s), and a per-view table against the CUDA
reference; compare_stats.md lands next to the depth maps. Open an issue with those two
things and the card model. A [cheshire] bridge summary line appears with
CHESHIRE_BRIDGE_LOG=1 if anything spilled.Expected: mask agreement 1.000, median relative depth error 0.0000, 97-99 % of pixels within 1 % on every view, and a time somewhere between the RX 6750 XT and the RX 9070 rows.
| Path | What |
|---|---|
hip/compat/include/cheshire/ | the CUDA -> HIP compatibility header, the memory bridge, the mipmap emulation |
hip/port/ | fused SGM aggregation and the other upstreamable source changes, applied by scripts/apply_hip_patch.py |
hip/tests/ | standalone HIP probes: textures, surfaces, mipmaps, bandwidth, allocation, launch overhead, the bridge |
scripts/ | Windows build (build-alicevision.cmd), Linux superbuild and bundle (scripts/linux/), validation runner, comparison tool |
docs/ | findings, toolchain notes, bridge design, port log, validation, performance, Linux build |
third_party/aliceVision | upstream AliceVision, pinned as a submodule and left untouched; the HIP backend is a patch set |
scripts\build-alicevision.cmd gfx1201 install.scripts/linux/build-deps.sh and scripts/linux/build-alicevision.sh bundle.scripts\run-depthmap.cmd <dataset> or scripts/linux/run-depthmap.sh against a
Meshroom cache; scripts/compare_depthmaps.py produces the numbers and panels.Works end to end on RDNA1, RDNA2 and RDNA4; RDNA3 has its code object in every bundle but no
hardware run yet. GCN 4 (RX 400/500) is out: the ROCm 7.2 runtime refuses to initialise on an
RX 570 even though the kernel driver accepts it (docs/06). A production Meshroom 2023.3 node runs its DepthMap on the HIP build through
scripts/linux/meshroom-pair.sh (one wrapper, picks CUDA or HIP per run, so the card can be
swapped). Next: planner-chosen tile sizes for the below-one-tile regime, a same-version CUDA
reference, RDNA3 hardware.
Primary repository: git.hausofdub.com/dspl1236/cheshire; mirror: github.com/dspl1236/cheshire. Licensed MPL-2.0.
64 commits
C++
29.5%
HIP
26.7%
Python
21.7%
Batchfile
9.9%
Shell
8.3%
CMake
3.1%
Meshroom/AliceVision photogrammetry on AMD Radeon GPUs via HIP: CUDA->HIP compatibility layer, VRAM->system-RAM memory bridge, Windows + Linux bundles, validated on RDNA1/2/4 against a CUDA node.
0
stars
64
commits
C++
primary language
Sep 14, 2026
updated
Meshroom / AliceVision photogrammetry on AMD Radeon GPUs, via HIP.
AliceVision's dense reconstruction (DepthMap, the stage Meshroom needs a GPU for) is
written in CUDA and has only ever run on NVIDIA. Cheshire compiles those same CUDA kernels as
HIP through a small compatibility layer, adds a memory bridge that lets the stage spill from
VRAM into system RAM instead of failing, and packages the result for Windows and Linux.
Validated against a CUDA node's output on RDNA1, RDNA2 and RDNA4 cards.
The cat that grins on any hardware.
Same photos, same SfM, same DepthMap parameters as the CUDA reference (Meshroom 2023.3 on a GTX 1080 Ti); only the GPU stage differs. Metrics are per view over pixels valid in both maps.
| GPU | OS | 6 views | 41 views | valid masks | median rel. depth error | within 1 % (median view, 6 / 41) |
|---|---|---|---|---|---|---|
| GTX 1080 Ti (CUDA reference) | Linux | 31.9 s | 105.5 s | |||
| Radeon RX 9070, RDNA4 | Windows | 17.4 s | 124.4 s | identical | 0.0000 | 98.9 % / 98.7 % |
| Radeon RX 6750 XT, RDNA2 | Linux | 31.0 s | 226.1 s | identical | 0.0000 | 97.5 % / 98.1 % |
| Radeon RX 5500 XT, RDNA1 | Linux | 60.7 s | 447.7 s | identical | 0.0000 | 97.5 % / 98.1 % |
RDNA1 and RDNA2 produce bit-identical depth maps. The remaining 1-3 % of pixels that differ by more than 1 % between GPU generations (and against CUDA) is the algorithm's cross-hardware noise floor: texture-filter and FMA rounding, not a port defect. Full per-view tables and side-by-side panels: docs/validation.
Measured on the RX 9070 (hip/tests/membridge_probe.hip), the tiers the bridge chooses between:
| memory | kernel streaming read |
|---|---|
VRAM (hipMalloc) | 585-619 GB/s |
mapped system RAM (hipHostMalloc, PCIe 4.0 x16) | 24.6-26.6 GB/s |
hipMallocManaged | 26.6 GB/s (no page migration on Windows) |
| pinned host copies | 28 GB/s each way |
On Windows the driver already lets hipMalloc run past VRAM into system RAM; on Linux it fails
hard. The bridge (hip/compat/include/cheshire/bridge.h) makes both behave the same, and v2
decides what spills by buffer class instead of by arrival order. Measured, one class at a
time behind PCIe, every run bit-identical:
| spilled to system RAM (6 views) | fine-grained host memory | coarse-grained (shipped) |
|---|---|---|
| nothing | 20.6 s | 20.2 s |
| depth/sim maps (879 MB) | 35.9 s (1.7x) | 25.5 s (1.3x) |
| similarity volumes (6.0 GB) | 96.4 s (4.7x) | 76.6 s (3.8x) |
| camera images (186 MB) | 460 s (22x) | 20.4 s (1.0x) |
The host tier is coarse-grained (hipHostMallocNonCoherent): the GPU caches it, atomics work,
and the texture-sampled camera images stop costing anything. Images stay resident regardless
(the planner reserves VRAM for them), volumes and maps spill, and the DepthMap planner sizes
its tile parallelism from the bridge's budget instead of hipMemGetInfo:
| VRAM available | v1 (arrival order, planner unaware) | v2 |
|---|---|---|
| 1.5 GB | 47.7 s, 188 spills | 20.0 s, 0 spills |
| 1 GB | 20.3 s, 0 spills | |
| 500 MB (below one tile) | fails upstream | 47.2 s, runs |
Tile parallelism costs nothing to give up on this GPU, so a card with 1 GB to spare runs the stage at full speed. Design, knobs and every table: docs/02-memory-bridge.md.
hip/tests/)surf2Dwrite stores into 16-bit float arrays, on Windows and Linux alike;
reads are fine. AliceVision's mip chain is built through a buffer copy instead.hipMallocMipmappedArray on RDNA1 (and WSL2 has no textures at
all). Mipmaps are emulated in the compat layer as one texture per level, in array or pitched
linear memory: bit-identical to native mipmaps on the RX 9070, 15 % slower there, so the
Windows build keeps native. Linear levels are what lets the bridge account for camera images.atomicMin into default (fine-grained) host memory
fails on every element while atomicAdd works, and both are right on
hipHostMallocNonCoherent memory (hip/tests/host_atomics.hip; Windows passes all cases).
Anything that spills a buffer kernels do atomics on, LLM runtimes included, needs to know.cl.exe with clang for HIP: use clang-cl for both. -fgpu-rdc is broken on Windows, so
the device code is compiled as one unity translation unit.libamd_comgr / amd_comgr0702.dll) at runtime on both OSes, and
without it the GPU simply "does not exist". On Linux a WSL build box also ships the
/dev/dxg flavour of libhsa-runtime64, which must be swapped for the KFD one. With those
in place RDNA1 works natively on ROCm 7.2.Binaries are on the v0.2.1 release (bridge v2 plus APU code objects); the data sets and references are on v0.1.0 and unchanged, the depth maps being bit-identical between the two:
| asset | size | contents |
|---|---|---|
cheshire-alicevision-hip-windows-x64-rocm7.2.1-gfx1201.zip (v0.2.1) | 100 MB | self-contained AliceVision + HIP DepthMap for RDNA4 on Windows; unzip, needs only the Adrenalin driver |
cheshire-alicevision-hip-windows-x64-rocm7.2.1-rdna3-rdna4.zip (v0.2.1) | 100 MB | the same, with code objects for RDNA3/RDNA4 discrete parts and the RDNA3 APUs (gfx1100/1101/1102/1103/1150/1151/1152/1153/1200/1201): RX 7000 owners and Ryzen 7040/8040/AI laptops, this is the one to try |
cheshire-alicevision-hip-linux-x64-rocm7.2.tar.gz (v0.2.1) | ~120 MB | relocatable Linux bundle, code objects for RDNA1-RDNA4 discrete parts, the RDNA2/RDNA3 APUs (gfx1035/1036/1103/1150/1151/1152/1153) and Vega (gfx900/906, untested); needs only amdgpu + /dev/kfd |
monstree-mini6-meshroom-cache.tar.gz (v0.1.0) | 383 MB | 6-view Meshroom 2023.3 cache: CameraInit, SfM, PrepareDenseScene and the CUDA DepthMap reference |
monstree-full-cuda-reference.tar.gz (v0.1.0) | 680 MB | 41-view SfM + CUDA DepthMap reference (GTX 1080 Ti) |
cheshire-hip-depthmap-outputs.tar.gz (v0.1.0) | 966 MB | the HIP depth maps behind the table above (RX 9070 6 + 41 views, RX 5500 XT, RX 6750 XT) |
Reproduce a row: unpack a cache under data/ref/<dataset>/, then scripts\run-depthmap.cmd <dataset>
(Windows, set CHESHIRE_INSTALL to the unzipped folder) or scripts/linux/run-depthmap.sh (Linux).
Both run the exact Meshroom 2023.3 DepthMap command line and finish with scripts/compare_depthmaps.py,
which prints the per-view table and writes the side-by-side panels. Photos are
alicevision/dataset_monstree.
Every package carries RDNA3 code objects (gfx1100/1101/1102, plus the APUs gfx1103/1150/1151/1152/1153) and none has run on RDNA3 hardware; there is no such chip here. Ten minutes on an RX 7600/7700/7800/7900, or a Ryzen 7040/8040/AI 300 laptop, closes the gap:
monstree-mini6-meshroom-cache.tar.gz from the release pages above.data/ref/monstree-mini6/, unzip the package anywhere, then
set CHESHIRE_INSTALL=<unzipped folder> and scripts\run-depthmap.cmd monstree-mini6
(Linux: scripts/linux/run-depthmap.sh <bundle> <cache> <out> <cache>/DepthMap/<id>).Task done in (s), and a per-view table against the CUDA
reference; compare_stats.md lands next to the depth maps. Open an issue with those two
things and the card model. A [cheshire] bridge summary line appears with
CHESHIRE_BRIDGE_LOG=1 if anything spilled.Expected: mask agreement 1.000, median relative depth error 0.0000, 97-99 % of pixels within 1 % on every view, and a time somewhere between the RX 6750 XT and the RX 9070 rows.
| Path | What |
|---|---|
hip/compat/include/cheshire/ | the CUDA -> HIP compatibility header, the memory bridge, the mipmap emulation |
hip/port/ | fused SGM aggregation and the other upstreamable source changes, applied by scripts/apply_hip_patch.py |
hip/tests/ | standalone HIP probes: textures, surfaces, mipmaps, bandwidth, allocation, launch overhead, the bridge |
scripts/ | Windows build (build-alicevision.cmd), Linux superbuild and bundle (scripts/linux/), validation runner, comparison tool |
docs/ | findings, toolchain notes, bridge design, port log, validation, performance, Linux build |
third_party/aliceVision | upstream AliceVision, pinned as a submodule and left untouched; the HIP backend is a patch set |
scripts\build-alicevision.cmd gfx1201 install.scripts/linux/build-deps.sh and scripts/linux/build-alicevision.sh bundle.scripts\run-depthmap.cmd <dataset> or scripts/linux/run-depthmap.sh against a
Meshroom cache; scripts/compare_depthmaps.py produces the numbers and panels.Works end to end on RDNA1, RDNA2 and RDNA4; RDNA3 has its code object in every bundle but no
hardware run yet. GCN 4 (RX 400/500) is out: the ROCm 7.2 runtime refuses to initialise on an
RX 570 even though the kernel driver accepts it (docs/06). A production Meshroom 2023.3 node runs its DepthMap on the HIP build through
scripts/linux/meshroom-pair.sh (one wrapper, picks CUDA or HIP per run, so the card can be
swapped). Next: planner-chosen tile sizes for the below-one-tile regime, a same-version CUDA
reference, RDNA3 hardware.
Primary repository: git.hausofdub.com/dspl1236/cheshire; mirror: github.com/dspl1236/cheshire. Licensed MPL-2.0.
64 commits
C++
29.5%
HIP
26.7%
Python
21.7%
Batchfile
9.9%
Shell
8.3%
CMake
3.1%