[Bug] CUDA illegal memory access (MUL_MAT) on RTX 5090 with Cohere MoE architecture (Windows)
What is the issue?
Description: I am experiencing a consistent CUDA illegal memory access error and subsequent llama-server crash (exit status 0xc0000409) when running a cohere2moe architecture model on Windows 11 equipped with an RTX 5090. The crash specifically occurs during prompt evaluation/generation (MUL_MAT failed) inside ggml-cuda.cu.
Environment:
OS: Windows 11
GPU: NVIDIA GeForce RTX 5090 (32GB VRAM)
Ollama Version: 0.34.3 (Windows)
Model Architecture: cohere2moe (specifically north-mini-code-1.0 / custom GGUF)
Steps to Reproduce:
Run a cohere2moe based model on a Windows machine with an RTX 5090.
Define a Modelfile with PARAMETER num_ctx 8192 (or higher).
Send a chat request to the /api/chat endpoint.
The server crashes immediately during inference with MUL_MAT failed.
Relevant log output
srv init: init: chat template, thinking = 0
srv init: preserve_reasoning kwarg: not supported by template
srv llama_server: model loaded
srv llama_server: listening on http://127.0.0.1:53768
...
slot launch_slot_: id 0 | task 0 | processing task, is_child = 0
slot operator(): id 0 | task 0 | new prompt, n_ctx_slot = 8192, n_keep = 4, task.n_tokens = 1824
slot operator(): id 0 | task 0 | cached n_tokens = 0, memory_seq_rm [0, end)
slot print_timing: id 0 | task 0 | prompt processing, n_tokens = 800, progress = 0.44, t = 16.63 s / 48.12 tokens per second
slot operator(): id 0 | task 0 | cached n_tokens = 800, memory_seq_rm [800, end)
slot create_check: id 0 | task 0 | created context checkpoint 1 of 32 (pos_min = 0, pos_max = 799, n_tokens = 800, size = 56.260 MiB)
ggml_cuda_compute_forward: MUL_MAT failed
CUDA error: an illegal memory access was encountered
C:\a\ollama\ollama\build\llama-server-cuda_v13\_deps\llama_cpp-src\ggml\src\ggml-cuda\ggml-cuda.cu:108: CUDA error
current device: 0, in function ggml_cuda_compute_forward at C:\a\ollama\ollama\build\llama-server-cuda_v13\_deps\llama_cpp-src\ggml\src\ggml-cuda\ggml-cuda.cu:2422
err
[GIN] 2026/09/24 - 10:51:55 | 500 | 1m2s | 100.71.246.58 | POST "/api/chat"OS
Windows
GPU
Nvidia
CPU
Intel
Ollama version
0.34.3
Source: ollama/ollama