Repository: ollama
Issue: CUSTOM_CPU_FLAGS="" / non avx2 build
Labels: bug,build

### What is the issue?

sequel of #7640 Error: POST predict: Post "http://127.0.0.1:42623/completion": EOF

here is the command I used to build ollama:
```sh
make -j16 HIP_ARCHS=gfx1102 CUSTOM_CPU_FLAGS="" RUNNER_TARGETS=rocm dist
```

here is the relevant log part:
```
...
Dec 12 00:45:57 prox1 ollama[1632910]: ggml_cuda_init: found 1 ROCm devices:
Dec 12 00:45:57 prox1 ollama[1632910]:   Device 0: AMD Radeon™ RX 7600 XT, compute capability 11.0, VMM: no
Dec 12 00:45:57 prox1 ollama[1632910]: llm_load_tensors: ggml ctx size =    0.43 MiB
Dec 12 00:45:57 prox1 ollama[1632910]: llm_load_tensors: offloading 32 repeating layers to GPU
Dec 12 00:45:57 prox1 ollama[1632910]: llm_load_tensors: offloading non-repeating layers to GPU
Dec 12 00:45:57 prox1 ollama[1632910]: llm_load_tensors: offloaded 33/33 layers to GPU
Dec 12 00:45:57 prox1 ollama[1632910]: llm_load_tensors:      ROCm0 buffer size =  1903.13 MiB
Dec 12 00:45:57 prox1 ollama[1632910]: llm_load_tensors:        CPU buffer size =    98.44 MiB
Dec 12 00:45:58 prox1 ollama[1632910]: llama_new_context_with_model: n_ctx      = 8192
Dec 12 00:45:58 prox1 ollama[1632910]: llama_new_context_with_model: n_batch    = 2048
Dec 12 00:45:58 prox1 ollama[1632910]: llama_new_context_with_model: n_ubatch   = 512
Dec 12 00:45:58 prox1 ollama[1632910]: llama_new_context_with_model: flash_attn = 0
Dec 12 00:45:58 prox1 ollama[1632910]: llama_new_context_with_model: freq_base  = 10000000.0
Dec 12 00:45:58 prox1 ollama[1632910]: llama_new_context_with_model: freq_scale = 1
Dec 12 00:45:58 prox1 ollama[1632910]: llama_kv_cache_init:      ROCm0 KV buffer size =  2560.00 MiB
Dec 12 00:45:58 prox1 ollama[1632910]: llama_new_context_with_model: KV self size  = 2560.00 MiB, K (f16): 1280.00 MiB, V (f16): 1280.00 MiB
Dec 12 00:45:58 prox1 ollama[1632910]: llama_new_context_with_model:  ROCm_Host  output buffer size =     0.79 MiB
Dec 12 00:45:58 prox1 ollama[1632910]: llama_new_context_with_model:      ROCm0 compute buffer size =   548.00 MiB
Dec 12 00:45:58 prox1 ollama[1632910]: llama_new_context_with_model:  ROCm_Host compute buffer size =    21.01 MiB
Dec 12 00:45:58 prox1 ollama[1632910]: llama_new_context_with_model: graph nodes  = 1254
Dec 12 00:45:58 prox1 ollama[1632910]: llama_new_context_with_model: graph splits = 2
Dec 12 01:32:55 prox1 ollama[1642790]: time=2024-12-12T01:32:55.520+01:00 level=INFO source=server.go:594 msg="llama runner started in 3.26 seconds"
Dec 12 01:32:55 prox1 ollama[1642790]: [GIN] 2024/12/12 - 01:32:55 | 200 |  3.426053264s |       127.0.0.1 | POST     "/api/generate"
Dec 12 01:33:06 prox1 ollama[1642790]: SIGILL: illegal instruction
Dec 12 01:33:06 prox1 ollama[1642790]: PC=0x7513232be656 m=5 sigcode=2
Dec 12 01:33:06 prox1 ollama[1642790]: signal arrived during cgo execution
Dec 12 01:33:06 prox1 ollama[1642790]: instruction bytes: 0xc4 0xe2 0x79 0x13 0xc0 0xc5 0xf0 0x57 0xc9 0xc5 0xf8 0x2e 0xc1 0xf 0x9b 0xc0
...
``` 

objdump -d `./dist/linux-amd64/lib/ollama/runners/rocm/ollama_llama_server` shows avx instructions:
```
   d5d1c:	c4 e2 7d 78 c8       	vpbroadcastb %xmm0,%ymm1
   d646d:	c4 e2 7d 78 c8       	vpbroadcastb %xmm0,%ymm1
  27005a:	c4 e3 45 06 c6 03    	vperm2f128 $0x3,%ymm6,%ymm7,%ymm0
  27006a:	c4 e3 55 06 cc 03    	vperm2f128 $0x3,%ymm4,%ymm5,%ymm1
  270108:	c4 e3 7d 06 e0 00    	vperm2f128 $0x0,%ymm0,%ymm0,%ymm4
  270116:	c4 e3 45 06 d7 11    	vperm2f128 $0x11,%ymm7,%ymm7,%ymm2
  270242:	c4 e3 5d 02 e2 f0    	vpblendd $0xf0,%ymm2,%ymm4,%ymm4
...
```

Idem for ollama and libggml_rocm.so, .

I will try to find the origin of the byte-codes sequence '0xc4 0xe2 0x79 0x13 0xc0 0xc5 0xf0 0x57 0xc9 0xc5 0xf8 0x2e 0xc1 0xf 0x9b 0xc0'. If someone know how to do this, let us know.

Open questions:
- origin of those avx instructions, ollama code or ROCm libs ?
- how can I start the runner in a debugger ?



### OS

Linux

### GPU

AMD

### CPU

Other

### Ollama version

0.5.2-rc1-0-g6a6328a, 0.5.0-rc1-6-g1841309