Skip to content

[LoMa Matcher] [4.2.1] Failed to initialize the bf16 LoMa matcher #4787

Closed

Description

@MindStudioOfficial

Describe the bug

LoMa BF16 feature extraction works correctly, but LoMa BF16 matching fails to initialize and falls back to FP32.

The matcher reports that some graph nodes are assigned to the default CPU execution provider, while CPU fallback is explicitly disabled:

W20260930 14:09:55.455845 34272 loma.cc:531] Failed to initialize the bf16 LoMa matcher (This session contains graph nodes that are assigned to the default CPU EP, but fallback to CPU EP has been explicitly disabled by the user.); falling back to fp32

This happens with LOMA_B matching on COLMAP 4.2.1.

The interesting part is that BF16 LoMa feature extraction works without this error on the same system, so CUDA / ONNX Runtime / cuDNN are generally functional and the issue appears to be specific to the BF16 LoMa matcher graph.

To Reproduce

  1. Use COLMAP 4.2.1 on Windows with CUDA-enabled ONNX Runtime.
  2. Install cuDNN 9.27.0 from NVIDIA's website and make its DLL directory available through PATH.
  3. Extract LoMa-B features with BF16 enabled:
colmap feature_extractor `
    --database_path database.db `
    --image_path images `
    --ImageReader.camera_model RADIAL `
    --ImageReader.single_camera_per_folder 1 `
    --FeatureExtraction.type LOMA_B `
    --FeatureExtraction.use_gpu 1 `
    --LomaExtraction.max_num_features 4096 `
    --LomaExtraction.use_bf16 1
  1. Feature extraction completes successfully without a BF16 initialization error.

  2. Run sequential matching with LoMa-B and BF16 enabled:

colmap sequential_matcher `
    --database_path database.db `
    --FeatureMatching.type LOMA_B `
    --FeatureMatching.use_gpu 1 `
    --LomaMatching.use_bf16 1 `
    --SequentialMatching.overlap 50
  1. At startup, the matcher prints:
I20260930 14:09:54.979847 15752 feature_matching.cc:196] === Feature matching & geometric verification ===
I20260930 14:09:55.042917 34272 feature_matching_utils.cc:79] Bind FeatureMatcherWorker to GPU device 0
W20260930 14:09:55.455845 34272 loma.cc:531] Failed to initialize the bf16 LoMa matcher (This session contains graph nodes that are assigned to the default CPU EP, but fallback to CPU EP has been explicitly disabled by the user.); falling back to fp32
I20260930 14:09:55.873888 15752 pairing.cc:438] Generating sequential image pairs...
  1. Matching continues in FP32.

Expected behavior

The BF16 LoMa matcher should initialize successfully on the CUDA execution provider, similarly to BF16 LoMa feature extraction.

If the BF16 matcher graph contains operations that are not supported by the CUDA execution provider, it would be useful if those specific nodes/operators were identified in the error output.

Screenshots

Not applicable.

Environment

  • OS: Windows 11
  • COLMAP Version: 4.2.1
  • GPU: NVIDIA GeForce RTX 5090, 32 GB VRAM
  • CPU: AMD Ryzen 9 9950X3D
  • Input images: approximately 5,500 images, 2048×2048
  • Feature type: LOMA_B
  • Matcher type: LOMA_B
  • LoMa features: 4096 features/image
  • CUDA execution provider enabled
  • cuDNN: 9.27.0, downloaded directly from NVIDIA and its DLL directory added to PATH
  • BF16 feature extraction works successfully
  • BF16 matching fails and falls back to FP32

Activity

  1. added a commit that references this issue on Oct 25, 2026
    8a8d769
  2. fringehush-gif commented on Oct 25, 2026

    @fringehush-gif
    Contributor

    Proposed fix: #4895. Includes BF16 regression tests and Windows/GTX 1080 FP32 fallback validation.

  3. added a commit that references this issue on Oct 30, 2026
    404b83d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions