[GH-ISSUE #11426] Error:"nil pointer dereference" panic when running my fine-tune Gemma3 #7543

Open
opened 2026-04-12 19:38:36 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @CheeseSilly on GitHub (Jul 15, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/11426

What is the issue?

When i ran my fine-tune Gemma3-4b on my laptop,it just caused some errors.

[signal 0xc0000005 code=0x0 addr=0x0 pc=0x7ff6b3b759d9]

goroutine 66 [running]:
github.com/ollama/ollama/ml/nn.(*Conv2D).Forward(...)
        C:/a/ollama/ollama/ml/nn/convolution.go:10
github.com/ollama/ollama/model/models/gemma3.(*VisionModel).Forward(0xc0000a9a40, {0x7ff6b4a6bc70, 0xc001d4ba00}, {0x7ff6b4a78dc0?, 0xc001d52000?})
        C:/a/ollama/ollama/model/models/gemma3/model_vision.go:91 +0x99
github.com/ollama/ollama/model/models/gemma3.(*Model).EncodeMultimodal(0xc001c48000, {0x7ff6b4a6bc70, 0xc001d4ba00}, {0xc0028c6000, 0x400436,

And i checked the log, it indicated a memory issue.

fatal error: runtime: cannot allocate memory

But i can run it on llama factory on the cloud server,no errors.

So i tried to pull the original version, Gemma-3-4b-it from modelscope.

And it just ran normally.

i dont know how to deal with it,and it seems to be unrelative to my memory limitations or fine-tune model itself.

RAM: 32GB
GPU: RTX4060
CPU: Intel i9-13900H

Relevant log output

time=2025-07-15T13:11:45.848+08:00 level=INFO source=routes.go:1235 msg="server config" env="map[CUDA_VISIBLE_DEVICES: GPU_DEVICE_ORDINAL: HIP_VISIBLE_DEVICES: HSA_OVERRIDE_GFX_VERSION: HTTPS_PROXY:http://127.0.0.1:20112 HTTP_PROXY:http://127.0.0.1:20112 NO_PROXY: OLLAMA_CONTEXT_LENGTH:4096 OLLAMA_DEBUG:INFO OLLAMA_FLASH_ATTENTION:false OLLAMA_GPU_OVERHEAD:0 OLLAMA_HOST:http://127.0.0.1:11434 OLLAMA_INTEL_GPU:false OLLAMA_KEEP_ALIVE:5m0s OLLAMA_KV_CACHE_TYPE: OLLAMA_LLM_LIBRARY: OLLAMA_LOAD_TIMEOUT:5m0s OLLAMA_MAX_LOADED_MODELS:0 OLLAMA_MAX_QUEUE:512 OLLAMA_MODELS:E:\\ollama\\models OLLAMA_MULTIUSER_CACHE:false OLLAMA_NEW_ENGINE:false OLLAMA_NOHISTORY:false OLLAMA_NOPRUNE:false OLLAMA_NUM_PARALLEL:0 OLLAMA_ORIGINS:[http://localhost https://localhost http://localhost:* https://localhost:* http://127.0.0.1 https://127.0.0.1 http://127.0.0.1:* https://127.0.0.1:* http://0.0.0.0 https://0.0.0.0 http://0.0.0.0:* https://0.0.0.0:* app://* file://* tauri://* vscode-webview://* vscode-file://*] OLLAMA_SCHED_SPREAD:false ROCR_VISIBLE_DEVICES:]"
time=2025-07-15T13:11:45.985+08:00 level=INFO source=images.go:476 msg="total blobs: 27"
time=2025-07-15T13:11:45.998+08:00 level=INFO source=images.go:483 msg="total unused blobs removed: 13"
time=2025-07-15T13:11:45.998+08:00 level=INFO source=routes.go:1288 msg="Listening on 127.0.0.1:11434 (version 0.9.6)"
time=2025-07-15T13:11:45.998+08:00 level=INFO source=gpu.go:217 msg="looking for compatible GPUs"
time=2025-07-15T13:11:45.998+08:00 level=INFO source=gpu_windows.go:167 msg=packages count=1
time=2025-07-15T13:11:45.998+08:00 level=INFO source=gpu_windows.go:183 msg="efficiency cores detected" maxEfficiencyClass=1
time=2025-07-15T13:11:45.998+08:00 level=INFO source=gpu_windows.go:214 msg="" package=0 cores=14 efficiency=8 threads=20
time=2025-07-15T13:11:46.215+08:00 level=INFO source=types.go:130 msg="inference compute" id=GPU-d4e272d1-0429-88a0-11bb-0cafe04988d8 library=cuda variant=v12 compute=8.9 driver=12.9 name="NVIDIA GeForce RTX 4060 Laptop GPU" total="8.0 GiB" available="6.9 GiB"
[GIN] 2025/07/15 - 13:11:46 | 200 |            0s |       127.0.0.1 | HEAD     "/"
[GIN] 2025/07/15 - 13:11:46 | 200 |      1.0343ms |       127.0.0.1 | GET      "/api/tags"
[GIN] 2025/07/15 - 13:12:03 | 200 |            0s |       127.0.0.1 | HEAD     "/"
[GIN] 2025/07/15 - 13:12:06 | 201 |       2.151ms |       127.0.0.1 | POST     "/api/blobs/sha256:d7d146e2236a04ae124df275c97e2db40574c63cc0726c5311db515e77107cf7"
[GIN] 2025/07/15 - 13:12:06 | 201 |      4.7251ms |       127.0.0.1 | POST     "/api/blobs/sha256:db561986582658fc37d01f39a800c1c684efd9a52df5dec771c3fc907fbb8dd2"
[GIN] 2025/07/15 - 13:12:06 | 201 |      4.7251ms |       127.0.0.1 | POST     "/api/blobs/sha256:e6ddeb92989c50407f65674692eb10734aa13d2ef73c323ce738b22aedce7bac"
[GIN] 2025/07/15 - 13:12:06 | 201 |      4.1706ms |       127.0.0.1 | POST     "/api/blobs/sha256:cae167ad6e91668fa74073f6d28125a675c96bdded41e1896cc61cf7d4612260"
[GIN] 2025/07/15 - 13:12:06 | 201 |      4.6916ms |       127.0.0.1 | POST     "/api/blobs/sha256:3ffd5f11778dc73e2b69b3c00535e4121e1badf7018136263cd17b5b34fbaa53"
[GIN] 2025/07/15 - 13:12:06 | 201 |      3.6535ms |       127.0.0.1 | POST     "/api/blobs/sha256:50b2f405ba56a26d4913fd772089992252d7f942123cc0a034d96424221ba946"
[GIN] 2025/07/15 - 13:12:06 | 201 |      3.6535ms |       127.0.0.1 | POST     "/api/blobs/sha256:45a857d8a2495d0be30a5d2d6de03278195eb028b6e0b8efc248bfa697d65f05"
[GIN] 2025/07/15 - 13:12:06 | 201 |     16.5275ms |       127.0.0.1 | POST     "/api/blobs/sha256:a1fb770bb412598d213bf23b1a4ad7219720ced69c228f19e852176735fb8ca2"
[GIN] 2025/07/15 - 13:12:06 | 201 |    100.3148ms |       127.0.0.1 | POST     "/api/blobs/sha256:4667f2089529e8e7657cfb6d1c19910ae71ff5f28aa7ab2ff2763330affad795"
[GIN] 2025/07/15 - 13:12:17 | 201 |   10.1696138s |       127.0.0.1 | POST     "/api/blobs/sha256:d7f6d83d59f25643e75609b5fef1cde803c01ddcc8bd9f7427ac97934a9079db"
[GIN] 2025/07/15 - 13:12:19 | 201 |   13.0647825s |       127.0.0.1 | POST     "/api/blobs/sha256:c9aa71ee0597b25a62121bb794a0ce46b245a059e94e74ad510ea9be41318ecf"
fatal error: runtime: cannot allocate memory

OS

Windows

GPU

Nvidia

CPU

Intel

Ollama version

0.9.6

Originally created by @CheeseSilly on GitHub (Jul 15, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/11426 ### What is the issue? When i ran my fine-tune Gemma3-4b on my laptop,it just caused some errors. ``` [signal 0xc0000005 code=0x0 addr=0x0 pc=0x7ff6b3b759d9] goroutine 66 [running]: github.com/ollama/ollama/ml/nn.(*Conv2D).Forward(...) C:/a/ollama/ollama/ml/nn/convolution.go:10 github.com/ollama/ollama/model/models/gemma3.(*VisionModel).Forward(0xc0000a9a40, {0x7ff6b4a6bc70, 0xc001d4ba00}, {0x7ff6b4a78dc0?, 0xc001d52000?}) C:/a/ollama/ollama/model/models/gemma3/model_vision.go:91 +0x99 github.com/ollama/ollama/model/models/gemma3.(*Model).EncodeMultimodal(0xc001c48000, {0x7ff6b4a6bc70, 0xc001d4ba00}, {0xc0028c6000, 0x400436, ``` And i checked the log, it indicated a memory issue. ``` fatal error: runtime: cannot allocate memory ``` But i can run it on llama factory on the cloud server,no errors. So i tried to pull the original version, Gemma-3-4b-it from modelscope. And it just ran normally. i dont know how to deal with it,and it seems to be unrelative to my memory limitations or fine-tune model itself. RAM: 32GB GPU: RTX4060 CPU: Intel i9-13900H ### Relevant log output ```shell time=2025-07-15T13:11:45.848+08:00 level=INFO source=routes.go:1235 msg="server config" env="map[CUDA_VISIBLE_DEVICES: GPU_DEVICE_ORDINAL: HIP_VISIBLE_DEVICES: HSA_OVERRIDE_GFX_VERSION: HTTPS_PROXY:http://127.0.0.1:20112 HTTP_PROXY:http://127.0.0.1:20112 NO_PROXY: OLLAMA_CONTEXT_LENGTH:4096 OLLAMA_DEBUG:INFO OLLAMA_FLASH_ATTENTION:false OLLAMA_GPU_OVERHEAD:0 OLLAMA_HOST:http://127.0.0.1:11434 OLLAMA_INTEL_GPU:false OLLAMA_KEEP_ALIVE:5m0s OLLAMA_KV_CACHE_TYPE: OLLAMA_LLM_LIBRARY: OLLAMA_LOAD_TIMEOUT:5m0s OLLAMA_MAX_LOADED_MODELS:0 OLLAMA_MAX_QUEUE:512 OLLAMA_MODELS:E:\\ollama\\models OLLAMA_MULTIUSER_CACHE:false OLLAMA_NEW_ENGINE:false OLLAMA_NOHISTORY:false OLLAMA_NOPRUNE:false OLLAMA_NUM_PARALLEL:0 OLLAMA_ORIGINS:[http://localhost https://localhost http://localhost:* https://localhost:* http://127.0.0.1 https://127.0.0.1 http://127.0.0.1:* https://127.0.0.1:* http://0.0.0.0 https://0.0.0.0 http://0.0.0.0:* https://0.0.0.0:* app://* file://* tauri://* vscode-webview://* vscode-file://*] OLLAMA_SCHED_SPREAD:false ROCR_VISIBLE_DEVICES:]" time=2025-07-15T13:11:45.985+08:00 level=INFO source=images.go:476 msg="total blobs: 27" time=2025-07-15T13:11:45.998+08:00 level=INFO source=images.go:483 msg="total unused blobs removed: 13" time=2025-07-15T13:11:45.998+08:00 level=INFO source=routes.go:1288 msg="Listening on 127.0.0.1:11434 (version 0.9.6)" time=2025-07-15T13:11:45.998+08:00 level=INFO source=gpu.go:217 msg="looking for compatible GPUs" time=2025-07-15T13:11:45.998+08:00 level=INFO source=gpu_windows.go:167 msg=packages count=1 time=2025-07-15T13:11:45.998+08:00 level=INFO source=gpu_windows.go:183 msg="efficiency cores detected" maxEfficiencyClass=1 time=2025-07-15T13:11:45.998+08:00 level=INFO source=gpu_windows.go:214 msg="" package=0 cores=14 efficiency=8 threads=20 time=2025-07-15T13:11:46.215+08:00 level=INFO source=types.go:130 msg="inference compute" id=GPU-d4e272d1-0429-88a0-11bb-0cafe04988d8 library=cuda variant=v12 compute=8.9 driver=12.9 name="NVIDIA GeForce RTX 4060 Laptop GPU" total="8.0 GiB" available="6.9 GiB" [GIN] 2025/07/15 - 13:11:46 | 200 | 0s | 127.0.0.1 | HEAD "/" [GIN] 2025/07/15 - 13:11:46 | 200 | 1.0343ms | 127.0.0.1 | GET "/api/tags" [GIN] 2025/07/15 - 13:12:03 | 200 | 0s | 127.0.0.1 | HEAD "/" [GIN] 2025/07/15 - 13:12:06 | 201 | 2.151ms | 127.0.0.1 | POST "/api/blobs/sha256:d7d146e2236a04ae124df275c97e2db40574c63cc0726c5311db515e77107cf7" [GIN] 2025/07/15 - 13:12:06 | 201 | 4.7251ms | 127.0.0.1 | POST "/api/blobs/sha256:db561986582658fc37d01f39a800c1c684efd9a52df5dec771c3fc907fbb8dd2" [GIN] 2025/07/15 - 13:12:06 | 201 | 4.7251ms | 127.0.0.1 | POST "/api/blobs/sha256:e6ddeb92989c50407f65674692eb10734aa13d2ef73c323ce738b22aedce7bac" [GIN] 2025/07/15 - 13:12:06 | 201 | 4.1706ms | 127.0.0.1 | POST "/api/blobs/sha256:cae167ad6e91668fa74073f6d28125a675c96bdded41e1896cc61cf7d4612260" [GIN] 2025/07/15 - 13:12:06 | 201 | 4.6916ms | 127.0.0.1 | POST "/api/blobs/sha256:3ffd5f11778dc73e2b69b3c00535e4121e1badf7018136263cd17b5b34fbaa53" [GIN] 2025/07/15 - 13:12:06 | 201 | 3.6535ms | 127.0.0.1 | POST "/api/blobs/sha256:50b2f405ba56a26d4913fd772089992252d7f942123cc0a034d96424221ba946" [GIN] 2025/07/15 - 13:12:06 | 201 | 3.6535ms | 127.0.0.1 | POST "/api/blobs/sha256:45a857d8a2495d0be30a5d2d6de03278195eb028b6e0b8efc248bfa697d65f05" [GIN] 2025/07/15 - 13:12:06 | 201 | 16.5275ms | 127.0.0.1 | POST "/api/blobs/sha256:a1fb770bb412598d213bf23b1a4ad7219720ced69c228f19e852176735fb8ca2" [GIN] 2025/07/15 - 13:12:06 | 201 | 100.3148ms | 127.0.0.1 | POST "/api/blobs/sha256:4667f2089529e8e7657cfb6d1c19910ae71ff5f28aa7ab2ff2763330affad795" [GIN] 2025/07/15 - 13:12:17 | 201 | 10.1696138s | 127.0.0.1 | POST "/api/blobs/sha256:d7f6d83d59f25643e75609b5fef1cde803c01ddcc8bd9f7427ac97934a9079db" [GIN] 2025/07/15 - 13:12:19 | 201 | 13.0647825s | 127.0.0.1 | POST "/api/blobs/sha256:c9aa71ee0597b25a62121bb794a0ce46b245a059e94e74ad510ea9be41318ecf" fatal error: runtime: cannot allocate memory ``` ### OS Windows ### GPU Nvidia ### CPU Intel ### Ollama version 0.9.6
GiteaMirror added the bug label 2026-04-12 19:38:36 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#7543