ollama - 💡(How to fix) Fix occasional crashes when trying ocr with qwen3.5:9b [4 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
ollama/ollama#14759Fetched 2026-04-08 00:32:01
View on GitHub
Comments
4
Participants
2
Timeline
5
Reactions
0
Author
Timeline (top)
commented ×4labeled ×1

Error Message

Error 500: Error with Ollama API for testimage.jpg using model qwen3.5:9b: model runner has unexpectedly stopped, this may be due to resource limitations or an internal error, check ollama server logs for details (status code: 500) Mär 10 08:36:48 kai-BeyondMax-Series ollama[3744]: HW Exception by GPU node-1 (Agent handle: 0x753cf86eff60) reason :GPU Hang Mär 10 08:36:49 kai-BeyondMax-Series ollama[3744]: time=2026-03-10T08:36:49.152+01:00 level=ERROR source=server.go:1610 msg="post predict" error="Post "http://127.0.0.1:44471/completion\": EOF"

RAW_BUFFERClick to expand / collapse

What is the issue?

I have occasional crashes when using qwen3.5:9b (and all other qwen vision models tested so far) for ocr purposes:

Error 500: Error with Ollama API for testimage.jpg using model qwen3.5:9b: model runner has unexpectedly stopped, this may be due to resource limitations or an internal error, check ollama server logs for details (status code: 500)

server.log

Mär 10 08:36:48 kai-BeyondMax-Series ollama[3744]: HW Exception by GPU node-1 (Agent handle: 0x753cf86eff60) reason :GPU Hang Mär 10 08:36:49 kai-BeyondMax-Series ollama[3744]: time=2026-03-10T08:36:49.152+01:00 level=ERROR source=server.go:1610 msg="post predict" error="Post "http://127.0.0.1:44471/completion\": EOF" Mär 10 08:36:49 kai-BeyondMax-Series ollama[3744]: [GIN] 2026/03/10 - 08:36:49 | 500 | 2.433882273s | 10.9.2.222 | POST "/api/generate"

AMD 395+ Max Ubuntu 25.04

Best regards

Kai

Relevant log output

OS

No response

GPU

No response

CPU

No response

Ollama version

No response

extent analysis

Fix Plan

The issue seems to be related to GPU resource limitations or internal errors. To fix this, we can try the following steps:

  • Increase the GPU memory allocation for the Ollama API
  • Implement retry logic for the API calls to handle temporary GPU hang issues
  • Optimize the model configuration to reduce GPU usage

Example Code

Here's an example of how you can implement retry logic in Python:

import time
import requests

def retry_api_call(url, data, retries=3, delay=1):
    for i in range(retries):
        try:
            response = requests.post(url, json=data)
            response.raise_for_status()
            return response.json()
        except requests.exceptions.RequestException as e:
            if i < retries - 1:
                time.sleep(delay)
            else:
                raise e

# Example usage:
url = "http://127.0.0.1:44471/completion"
data = {"model": "qwen3.5:9b", "image": "testimage.jpg"}
response = retry_api_call(url, data)

Configuration Changes

You can also try increasing the GPU memory allocation by setting the CUDA_VISIBLE_DEVICES environment variable or by configuring the Ollama API to use a specific GPU device.

Verification

To verify that the fix worked, you can test the API call with the retry logic and check the server logs for any error messages. You can also monitor the GPU usage and memory allocation to ensure that the issue is resolved.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

ollama - 💡(How to fix) Fix occasional crashes when trying ocr with qwen3.5:9b [4 comments, 2 participants]