This repository was archived by the owner on Mar 9, 2026. It is now read-only.
built latest HEAD om Linux successfully with Cuda 12.9 and cuDSS 0.6, but getting this memory allocation error (2.2GB) - RTX 4070 with 12GB, 11GB free! #215
Copy link
Copy link
Open
Description
-------------------------------------
Running global positioning ...
-------------------------------------
I20250923 15:22:42.866495 235250 image_undistorter.cc:20] Undistorting images..
I20250923 15:22:42.866632 235250 image_undistorter.cc:41] Image undistortion done
I20250923 15:22:44.559607 235250 global_positioning.cc:46] Setting up the global positioner problem
I20250923 15:23:13.587226 235250 global_positioning.cc:71] Solving the global positioner problem
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
W0000 00:00:1758666230.163597 235250 block_sparse_matrix.cc:839] cudaHostAlloc failed with status 2 while allocating 2429546448 bytes (~2.26269 GiB); falling back to pageable host memory.
W0000 00:00:1758666297.300324 235250 levenberg_marquardt_strategy.cc:120] Linear solver fatal error: cudssExecute with CUDSS_PHASE_FACTORIZATION failed Got error: CUDSS_STATUS_ALLOC_FAILED
E0000 00:00:1758666297.300534 235250 trust_region_minimizer.cc:97] Terminating: Linear solver failed due to unrecoverable non-numeric causes. Please see the error log for clues.
I20250923 15:25:13.568608 235250 global_positioning.cc:80] Ceres Solver Report: Iterations: 1, Initial cost: 1.911076e+08, Final cost: 1.911076e+08, Termination: FAILURE
I20250923 15:25:27.801251 235250 global_mapper.cc:87] Reconstruction done in 1039.59 seconds
I20250923 15:25:32.107306 235250 colmap_io.cc:28] Extracting colors ...
I20250923 15:26:09.417913 235250 global_mapper.cc:92] Export to COLMAP reconstruction done
Coarse grid occupancy: 125/125 voxels populated.
any clues?
Metadata
Metadata
Assignees
Labels
No labels
Activity
hradec commentedon Sep 23, 2025
btw, to get the amount of memory cudaHostAlloc was trying to allocate, since the original message just states it failed, I have re-built ceres with this patch applied:
As cudaHostAlloc tries to allocate "locked memory", I changed my linux locked memory limit do
unlimited, as you can see in theulimit -aoutput:And I do have 64GB of RAM, with 48GB free RAM and 11GB free of VRAM when the errror ocurred.
As an attempt to fix the locked memory problem, you can see the patch also adds a fallback to pageable memory if it fails to allocated locked memory, which I think is the reason cuDSS fails in the posted error message.
This is running in WSL2 Debian 13, btw, But the build environment is controlled by
pixi, so all libraries, including gcc, cuda, cuDSS, Boost, etc; are download at build time from conda. I only build Ceres from source to make sure it is built with Cuda and cuDSS support.Have anyone seem this cudaHostAlloc failing to allocate locked memory in this fashion before? Any insights would be greatly appreciate.
hradec commentedon Sep 24, 2025
this is the error without the patch: