[GH-ISSUE #15481] Windows: crash on startup - Exception 0xc0000005 in x/imagegen/mlx init() #35657

Open
opened 2026-04-22 20:19:38 -05:00 by GiteaMirror · 7 comments
Owner

Originally created by @Rasmitimilsina on GitHub (Apr 10, 2026).
Original GitHub issue: https://github.com/ollama/ollama/issues/15481

What is the issue?

Ollama crashes immediately on startup with an access violation (0xc0000005).
The crash occurs during package initialization in the MLX imagegen module,
which appears to be Apple-specific code bundled into the Windows build.
What happened:
Running ollama in PowerShell causes an immediate crash with a Go runtime
panic before any commands can execute.

What I expected:
Ollama should start normally on Windows.

Relevant log output

Exception 0xc0000005 0x8 0x7ffb9306cb12 0x7ffb9306cb12
PC=0x7ffb9306cb12
signal arrived during external code execution

runtime.cgocall(0x7ff6fbb24910, 0xc000049da0)
        runtime/cgocall.go:167 +0x3e fp=0xc000049d78 sp=0xc000049d10 pc=0x7ff6fa9f243e
github.com/ollama/ollama/x/imagegen/mlx._Cfunc_mlx_random_key(0xc000226118, 0x19d77bef963)
        _cgo_gotypes.go:1978 +0x50 fp=0xc000049da0 sp=0xc000049d78 pc=0x7ff6fb081770
github.com/ollama/ollama/x/imagegen/mlx.RandomKey.func1(...)
        github.com/ollama/ollama/x/imagegen/mlx/mlx.go:1870
github.com/ollama/ollama/x/imagegen/mlx.RandomKey(0x19d77bef963)
        github.com/ollama/ollama/x/imagegen/mlx/mlx.go:1870 +0x5d fp=0xc000049dd8 sp=0xc000049da0 pc=0x7ff6fb08a69d
github.com/ollama/ollama/x/imagegen/mlx.init.0()
        github.com/ollama/ollama/x/imagegen/mlx/mlx.go:1848 +0xa9 fp=0xc000049e28 sp=0xc000049dd8 pc=0x7ff6fb08a4a9
runtime.doInit1(0x7ff6fceb62c0)
        runtime/proc.go:7350 +0xdd fp=0xc000049f50 sp=0xc000049e28 pc=0x7ff6fa9d343d
runtime.doInit(...)
        runtime/proc.go:7317
runtime.main()
        runtime/proc.go:254 +0x325 fp=0xc000049fe0 sp=0xc000049f50 pc=0x7ff6fa9c4e85
runtime.goexit({})
        runtime/asm_amd64.s:1700 +0x1 fp=0xc000049fe8 sp=0xc000049fe0 pc=0x7ff6fa9fdb21

goroutine 2 gp=0xc0000028c0 m=nil [force gc (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
        runtime/proc.go:435 +0xce fp=0xc00008bfa8 sp=0xc00008bf88 pc=0x7ff6fa9f598e
runtime.goparkunlock(...)
        runtime/proc.go:441
runtime.forcegchelper()
        runtime/proc.go:348 +0xb8 fp=0xc00008bfe0 sp=0xc00008bfa8 pc=0x7ff6fa9c50f8
runtime.goexit({})
        runtime/asm_amd64.s:1700 +0x1 fp=0xc00008bfe8 sp=0xc00008bfe0 pc=0x7ff6fa9fdb21
created by runtime.init.7 in goroutine 1
        runtime/proc.go:336 +0x1a

goroutine 3 gp=0xc000002c40 m=nil [GC sweep wait]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
        runtime/proc.go:435 +0xce fp=0xc00008df80 sp=0xc00008df60 pc=0x7ff6fa9f598e
runtime.goparkunlock(...)
        runtime/proc.go:441
runtime.bgsweep(0xc00009a000)
        runtime/mgcsweep.go:276 +0x94 fp=0xc00008dfc8 sp=0xc00008df80 pc=0x7ff6fa9ade74
runtime.gcenable.gowrap1()
        runtime/mgc.go:204 +0x25 fp=0xc00008dfe0 sp=0xc00008dfc8 pc=0x7ff6fa9a2285
runtime.goexit({})
        runtime/asm_amd64.s:1700 +0x1 fp=0xc00008dfe8 sp=0xc00008dfe0 pc=0x7ff6fa9fdb21
created by runtime.gcenable in goroutine 1
        runtime/mgc.go:204 +0x66

goroutine 4 gp=0xc000002e00 m=nil [GC scavenge wait]:
runtime.gopark(0xc00009a000?, 0x7ff6fc3ffc10?, 0x1?, 0x0?, 0xc000002e00?)
        runtime/proc.go:435 +0xce fp=0xc0000a1f78 sp=0xc0000a1f58 pc=0x7ff6fa9f598e
runtime.goparkunlock(...)
        runtime/proc.go:441
runtime.(*scavengerState).park(0x7ff6fcfd0d80)
        runtime/mgcscavenge.go:425 +0x49 fp=0xc0000a1fa8 sp=0xc0000a1f78 pc=0x7ff6fa9ab909
runtime.bgscavenge(0xc00009a000)
        runtime/mgcscavenge.go:653 +0x3c fp=0xc0000a1fc8 sp=0xc0000a1fa8 pc=0x7ff6fa9abe7c
runtime.gcenable.gowrap2()
        runtime/mgc.go:205 +0x25 fp=0xc0000a1fe0 sp=0xc0000a1fc8 pc=0x7ff6fa9a2225
runtime.goexit({})
        runtime/asm_amd64.s:1700 +0x1 fp=0xc0000a1fe8 sp=0xc0000a1fe0 pc=0x7ff6fa9fdb21
created by runtime.gcenable in goroutine 1
        runtime/mgc.go:205 +0xa5

goroutine 18 gp=0xc0001081c0 m=nil [finalizer wait]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
        runtime/proc.go:435 +0xce fp=0xc00009de30 sp=0xc00009de10 pc=0x7ff6fa9f598e
runtime.runfinq()
        runtime/mfinal.go:196 +0x107 fp=0xc00009dfe0 sp=0xc00009de30 pc=0x7ff6fa9a1207
runtime.goexit({})
        runtime/asm_amd64.s:1700 +0x1 fp=0xc00009dfe8 sp=0xc00009dfe0 pc=0x7ff6fa9fdb21
created by runtime.createfing in goroutine 1
        runtime/mfinal.go:166 +0x3d
rax     0x64
rbx     0x7ffb9313098c
rcx     0xc687c65efb030000
rdx     0x1c961f50000
rdi     0x1c9e17c0860
rsi     0x0
rbp     0x6f412ff409
rsp     0x6f412feea0
r8      0x7ffffffffffffffc
r9      0x6f410b1000
r10     0x8101010101010100
r11     0x1c96213ad80
r12     0xffffffffffffffff
r13     0x24
r14     0x1c9620ef318
r15     0x0
rip     0x7ffb9306cb12
rflags  0x10202
cs      0x33
fs      0x53
gs      0x2b

OS

Windows

GPU

Intel

CPU

Intel

Ollama version

Unknown - ollama --version crashes with the same error before printing version

Originally created by @Rasmitimilsina on GitHub (Apr 10, 2026). Original GitHub issue: https://github.com/ollama/ollama/issues/15481 ### What is the issue? Ollama crashes immediately on startup with an access violation (0xc0000005). The crash occurs during package initialization in the MLX imagegen module, which appears to be Apple-specific code bundled into the Windows build. What happened: Running `ollama` in PowerShell causes an immediate crash with a Go runtime panic before any commands can execute. What I expected: Ollama should start normally on Windows. ### Relevant log output ```shell Exception 0xc0000005 0x8 0x7ffb9306cb12 0x7ffb9306cb12 PC=0x7ffb9306cb12 signal arrived during external code execution runtime.cgocall(0x7ff6fbb24910, 0xc000049da0) runtime/cgocall.go:167 +0x3e fp=0xc000049d78 sp=0xc000049d10 pc=0x7ff6fa9f243e github.com/ollama/ollama/x/imagegen/mlx._Cfunc_mlx_random_key(0xc000226118, 0x19d77bef963) _cgo_gotypes.go:1978 +0x50 fp=0xc000049da0 sp=0xc000049d78 pc=0x7ff6fb081770 github.com/ollama/ollama/x/imagegen/mlx.RandomKey.func1(...) github.com/ollama/ollama/x/imagegen/mlx/mlx.go:1870 github.com/ollama/ollama/x/imagegen/mlx.RandomKey(0x19d77bef963) github.com/ollama/ollama/x/imagegen/mlx/mlx.go:1870 +0x5d fp=0xc000049dd8 sp=0xc000049da0 pc=0x7ff6fb08a69d github.com/ollama/ollama/x/imagegen/mlx.init.0() github.com/ollama/ollama/x/imagegen/mlx/mlx.go:1848 +0xa9 fp=0xc000049e28 sp=0xc000049dd8 pc=0x7ff6fb08a4a9 runtime.doInit1(0x7ff6fceb62c0) runtime/proc.go:7350 +0xdd fp=0xc000049f50 sp=0xc000049e28 pc=0x7ff6fa9d343d runtime.doInit(...) runtime/proc.go:7317 runtime.main() runtime/proc.go:254 +0x325 fp=0xc000049fe0 sp=0xc000049f50 pc=0x7ff6fa9c4e85 runtime.goexit({}) runtime/asm_amd64.s:1700 +0x1 fp=0xc000049fe8 sp=0xc000049fe0 pc=0x7ff6fa9fdb21 goroutine 2 gp=0xc0000028c0 m=nil [force gc (idle)]: runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?) runtime/proc.go:435 +0xce fp=0xc00008bfa8 sp=0xc00008bf88 pc=0x7ff6fa9f598e runtime.goparkunlock(...) runtime/proc.go:441 runtime.forcegchelper() runtime/proc.go:348 +0xb8 fp=0xc00008bfe0 sp=0xc00008bfa8 pc=0x7ff6fa9c50f8 runtime.goexit({}) runtime/asm_amd64.s:1700 +0x1 fp=0xc00008bfe8 sp=0xc00008bfe0 pc=0x7ff6fa9fdb21 created by runtime.init.7 in goroutine 1 runtime/proc.go:336 +0x1a goroutine 3 gp=0xc000002c40 m=nil [GC sweep wait]: runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?) runtime/proc.go:435 +0xce fp=0xc00008df80 sp=0xc00008df60 pc=0x7ff6fa9f598e runtime.goparkunlock(...) runtime/proc.go:441 runtime.bgsweep(0xc00009a000) runtime/mgcsweep.go:276 +0x94 fp=0xc00008dfc8 sp=0xc00008df80 pc=0x7ff6fa9ade74 runtime.gcenable.gowrap1() runtime/mgc.go:204 +0x25 fp=0xc00008dfe0 sp=0xc00008dfc8 pc=0x7ff6fa9a2285 runtime.goexit({}) runtime/asm_amd64.s:1700 +0x1 fp=0xc00008dfe8 sp=0xc00008dfe0 pc=0x7ff6fa9fdb21 created by runtime.gcenable in goroutine 1 runtime/mgc.go:204 +0x66 goroutine 4 gp=0xc000002e00 m=nil [GC scavenge wait]: runtime.gopark(0xc00009a000?, 0x7ff6fc3ffc10?, 0x1?, 0x0?, 0xc000002e00?) runtime/proc.go:435 +0xce fp=0xc0000a1f78 sp=0xc0000a1f58 pc=0x7ff6fa9f598e runtime.goparkunlock(...) runtime/proc.go:441 runtime.(*scavengerState).park(0x7ff6fcfd0d80) runtime/mgcscavenge.go:425 +0x49 fp=0xc0000a1fa8 sp=0xc0000a1f78 pc=0x7ff6fa9ab909 runtime.bgscavenge(0xc00009a000) runtime/mgcscavenge.go:653 +0x3c fp=0xc0000a1fc8 sp=0xc0000a1fa8 pc=0x7ff6fa9abe7c runtime.gcenable.gowrap2() runtime/mgc.go:205 +0x25 fp=0xc0000a1fe0 sp=0xc0000a1fc8 pc=0x7ff6fa9a2225 runtime.goexit({}) runtime/asm_amd64.s:1700 +0x1 fp=0xc0000a1fe8 sp=0xc0000a1fe0 pc=0x7ff6fa9fdb21 created by runtime.gcenable in goroutine 1 runtime/mgc.go:205 +0xa5 goroutine 18 gp=0xc0001081c0 m=nil [finalizer wait]: runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?) runtime/proc.go:435 +0xce fp=0xc00009de30 sp=0xc00009de10 pc=0x7ff6fa9f598e runtime.runfinq() runtime/mfinal.go:196 +0x107 fp=0xc00009dfe0 sp=0xc00009de30 pc=0x7ff6fa9a1207 runtime.goexit({}) runtime/asm_amd64.s:1700 +0x1 fp=0xc00009dfe8 sp=0xc00009dfe0 pc=0x7ff6fa9fdb21 created by runtime.createfing in goroutine 1 runtime/mfinal.go:166 +0x3d rax 0x64 rbx 0x7ffb9313098c rcx 0xc687c65efb030000 rdx 0x1c961f50000 rdi 0x1c9e17c0860 rsi 0x0 rbp 0x6f412ff409 rsp 0x6f412feea0 r8 0x7ffffffffffffffc r9 0x6f410b1000 r10 0x8101010101010100 r11 0x1c96213ad80 r12 0xffffffffffffffff r13 0x24 r14 0x1c9620ef318 r15 0x0 rip 0x7ffb9306cb12 rflags 0x10202 cs 0x33 fs 0x53 gs 0x2b ``` ### OS Windows ### GPU Intel ### CPU Intel ### Ollama version Unknown - ollama --version crashes with the same error before printing version
GiteaMirror added the bug label 2026-04-22 20:19:38 -05:00
Author
Owner

@wpostma commented on GitHub (Apr 11, 2026):

The go ollama.exe build in win32 at the head of the git branch main is in a broken state, I think. I see compilation errors but I don't understand Go's odd version of what "compile errors" means enough to understand, only that a recent commit removed the MacOSX platform guards (darwin) from the go code, and now the windows builds are basically broken.

C:\vsdev\ollama [main]> go run .
github.com/ollama/ollama/llama: build constraints exclude all Go files in C:\vsdev\ollama\llama
# github.com/ollama/ollama/x/mlxrunner/mlx
x\mlxrunner\mlx\nn.go:4:9: undefined: Array
x\mlxrunner\mlx\nn.go:5:9: undefined: Array
x\mlxrunner\mlx\nn.go:9:28: undefined: Array
x\mlxrunner\mlx\nn.go:18:37: undefined: Array
x\mlxrunner\mlx\nn.go:25:9: undefined: Array
x\mlxrunner\mlx\nn.go:28:38: undefined: Array
# github.com/ollama/ollama/x/imagegen/vae
x\imagegen\vae\tiling.go:40:31: undefined: mlx.Array
x\imagegen\vae\tiling.go:52:17: undefined: mlx.AsType
x\imagegen\vae\tiling.go:52:37: undefined: mlx.DtypeFloat32
x\imagegen\vae\tiling.go:53:17: undefined: mlx.ClipScalar
x\imagegen\vae\tiling.go:54:17: undefined: mlx.Transpose
x\imagegen\vae\tiling.go:77:16: undefined: mlx.Slice
x\imagegen\vae\tiling.go:79:18: undefined: mlx.AsType
x\imagegen\vae\tiling.go:79:38: undefined: mlx.DtypeFloat32
x\imagegen\vae\tiling.go:80:8: undefined: mlx.Eval
x\imagegen\vae\tiling.go:166:16: undefined: mlx.NewArray
x\imagegen\vae\tiling.go:166:16: too many errors
# github.com/ollama/ollama/x/imagegen/nn
x\imagegen\nn\nn.go:8:17: undefined: mlx.Array
x\imagegen\nn\nn.go:14:17: undefined: mlx.Array
x\imagegen\nn\nn.go:21:14: undefined: mlx.Array
x\imagegen\nn\nn.go:22:14: undefined: mlx.Array
x\imagegen\nn\nn.go:88:17: undefined: mlx.Array
x\imagegen\nn\nn.go:89:17: undefined: mlx.Array
x\imagegen\nn\nn.go:90:17: undefined: mlx.Array
x\imagegen\nn\nn.go:91:17: undefined: mlx.Array
x\imagegen\nn\nn.go:115:14: undefined: mlx.Array
x\imagegen\nn\nn.go:134:14: undefined: mlx.Array
x\imagegen\nn\nn.go:134:14: too many errors
# github.com/ollama/ollama/x/imagegen/cache
x\imagegen\cache\cache.go:6:19: undefined: mlx.Array
x\imagegen\cache\cache.go:9:17: undefined: mlx.Array
x\imagegen\cache\cache.go:14:20: undefined: mlx.Array
x\imagegen\cache\cache.go:74:20: undefined: mlx.Array
x\imagegen\cache\step.go:50:18: undefined: mlx.Array
x\imagegen\cache\step.go:51:18: undefined: mlx.Array
x\imagegen\cache\step.go:52:16: undefined: mlx.Array
x\imagegen\cache\teacache.go:19:20: undefined: mlx.Array
x\imagegen\cache\teacache.go:22:23: undefined: mlx.Array
x\imagegen\cache\teacache.go:23:23: undefined: mlx.Array
x\imagegen\cache\teacache.go:23:23: too many errors
# github.com/ollama/ollama/x/imagegen/manifest
x\imagegen\manifest\weights.go:18:30: undefined: mlx.Array
x\imagegen\manifest\weights.go:19:21: undefined: mlx.SafetensorsFile
x\imagegen\manifest\weights.go:52:35: undefined: mlx.Array
x\imagegen\manifest\weights.go:64:43: undefined: mlx.Dtype
x\imagegen\manifest\weights.go:66:31: undefined: mlx.SafetensorsFile
x\imagegen\manifest\weights.go:67:24: undefined: mlx.Array
x\imagegen\manifest\weights.go:83:18: undefined: mlx.LoadSafetensorsNative
x\imagegen\manifest\weights.go:120:16: undefined: mlx.AsType
x\imagegen\manifest\weights.go:122:15: undefined: mlx.Contiguous
x\imagegen\manifest\weights.go:200:57: undefined: mlx.Array
x\imagegen\manifest\weights.go:122:15: too many errors

This is main as of revision:

commit 40a1317dfd (HEAD -> main, tag: v0.20.6-rc0, truth/main, truth/HEAD)
Author: Devon Rifkin drifkin@drifkin.net
Date: Fri Apr 10 15:45:27 2026 -0700

gemma4: update renderer to match new jinja template (#15490)

* gemma4: update renderer to match new jinja template

Google has updated their jinja template for gemma4, and so this change
gives us parity with the new template. The parsing also slightly changed
upstream, so we make a small change to our parser as well.

I've also corrected a few probably existing edge cases, especially
around type unions. The upstream output format is weird (a stringified
array), but in practice the models seem to understand it well.

* gemma4: special case simple `AnyOf`s

Claude code found that someone removed a lot of guards on the darwin platform and changed them to mlx. If that was intentional, I don't know, but it's currently messed up.

I don't know go well enough to suggest what the fix is, only that I think maybe there should be continuous integration on pull requests, for this repo. :-)

The community and the go docs talk about "build constraints" and also "build tags", and I don't see any clear changes in git history explaining what ones are in use, and what conventions hold.

<!-- gh-comment-id:4229720586 --> @wpostma commented on GitHub (Apr 11, 2026): The go ollama.exe build in win32 at the head of the git branch main is in a broken state, I think. I see compilation errors but I don't understand Go's odd version of what "compile errors" means enough to understand, only that a recent commit removed the MacOSX platform guards (darwin) from the go code, and now the windows builds are basically broken. ``` C:\vsdev\ollama [main]> go run . github.com/ollama/ollama/llama: build constraints exclude all Go files in C:\vsdev\ollama\llama # github.com/ollama/ollama/x/mlxrunner/mlx x\mlxrunner\mlx\nn.go:4:9: undefined: Array x\mlxrunner\mlx\nn.go:5:9: undefined: Array x\mlxrunner\mlx\nn.go:9:28: undefined: Array x\mlxrunner\mlx\nn.go:18:37: undefined: Array x\mlxrunner\mlx\nn.go:25:9: undefined: Array x\mlxrunner\mlx\nn.go:28:38: undefined: Array # github.com/ollama/ollama/x/imagegen/vae x\imagegen\vae\tiling.go:40:31: undefined: mlx.Array x\imagegen\vae\tiling.go:52:17: undefined: mlx.AsType x\imagegen\vae\tiling.go:52:37: undefined: mlx.DtypeFloat32 x\imagegen\vae\tiling.go:53:17: undefined: mlx.ClipScalar x\imagegen\vae\tiling.go:54:17: undefined: mlx.Transpose x\imagegen\vae\tiling.go:77:16: undefined: mlx.Slice x\imagegen\vae\tiling.go:79:18: undefined: mlx.AsType x\imagegen\vae\tiling.go:79:38: undefined: mlx.DtypeFloat32 x\imagegen\vae\tiling.go:80:8: undefined: mlx.Eval x\imagegen\vae\tiling.go:166:16: undefined: mlx.NewArray x\imagegen\vae\tiling.go:166:16: too many errors # github.com/ollama/ollama/x/imagegen/nn x\imagegen\nn\nn.go:8:17: undefined: mlx.Array x\imagegen\nn\nn.go:14:17: undefined: mlx.Array x\imagegen\nn\nn.go:21:14: undefined: mlx.Array x\imagegen\nn\nn.go:22:14: undefined: mlx.Array x\imagegen\nn\nn.go:88:17: undefined: mlx.Array x\imagegen\nn\nn.go:89:17: undefined: mlx.Array x\imagegen\nn\nn.go:90:17: undefined: mlx.Array x\imagegen\nn\nn.go:91:17: undefined: mlx.Array x\imagegen\nn\nn.go:115:14: undefined: mlx.Array x\imagegen\nn\nn.go:134:14: undefined: mlx.Array x\imagegen\nn\nn.go:134:14: too many errors # github.com/ollama/ollama/x/imagegen/cache x\imagegen\cache\cache.go:6:19: undefined: mlx.Array x\imagegen\cache\cache.go:9:17: undefined: mlx.Array x\imagegen\cache\cache.go:14:20: undefined: mlx.Array x\imagegen\cache\cache.go:74:20: undefined: mlx.Array x\imagegen\cache\step.go:50:18: undefined: mlx.Array x\imagegen\cache\step.go:51:18: undefined: mlx.Array x\imagegen\cache\step.go:52:16: undefined: mlx.Array x\imagegen\cache\teacache.go:19:20: undefined: mlx.Array x\imagegen\cache\teacache.go:22:23: undefined: mlx.Array x\imagegen\cache\teacache.go:23:23: undefined: mlx.Array x\imagegen\cache\teacache.go:23:23: too many errors # github.com/ollama/ollama/x/imagegen/manifest x\imagegen\manifest\weights.go:18:30: undefined: mlx.Array x\imagegen\manifest\weights.go:19:21: undefined: mlx.SafetensorsFile x\imagegen\manifest\weights.go:52:35: undefined: mlx.Array x\imagegen\manifest\weights.go:64:43: undefined: mlx.Dtype x\imagegen\manifest\weights.go:66:31: undefined: mlx.SafetensorsFile x\imagegen\manifest\weights.go:67:24: undefined: mlx.Array x\imagegen\manifest\weights.go:83:18: undefined: mlx.LoadSafetensorsNative x\imagegen\manifest\weights.go:120:16: undefined: mlx.AsType x\imagegen\manifest\weights.go:122:15: undefined: mlx.Contiguous x\imagegen\manifest\weights.go:200:57: undefined: mlx.Array x\imagegen\manifest\weights.go:122:15: too many errors ``` This is main as of revision: commit 40a1317dfdf72d8ddb3f535a53d06cdc72ed2c53 (HEAD -> main, tag: v0.20.6-rc0, truth/main, truth/HEAD) Author: Devon Rifkin <drifkin@drifkin.net> Date: Fri Apr 10 15:45:27 2026 -0700 gemma4: update renderer to match new jinja template (#15490) * gemma4: update renderer to match new jinja template Google has updated their jinja template for gemma4, and so this change gives us parity with the new template. The parsing also slightly changed upstream, so we make a small change to our parser as well. I've also corrected a few probably existing edge cases, especially around type unions. The upstream output format is weird (a stringified array), but in practice the models seem to understand it well. * gemma4: special case simple `AnyOf`s Claude code found that someone removed a lot of guards on the darwin platform and changed them to mlx. If that was intentional, I don't know, but it's currently messed up. I don't know go well enough to suggest what the fix is, only that I think maybe there should be continuous integration on pull requests, for this repo. :-) The community and the go docs talk about "build constraints" and also "build tags", and I don't see any clear changes in git history explaining what ones are in use, and what conventions hold.
Author
Owner

@wpostma commented on GitHub (Apr 12, 2026):

I expect this will get fixed soon as part of their continued work on freeing the MLX back end from its former state as a darwin (macos only) tag. I am not on the team, or a o/s contrib on ollama (yet, anyway).

<!-- gh-comment-id:4232058753 --> @wpostma commented on GitHub (Apr 12, 2026): I expect this will get fixed soon as part of their continued work on freeing the MLX back end from its former state as a darwin (macos only) tag. I am not on the team, or a o/s contrib on ollama (yet, anyway).
Author
Owner

@haochuan-he commented on GitHub (Apr 16, 2026):

I encountered the same problem, even after restarting Windows and reinstalling Ollama. (Windows 11, CPU AMD R9 7940H, Ollama version 0.20.7)

Exception 0xc0000005 0x8 0x7ffb4994cb12 0x7ffb4994cb12
PC=0x7ffb4994cb12
signal arrived during external code execution

runtime.cgocall(0x7ff6f021a310, 0xc00004bda0)
runtime/cgocall.go:167 +0x3e fp=0xc00004bd78 sp=0xc00004bd10 pc=0x7ff6ef0e243e
github.com/ollama/ollama/x/imagegen/mlx._Cfunc_mlx_random_key(0xc00007e2e0, 0x19d9441197e)
_cgo_gotypes.go:1978 +0x50 fp=0xc00004bda0 sp=0xc00004bd78 pc=0x7ff6ef771770
github.com/ollama/ollama/x/imagegen/mlx.RandomKey.func1(...)
github.com/ollama/ollama/x/imagegen/mlx/mlx.go:1870
github.com/ollama/ollama/x/imagegen/mlx.RandomKey(0x19d9441197e)
github.com/ollama/ollama/x/imagegen/mlx/mlx.go:1870 +0x5d fp=0xc00004bdd8 sp=0xc00004bda0 pc=0x7ff6ef77a69d
github.com/ollama/ollama/x/imagegen/mlx.init.0()
github.com/ollama/ollama/x/imagegen/mlx/mlx.go:1848 +0xa9 fp=0xc00004be28 sp=0xc00004bdd8 pc=0x7ff6ef77a4a9
runtime.doInit1(0x7ff6f15af2c0)
runtime/proc.go:7350 +0xdd fp=0xc00004bf50 sp=0xc00004be28 pc=0x7ff6ef0c343d
runtime.doInit(...)
runtime/proc.go:7317
runtime.main()
runtime/proc.go:254 +0x325 fp=0xc00004bfe0 sp=0xc00004bf50 pc=0x7ff6ef0b4e85
runtime.goexit({})
runtime/asm_amd64.s:1700 +0x1 fp=0xc00004bfe8 sp=0xc00004bfe0 pc=0x7ff6ef0edb21

goroutine 2 gp=0xc0000028c0 m=nil [force gc (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
runtime/proc.go:435 +0xce fp=0xc000081fa8 sp=0xc000081f88 pc=0x7ff6ef0e598e
runtime.goparkunlock(...)
runtime/proc.go:441
runtime.forcegchelper()
runtime/proc.go:348 +0xb8 fp=0xc000081fe0 sp=0xc000081fa8 pc=0x7ff6ef0b50f8
runtime.goexit({})
runtime/asm_amd64.s:1700 +0x1 fp=0xc000081fe8 sp=0xc000081fe0 pc=0x7ff6ef0edb21
created by runtime.init.7 in goroutine 1
runtime/proc.go:336 +0x1a

goroutine 3 gp=0xc000002c40 m=nil [GC sweep wait]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
runtime/proc.go:435 +0xce fp=0xc000083f80 sp=0xc000083f60 pc=0x7ff6ef0e598e
runtime.goparkunlock(...)
runtime/proc.go:441
runtime.bgsweep(0xc000034080)
runtime/mgcsweep.go:276 +0x94 fp=0xc000083fc8 sp=0xc000083f80 pc=0x7ff6ef09de74
runtime.gcenable.gowrap1()
runtime/mgc.go:204 +0x25 fp=0xc000083fe0 sp=0xc000083fc8 pc=0x7ff6ef092285
runtime.goexit({})
runtime/asm_amd64.s:1700 +0x1 fp=0xc000083fe8 sp=0xc000083fe0 pc=0x7ff6ef0edb21
created by runtime.gcenable in goroutine 1
runtime/mgc.go:204 +0x66

goroutine 4 gp=0xc000002e00 m=nil [GC scavenge wait]:
runtime.gopark(0xc000034080?, 0x7ff6f0af6788?, 0x1?, 0x0?, 0xc000002e00?)
runtime/proc.go:435 +0xce fp=0xc000093f78 sp=0xc000093f58 pc=0x7ff6ef0e598e
runtime.goparkunlock(...)
runtime/proc.go:441
runtime.(*scavengerState).park(0x7ff6f16c9d80)
runtime/mgcscavenge.go:425 +0x49 fp=0xc000093fa8 sp=0xc000093f78 pc=0x7ff6ef09b909
runtime.bgscavenge(0xc000034080)
runtime/mgcscavenge.go:653 +0x3c fp=0xc000093fc8 sp=0xc000093fa8 pc=0x7ff6ef09be7c
runtime.gcenable.gowrap2()
runtime/mgc.go:205 +0x25 fp=0xc000093fe0 sp=0xc000093fc8 pc=0x7ff6ef092225
runtime.goexit({})
runtime/asm_amd64.s:1700 +0x1 fp=0xc000093fe8 sp=0xc000093fe0 pc=0x7ff6ef0edb21
created by runtime.gcenable in goroutine 1
runtime/mgc.go:205 +0xa5

goroutine 5 gp=0xc000003340 m=nil [finalizer wait]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
runtime/proc.go:435 +0xce fp=0xc000095e30 sp=0xc000095e10 pc=0x7ff6ef0e598e
runtime.runfinq()
runtime/mfinal.go:196 +0x107 fp=0xc000095fe0 sp=0xc000095e30 pc=0x7ff6ef091207
runtime.goexit({})
runtime/asm_amd64.s:1700 +0x1 fp=0xc000095fe8 sp=0xc000095fe0 pc=0x7ff6ef0edb21
created by runtime.createfing in goroutine 1
runtime/mfinal.go:166 +0x3d
rax 0x64
rbx 0x7ffb49a1098c
rcx 0xe58fad9ee7350000
rdx 0x1c0a75e0000
rdi 0x1c0ed450860
rsi 0x0
rbp 0x96abff459
rsp 0x96abfeef0
r8 0x7ffffffffffffffc
r9 0x96acbc000
r10 0x8101010101010100
r11 0x1c0ed0a0090
r12 0xffffffffffffffff
r13 0x5d
r14 0x1c0a7839928
r15 0x0
rip 0x7ffb4994cb12
rflags 0x10206
cs 0x33
fs 0x53
gs 0x2b

<!-- gh-comment-id:4257199980 --> @haochuan-he commented on GitHub (Apr 16, 2026): I encountered the same problem, even after restarting Windows and reinstalling Ollama. (Windows 11, CPU AMD R9 7940H, Ollama version 0.20.7) Exception 0xc0000005 0x8 0x7ffb4994cb12 0x7ffb4994cb12 PC=0x7ffb4994cb12 signal arrived during external code execution runtime.cgocall(0x7ff6f021a310, 0xc00004bda0) runtime/cgocall.go:167 +0x3e fp=0xc00004bd78 sp=0xc00004bd10 pc=0x7ff6ef0e243e github.com/ollama/ollama/x/imagegen/mlx._Cfunc_mlx_random_key(0xc00007e2e0, 0x19d9441197e) _cgo_gotypes.go:1978 +0x50 fp=0xc00004bda0 sp=0xc00004bd78 pc=0x7ff6ef771770 github.com/ollama/ollama/x/imagegen/mlx.RandomKey.func1(...) github.com/ollama/ollama/x/imagegen/mlx/mlx.go:1870 github.com/ollama/ollama/x/imagegen/mlx.RandomKey(0x19d9441197e) github.com/ollama/ollama/x/imagegen/mlx/mlx.go:1870 +0x5d fp=0xc00004bdd8 sp=0xc00004bda0 pc=0x7ff6ef77a69d github.com/ollama/ollama/x/imagegen/mlx.init.0() github.com/ollama/ollama/x/imagegen/mlx/mlx.go:1848 +0xa9 fp=0xc00004be28 sp=0xc00004bdd8 pc=0x7ff6ef77a4a9 runtime.doInit1(0x7ff6f15af2c0) runtime/proc.go:7350 +0xdd fp=0xc00004bf50 sp=0xc00004be28 pc=0x7ff6ef0c343d runtime.doInit(...) runtime/proc.go:7317 runtime.main() runtime/proc.go:254 +0x325 fp=0xc00004bfe0 sp=0xc00004bf50 pc=0x7ff6ef0b4e85 runtime.goexit({}) runtime/asm_amd64.s:1700 +0x1 fp=0xc00004bfe8 sp=0xc00004bfe0 pc=0x7ff6ef0edb21 goroutine 2 gp=0xc0000028c0 m=nil [force gc (idle)]: runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?) runtime/proc.go:435 +0xce fp=0xc000081fa8 sp=0xc000081f88 pc=0x7ff6ef0e598e runtime.goparkunlock(...) runtime/proc.go:441 runtime.forcegchelper() runtime/proc.go:348 +0xb8 fp=0xc000081fe0 sp=0xc000081fa8 pc=0x7ff6ef0b50f8 runtime.goexit({}) runtime/asm_amd64.s:1700 +0x1 fp=0xc000081fe8 sp=0xc000081fe0 pc=0x7ff6ef0edb21 created by runtime.init.7 in goroutine 1 runtime/proc.go:336 +0x1a goroutine 3 gp=0xc000002c40 m=nil [GC sweep wait]: runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?) runtime/proc.go:435 +0xce fp=0xc000083f80 sp=0xc000083f60 pc=0x7ff6ef0e598e runtime.goparkunlock(...) runtime/proc.go:441 runtime.bgsweep(0xc000034080) runtime/mgcsweep.go:276 +0x94 fp=0xc000083fc8 sp=0xc000083f80 pc=0x7ff6ef09de74 runtime.gcenable.gowrap1() runtime/mgc.go:204 +0x25 fp=0xc000083fe0 sp=0xc000083fc8 pc=0x7ff6ef092285 runtime.goexit({}) runtime/asm_amd64.s:1700 +0x1 fp=0xc000083fe8 sp=0xc000083fe0 pc=0x7ff6ef0edb21 created by runtime.gcenable in goroutine 1 runtime/mgc.go:204 +0x66 goroutine 4 gp=0xc000002e00 m=nil [GC scavenge wait]: runtime.gopark(0xc000034080?, 0x7ff6f0af6788?, 0x1?, 0x0?, 0xc000002e00?) runtime/proc.go:435 +0xce fp=0xc000093f78 sp=0xc000093f58 pc=0x7ff6ef0e598e runtime.goparkunlock(...) runtime/proc.go:441 runtime.(*scavengerState).park(0x7ff6f16c9d80) runtime/mgcscavenge.go:425 +0x49 fp=0xc000093fa8 sp=0xc000093f78 pc=0x7ff6ef09b909 runtime.bgscavenge(0xc000034080) runtime/mgcscavenge.go:653 +0x3c fp=0xc000093fc8 sp=0xc000093fa8 pc=0x7ff6ef09be7c runtime.gcenable.gowrap2() runtime/mgc.go:205 +0x25 fp=0xc000093fe0 sp=0xc000093fc8 pc=0x7ff6ef092225 runtime.goexit({}) runtime/asm_amd64.s:1700 +0x1 fp=0xc000093fe8 sp=0xc000093fe0 pc=0x7ff6ef0edb21 created by runtime.gcenable in goroutine 1 runtime/mgc.go:205 +0xa5 goroutine 5 gp=0xc000003340 m=nil [finalizer wait]: runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?) runtime/proc.go:435 +0xce fp=0xc000095e30 sp=0xc000095e10 pc=0x7ff6ef0e598e runtime.runfinq() runtime/mfinal.go:196 +0x107 fp=0xc000095fe0 sp=0xc000095e30 pc=0x7ff6ef091207 runtime.goexit({}) runtime/asm_amd64.s:1700 +0x1 fp=0xc000095fe8 sp=0xc000095fe0 pc=0x7ff6ef0edb21 created by runtime.createfing in goroutine 1 runtime/mfinal.go:166 +0x3d rax 0x64 rbx 0x7ffb49a1098c rcx 0xe58fad9ee7350000 rdx 0x1c0a75e0000 rdi 0x1c0ed450860 rsi 0x0 rbp 0x96abff459 rsp 0x96abfeef0 r8 0x7ffffffffffffffc r9 0x96acbc000 r10 0x8101010101010100 r11 0x1c0ed0a0090 r12 0xffffffffffffffff r13 0x5d r14 0x1c0a7839928 r15 0x0 rip 0x7ffb4994cb12 rflags 0x10206 cs 0x33 fs 0x53 gs 0x2b
Author
Owner

@wpostma commented on GitHub (Apr 16, 2026):

can not reproduce here any more in ollama version 0.20.7? (tested april 16. windows 11, windows server 2025)

<!-- gh-comment-id:4261798756 --> @wpostma commented on GitHub (Apr 16, 2026): can not reproduce here any more in ollama version 0.20.7? (tested april 16. windows 11, windows server 2025)
Author
Owner

@haochuan-he commented on GitHub (Apr 16, 2026):

I made some attempts today, and I found that this issue can still be triggered in at least Ollama v0.20.7 and v0.20.6. However, I made a more interesting discovery.

My computer is an ASUS TianXuan 4, equipped with a CPU AMD R9 7940H, GPU Nvidia 4060 Laptop, and Windows 11 25H2. My computer can switch between "Mixed Mode" (using both the discrete and integrated graphics cards) and "Integrated Graphics Mode" (disabling the discrete graphics card and using only the integrated graphics card, Radeon 780M) through the built-in "Armoury Crate".

The issue of Ollama crashing upon startup only occurs when using "Integrated Graphics Mode". The symptom is that entering any Ollama command in cmd will cause a crash. Meanwhile, the Ollama app can display the main UI, but there are still issues such as inability to select models or log in. However, when I switch to "Mixed Mode", everything works normally with Ollama.

In my impression, early versions of ollama were capable of functioning normally in "integrated graphics mode" (sorry, I cannot recall the exact version number). Therefore, I believe this bug is related to how ollama detects the system's hardware environment.

In addition to the crash output mentioned earlier, I have also attached part of the content from app.log below:

time=2026-04-17T01:12:00.426+08:00 level=INFO source=app_windows.go:282 msg="starting Ollama" app=D:\OtherSoftwares\ForOllama\Ollama version=0.20.7 OS=Windows/10.0.26200
time=2026-04-17T01:12:00.445+08:00 level=INFO source=app.go:239 msg="initialized tools registry" tool_count=0
time=2026-04-17T01:12:00.534+08:00 level=INFO source=app.go:254 msg="starting ollama server"
time=2026-04-17T01:12:00.534+08:00 level=INFO source=app.go:285 msg="starting ui server" port=54320
time=2026-04-17T01:12:01.156+08:00 level=INFO source=ui.go:242 msg=site.serveHTTP http.method=GET http.path=/api/v1/settings http.pattern="GET /api/v1/settings" http.status=200 http.d=503.8µs request_id=1776359521155713300 version=0.20.7
time=2026-04-17T01:12:01.288+08:00 level=INFO source=ui.go:242 msg=site.serveHTTP http.method=GET http.path=/api/v1/cloud http.pattern="GET /api/v1/cloud" http.status=200 http.d=552.5µs request_id=1776359521288267200 version=0.20.7

......

time=2026-04-17T01:21:17.668+08:00 level=INFO source=ui.go:242 msg=site.serveHTTP http.method=GET http.path=/api/v1/settings http.pattern="GET /api/v1/settings" http.status=200 http.d=1.0434ms request_id=1776360077667561300 version=0.20.7
time=2026-04-17T01:21:20.023+08:00 level=INFO source=updater.go:296 msg="beginning update checker" interval=1h0m0s
time=2026-04-17T01:21:27.026+08:00 level=WARN source=app.go:342 msg="ollama server not ready, continuing anyway" error="timeout waiting for Ollama server to be ready"
time=2026-04-17T01:21:27.619+08:00 level=WARN source=ui.go:142 msg="ollama server not ready, retrying" attempt=2
time=2026-04-17T01:21:38.623+08:00 level=ERROR source=ui.go:154 msg="ollama server not ready after retries" error="timeout waiting for Ollama server to be ready"


<!-- gh-comment-id:4262099091 --> @haochuan-he commented on GitHub (Apr 16, 2026): I made some attempts today, and I found that this issue can still be triggered in at least Ollama v0.20.7 and v0.20.6. However, I made a more interesting discovery. My computer is an ASUS TianXuan 4, equipped with a CPU AMD R9 7940H, GPU Nvidia 4060 Laptop, and Windows 11 25H2. My computer can switch between "Mixed Mode" (using both the discrete and integrated graphics cards) and "Integrated Graphics Mode" (disabling the discrete graphics card and using only the integrated graphics card, Radeon 780M) through the built-in "Armoury Crate". The issue of Ollama crashing upon startup only occurs when using "Integrated Graphics Mode". The symptom is that entering any Ollama command in cmd will cause a crash. Meanwhile, the Ollama app can display the main UI, but there are still issues such as inability to select models or log in. However, when I switch to "Mixed Mode", everything works normally with Ollama. In my impression, early versions of ollama were capable of functioning normally in "integrated graphics mode" (sorry, I cannot recall the exact version number). Therefore, I believe this bug is related to how ollama detects the system's hardware environment. In addition to the crash output mentioned earlier, I have also attached part of the content from app.log below: ``` time=2026-04-17T01:12:00.426+08:00 level=INFO source=app_windows.go:282 msg="starting Ollama" app=D:\OtherSoftwares\ForOllama\Ollama version=0.20.7 OS=Windows/10.0.26200 time=2026-04-17T01:12:00.445+08:00 level=INFO source=app.go:239 msg="initialized tools registry" tool_count=0 time=2026-04-17T01:12:00.534+08:00 level=INFO source=app.go:254 msg="starting ollama server" time=2026-04-17T01:12:00.534+08:00 level=INFO source=app.go:285 msg="starting ui server" port=54320 time=2026-04-17T01:12:01.156+08:00 level=INFO source=ui.go:242 msg=site.serveHTTP http.method=GET http.path=/api/v1/settings http.pattern="GET /api/v1/settings" http.status=200 http.d=503.8µs request_id=1776359521155713300 version=0.20.7 time=2026-04-17T01:12:01.288+08:00 level=INFO source=ui.go:242 msg=site.serveHTTP http.method=GET http.path=/api/v1/cloud http.pattern="GET /api/v1/cloud" http.status=200 http.d=552.5µs request_id=1776359521288267200 version=0.20.7 ...... time=2026-04-17T01:21:17.668+08:00 level=INFO source=ui.go:242 msg=site.serveHTTP http.method=GET http.path=/api/v1/settings http.pattern="GET /api/v1/settings" http.status=200 http.d=1.0434ms request_id=1776360077667561300 version=0.20.7 time=2026-04-17T01:21:20.023+08:00 level=INFO source=updater.go:296 msg="beginning update checker" interval=1h0m0s time=2026-04-17T01:21:27.026+08:00 level=WARN source=app.go:342 msg="ollama server not ready, continuing anyway" error="timeout waiting for Ollama server to be ready" time=2026-04-17T01:21:27.619+08:00 level=WARN source=ui.go:142 msg="ollama server not ready, retrying" attempt=2 time=2026-04-17T01:21:38.623+08:00 level=ERROR source=ui.go:154 msg="ollama server not ready after retries" error="timeout waiting for Ollama server to be ready" ```
Author
Owner

@wpostma commented on GitHub (Apr 17, 2026):

I had wondered if it is due to hardware environment or rather, whether or not it checks and can withstand attempts to load dlls that may be missing and not shipped with Ollama install, perhaps dlls only used by or installed by certain versions of the Nvidia CUDA toolkit.

<!-- gh-comment-id:4269809620 --> @wpostma commented on GitHub (Apr 17, 2026): I had wondered if it is due to hardware environment or rather, whether or not it checks and can withstand attempts to load dlls that may be missing and not shipped with Ollama install, perhaps dlls only used by or installed by certain versions of the Nvidia CUDA toolkit.
Author
Owner

@PureBlissAK commented on GitHub (Apr 18, 2026):

🤖 Automated Triage & Analysis Report

Issue: #15481
Analyzed: 2026-04-18T18:20:50.612293

Analysis

  • Type: unknown
  • Severity: medium
  • Components: unknown

Implementation Plan

  • Effort: medium
  • Steps:

This issue has been triaged and marked for implementation.

<!-- gh-comment-id:4274307280 --> @PureBlissAK commented on GitHub (Apr 18, 2026): <!-- ollama-issue-orchestrator:v1 issue:15481 --> ## 🤖 Automated Triage & Analysis Report **Issue**: #15481 **Analyzed**: 2026-04-18T18:20:50.612293 ### Analysis - **Type**: unknown - **Severity**: medium - **Components**: unknown ### Implementation Plan - **Effort**: medium - **Steps**: *This issue has been triaged and marked for implementation.*
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#35657