voice-detect and face-detect backends SIGSEGV on ROCm (gfx1100) — null pointer in purego.RegisterFunc call
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 49.2k
- Forks
- 4.5k
- Avg merge
- 1d 3m
- Merged PRs (30d)
- 239
Description
Environment
- LocalAI v4.7.1 (b224c96db6f4b87306a33a808650bfce63b12588)
- Backend images:
rocm-voice-detect,rocm-face-detect(quay.io/go-skynet/local-ai-backends, latest-gpu-rocm-hipblas-{voice-detect,face-detect}) - GPU: AMD Radeon RX 7900 XTX, gfx1100, ROCm 7.1.1 (Fedora 44 packages, rocm-runtime-7.1.1-6)
- Models:
voice-detect-ecapa-tdnn-voxceleb.gguf(speechbrain/spkrec-ecapa-voxceleb port) andface-detect-antelopev2.gguf(insightface antelopev2 port), both from the official gallery entries
What happened
Both backends load successfully and correctly select the ROCm device, then crash with SIGSEGV on the very first real inference request (VoiceEmbed / face Embeddings). 100% reproducible, every time, on every request. A backend restart doesn't help - the very next call crashes again the same way.
Backtraces
voice-detect (POST /v1/voice/embed):
[voicedetect] vd::Backend using device: ROCm0
SIGSEGV: segmentation violation
PC=0x7fc780cb09df m=4 sigcode=128 addr=0x0
signal arrived during cgo execution
goroutine 23 gp=0x34159328e780 m=4 mp=0x3415930d9808 [syscall]:
runtime.cgocall(0x84bae0, 0x341593274000)
/root/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.26.0.linux-amd64/src/runtime/cgocall.go:167 +0x4b
github.com/ebitengine/purego.RegisterFunc.func4({0x3415931af200, 0x4, 0x4})
/root/go/pkg/mod/github.com/ebitengine/purego@v0.10.0/func.go:322 +0x59c
reflect.callReflect(...)
.../src/reflect/value.go:772 +0x5f6
reflect.makeFuncStub()
.../src/reflect/asm_amd64.s:47 +0x5c
main.(*VoiceDetect).embedPath(0x3415930527e0, {0x3415931d0660, 0x30})
/LocalAI/backend/go/voice-detect/govoicedetect.go:115 +0xae
main.(*VoiceDetect).VoiceEmbed(0x3415930527e0, 0x7eeffa?)
/LocalAI/backend/go/voice-detect/govoicedetect.go:105 +0x57
github.com/mudler/LocalAI/pkg/grpc.(*server).VoiceEmbed(...)
/LocalAI/pkg/grpc/server.go:344 +0x13b
face-detect (POST /v1/face/embed), identical shape:
[facedetect] fd::Backend using device: ROCm0
SIGSEGV: segmentation violation
PC=0x7fd1120b09df m=12 sigcode=128 addr=0x0
signal arrived during cgo execution
goroutine 35 [syscall]:
runtime.cgocall(0x84bae0, 0x1e4fdd47e000)
.../runtime/cgocall.go:167 +0x4b
github.com/ebitengine/purego.RegisterFunc.func4({0x1e4fdd596120, 0x4, 0x4})
.../purego@v0.10.0/func.go:322 +0x59c
reflect.callReflect(...)
reflect.makeFuncStub()
main.(*FaceDetect).embedPath(0x1e4fdd460a80, {0x1e4fdd3d8000, 0x2e})
/LocalAI/backend/go/face-detect/gofacedetect.go:122 +0xae
main.(*FaceDetect).Embeddings(0x1e4fdd460a80, 0xa2c960?)
/LocalAI/backend/go/face-detect/gofacedetect.go:116 +0x114
github.com/mudler/LocalAI/pkg/grpc.(*server).Embedding(...)
/LocalAI/pkg/grpc/server.go:94 +0xe3
Both crash at addr=0x0 (null pointer dereference) inside a purego.RegisterFunc-registered call, both at an embedPath method, both immediately after the backend logs "using device: ROCm0". Given the identical shape across two otherwise-independent backends, this looks like a shared underlying cause - possibly a symbol/function-pointer resolution that succeeds on CUDA/CPU builds but resolves to a null pointer against the ROCm/HIP shared library on this architecture (gfx1100).
Workaround
The cpu-voice-detect / cpu-face-detect builds work correctly on the same models and inputs - full positive-path verified (real 192-d and 512-d embeddings returned, correct rejection of a non-face image). So this is specific to the ROCm build/path, not the models or the detection logic itself.
Reproduction
- Register
voice-detect-ecapa-tdnn.ggufonbackend: voice-detect(orface-detect-antelopev2.ggufonbackend: face-detect) with the ROCm backend installed, on a gfx1100 card. POST /v1/voice/embed(or/v1/face/embed) with any valid audio/image payload.- Backend segfaults every time.
Happy to provide the full goroutine dump (all ~40 goroutines) or test further builds if useful.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with backend/go/voice-detect/govoicedetect.go:115 and backend/go/face-detect/gofacedetect.go:122, tracing the purego.RegisterFunc calls after the ROCm0 device selection. Reproduce the voice or face embedding request on gfx1100 and compare the ROCm path with the working CPU builds. Done means both ROCm backends return embeddings without a SIGSEGV.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- audio-video-rtc, backend, computer-vision
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100