OpenNMT / OpenNMT/CTranslate2

No SGEMM backend on CPU despite OpenBLAS installed and CTranslate2 built with -DWITH_OPENBLAS=ON

Open
#1,885 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
4.7k
Forks
536
Avg merge
12h 12m
Merged PRs (30d)
4

Description

Summary

I’ve rebuilt CTranslate2 from source (v4.6.0) with -DWITH_OPENBLAS=ON for CPU inference using faster-whisper, but consistently hit this runtime error:

RuntimeError: No SGEMM backend on CPU

Despite verifying that OpenBLAS is installed, SGEMM is available, and everything compiles cleanly.

System Info
OS: Ubuntu 24.04
Python: 3.11.12 (venv)
CTranslate2 version: 4.6.0 (built from source)
BLAS: OpenBLAS installed (libopenblas.so.0)
Model: faster-whisper-base from HuggingFace

Reproduction

  1. Built CTranslate2 with:
cmake .. -DCMAKE_BUILD_TYPE=Release -DWITH_CUDA=OFF -DWITH_MKL=OFF -DWITH_OPENBLAS=ON
make -j$(nproc)

  1. Installed Python bindings:
CMAKE_ARGS="-DCT2_ROOT=$HOME/CTranslate2/build" pip install . --no-build-isolation
  1. Confirmed SGEMM exists in OpenBLAS:
import ctypes
blas = ctypes.cdll.LoadLibrary("libopenblas.so.0")
print(blas.cblas_sgemm)  # Found
  1. Ran a minimal test script:
from faster_whisper import WhisperModel

print("Loading model...")
model = WhisperModel("/home/andre/faster-whisper-models/models--Systran--faster-whisper-base/snapshots/...", device="cpu", compute_type="float32")
print("Model loaded.")
segments, _ = model.transcribe("debug_compare.wav")
  1. Hit this error:
RuntimeError: No SGEMM backend on CPU

Notes

  • `ct2-translator` shows the same model path works.
    
  • OpenBLAS is installed system-wide and `LD_PRELOAD` had no effect.
    
  • `libopenblas.so` is detected in `ldd` of dependent `.so` files.
    

Request
What else can I try to ensure CTranslate2 detects and uses SGEMM from OpenBLAS correctly on CPU?

Thanks in advance.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the Ubuntu 24.04 build with the listed CMake options, then compare the working ct2-translator path with the Python binding and faster-whisper script. Check the ctypes SGEMM lookup and ldd results while tracing runtime backend selection; done means the float32 CPU model loads and transcribes without “No SGEMM backend on CPU”.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
backend, machine-learning, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.