ollama 在MI300X上通过Docker运行时,由于rocBLAS错误而失败:无法初始化Tensile主机:未找到设备,

jfewjypa  于 4个月前  发布在  Docker
关注(0)|答案(5)|浏览(154)

重现步骤:

  1. 在一台带有单个MI300X的机器上运行一个使用ollama/ollama:rocm的Docker容器。
  2. 在容器内运行ollama run llama3.1:70B

实际行为:

rocBLAS error: Could not initialize Tensile host: No devices found

完整输出:

ollama serve &
[1] 649
[root@f4425b1a0236 workflow]# Couldn't find '/root/.ollama/id_ed25519'. Generating new private key.
Your new public key is: 

ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHmumM0c/iN0gZ9aPo99pq6QfzU+7AuA4V3/z933kCjK

2024/08/19 16:42:26 routes.go:1123: INFO server config env="map[CUDA_VISIBLE_DEVICES: GPU_DEVICE_ORDINAL: HIP_VISIBLE_DEVICES: HSA_OVERRIDE_GFX_VERSION: OLLAMA_DEBUG:false OLLAMA_FLASH_ATTENTION:false OLLAMA_HOST:http://0.0.0.0:11434 OLLAMA_INTEL_GPU:false OLLAMA_KEEP_ALIVE:5m0s OLLAMA_LLM_LIBRARY: OLLAMA_MAX_LOADED_MODELS:0 OLLAMA_MAX_QUEUE:512 OLLAMA_MODELS:/root/.ollama/models 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://*] OLLAMA_RUNNERS_DIR: OLLAMA_SCHED_SPREAD:false OLLAMA_TMPDIR: ROCR_VISIBLE_DEVICES:]"
time=2024-08-19T16:42:26.947Z level=INFO source=images.go:782 msg="total blobs: 0"
time=2024-08-19T16:42:26.948Z level=INFO source=images.go:790 msg="total unused blobs removed: 0"
time=2024-08-19T16:42:26.948Z level=INFO source=routes.go:1170 msg="Listening on [::]:11434 (version 0.3.5)"
time=2024-08-19T16:42:26.949Z level=INFO source=payload.go:30 msg="extracting embedded files" dir=/tmp/ollama307827265/runners
time=2024-08-19T16:42:30.581Z level=INFO source=payload.go:44 msg="Dynamic LLM libraries [cpu cpu_avx cpu_avx2 cuda_v11 rocm_v60102]"
time=2024-08-19T16:42:30.581Z level=INFO source=gpu.go:204 msg="looking for compatible GPUs"
time=2024-08-19T16:42:30.590Z level=WARN source=amd_linux.go:201 msg="amdgpu too old gfx000" gpu=0
time=2024-08-19T16:42:30.590Z level=WARN source=amd_linux.go:201 msg="amdgpu too old gfx000" gpu=1
time=2024-08-19T16:42:30.590Z level=WARN source=amd_linux.go:201 msg="amdgpu too old gfx000" gpu=2
time=2024-08-19T16:42:30.603Z level=INFO source=amd_linux.go:345 msg="amdgpu is supported" gpu=3 gpu_type=gfx942
time=2024-08-19T16:42:30.603Z level=WARN source=amd_linux.go:201 msg="amdgpu too old gfx000" gpu=4
time=2024-08-19T16:42:30.603Z level=WARN source=amd_linux.go:201 msg="amdgpu too old gfx000" gpu=5
time=2024-08-19T16:42:30.603Z level=WARN source=amd_linux.go:201 msg="amdgpu too old gfx000" gpu=6
time=2024-08-19T16:42:30.603Z level=WARN source=amd_linux.go:201 msg="amdgpu too old gfx000" gpu=7
time=2024-08-19T16:42:30.603Z level=INFO source=types.go:105 msg="inference compute" id=3 library=rocm compute=gfx942 driver=6.7 name=1002:74a1 total="192.0 GiB" available="191.7 GiB"

[root@f4425b1a0236 workflow]# 
[root@f4425b1a0236 workflow]# ollama pull llama3.1:70b
[GIN] 2024/08/19 - 16:42:37 | 200 |     129.844µs |       127.0.0.1 | HEAD     "/"
pulling manifest ⠇ time=2024-08-19T16:42:39.572Z level=INFO source=download.go:175 msg="downloading a677b4a4b70c in 65 624 MB part(s)"
pulling manifest 
pulling a677b4a4b70c...  58% ▕████████████████████████████████████████████████████                                      ▏  23 GB/ 39 GB  465 MB/s     35st
pulling manifest 
pulling a677b4a4b70c... 100% ▕██████████████████████████████████████████████████████████████████████████████████████████▏  39 GB                         t
pulling manifest 
pulling a677b4a4b70c... 100% ▕██████████████████████████████████████████████████████████████████████████████████████████▏  39 GB                         
pulling manifest 
pulling a677b4a4b70c... 100% ▕██████████████████████████████████████████████████████████████████████████████████████████▏  39 GB                         
pulling manifest 
pulling a677b4a4b70c... 100% ▕██████████████████████████████████████████████████████████████████████████████████████████▏  39 GB                         
pulling manifest 
pulling manifest 
pulling a677b4a4b70c... 100% ▕██████████████████████████████████████████████████████████████████████████████████████████▏  39 GB                         
pulling 11ce4ee3e170... 100% ▕██████████████████████████████████████████████████████████████████████████████████████████▏ 1.7 KB                         
pulling 0ba8f0e314b4... 100% ▕██████████████████████████████████████████████████████████████████████████████████████████▏  12 KB                         
pulling 56bb8bd477a5... 100% ▕██████████████████████████████████████████████████████████████████████████████████████████▏   96 B                         
pulling 654440dac7f3... 100% ▕██████████████████████████████████████████████████████████████████████████████████████████▏  486 B                         
verifying sha256 digest 
writing manifest 
removing any unused layers 
success
ollama run llama3.1:70b
[GIN] 2024/08/19 - 16:45:03 | 200 |      37.636µs |       127.0.0.1 | HEAD     "/"
[GIN] 2024/08/19 - 16:45:03 | 200 |   33.789282ms |       127.0.0.1 | POST     "/api/show"
time=2024-08-19T16:45:03.649Z level=INFO source=sched.go:710 msg="new model will fit in available VRAM in single GPU, loading" model=/root/.ollama/models/blobs/sha256-a677b4a4b70c45e702b1d600f7905e367733c53898b8be60e3f29272cf334574 gpu=3 parallel=4 available=205843886080 required="41.2 GiB"
time=2024-08-19T16:45:03.650Z level=INFO source=memory.go:309 msg="offload to rocm" layers.requested=-1 layers.model=81 layers.offload=81 layers.split="" memory.available="[191.7 GiB]" memory.required.full="41.2 GiB" memory.required.partial="41.2 GiB" memory.required.kv="2.5 GiB" memory.required.allocations="[41.2 GiB]" memory.weights.total="38.4 GiB" memory.weights.repeating="37.6 GiB" memory.weights.nonrepeating="822.0 MiB" memory.graph.full="1.1 GiB" memory.graph.partial="1.1 GiB"
time=2024-08-19T16:45:03.665Z level=INFO source=server.go:393 msg="starting llama server" cmd="/tmp/ollama307827265/runners/rocm_v60102/ollama_llama_server --model /root/.ollama/models/blobs/sha256-a677b4a4b70c45e702b1d600f7905e367733c53898b8be60e3f29272cf334574 --ctx-size 8192 --batch-size 512 --embedding --log-disable --n-gpu-layers 81 --numa distribute --parallel 4 --port 37363"
time=2024-08-19T16:45:03.665Z level=INFO source=sched.go:445 msg="loaded runners" count=1
time=2024-08-19T16:45:03.665Z level=INFO source=server.go:593 msg="waiting for llama runner to start responding"
time=2024-08-19T16:45:03.665Z level=INFO source=server.go:627 msg="waiting for server to become available" status="llm server error"
⠹ WARNING: /proc/sys/kernel/numa_balancing is enabled, this has been observed to impair performance
INFO [main] build info | build=1 commit="1e6f655" tid="138631197918016" timestamp=1724085903
INFO [main] system info | n_threads=96 n_threads_batch=-1 system_info="AVX = 1 | AVX_VNNI = 0 | AVX2 = 0 | AVX512 = 0 | AVX512_VBMI = 0 | AVX512_VNNI = 0 | AVX512_BF16 = 0 | FMA = 0 | NEON = 0 | SVE = 0 | ARM_FMA = 0 | F16C = 0 | FP16_VA = 0 | WASM_SIMD = 0 | BLAS = 1 | SSE3 = 1 | SSSE3 = 1 | VSX = 0 | MATMUL_INT8 = 0 | LLAMAFILE = 1 | " tid="138631197918016" timestamp=1724085903 total_threads=192
INFO [main] HTTP server listening | hostname="127.0.0.1" n_threads_http="191" port="37363" tid="138631197918016" timestamp=1724085903
⠸ time=2024-08-19T16:45:03.917Z level=INFO source=server.go:627 msg="waiting for server to become available" status="llm server loading model"
llama_model_loader: loaded meta data with 29 key-value pairs and 724 tensors from /root/.ollama/models/blobs/sha256-a677b4a4b70c45e702b1d600f7905e367733c53898b8be60e3f29272cf334574 (version GGUF V3 (latest))
llama_model_loader: Dumping metadata keys/values. Note: KV overrides do not apply in this output.
llama_model_loader: - kv   0:                       general.architecture str              = llama
llama_model_loader: - kv   1:                               general.type str              = model
llama_model_loader: - kv   2:                               general.name str              = Meta Llama 3.1 70B Instruct
llama_model_loader: - kv   3:                           general.finetune str              = Instruct
llama_model_loader: - kv   4:                           general.basename str              = Meta-Llama-3.1
llama_model_loader: - kv   5:                         general.size_label str              = 70B
llama_model_loader: - kv   6:                            general.license str              = llama3.1
llama_model_loader: - kv   7:                               general.tags arr[str,6]       = ["facebook", "meta", "pytorch", "llam...
llama_model_loader: - kv   8:                          general.languages arr[str,8]       = ["en", "de", "fr", "it", "pt", "hi", ...
llama_model_loader: - kv   9:                          llama.block_count u32              = 80
llama_model_loader: - kv  10:                       llama.context_length u32              = 131072
llama_model_loader: - kv  11:                     llama.embedding_length u32              = 8192
llama_model_loader: - kv  12:                  llama.feed_forward_length u32              = 28672
llama_model_loader: - kv  13:                 llama.attention.head_count u32              = 64
llama_model_loader: - kv  14:              llama.attention.head_count_kv u32              = 8
llama_model_loader: - kv  15:                       llama.rope.freq_base f32              = 500000.000000
llama_model_loader: - kv  16:     llama.attention.layer_norm_rms_epsilon f32              = 0.000010
llama_model_loader: - kv  17:                          general.file_type u32              = 2
llama_model_loader: - kv  18:                           llama.vocab_size u32              = 128256
llama_model_loader: - kv  19:                 llama.rope.dimension_count u32              = 128
llama_model_loader: - kv  20:                       tokenizer.ggml.model str              = gpt2
llama_model_loader: - kv  21:                         tokenizer.ggml.pre str              = llama-bpe
llama_model_loader: - kv  22:                      tokenizer.ggml.tokens arr[str,128256]  = ["!", "\"", "#", "$", "%", "&", "'", ...
llama_model_loader: - kv  23:                  tokenizer.ggml.token_type arr[i32,128256]  = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
llama_model_loader: - kv  24:                      tokenizer.ggml.merges arr[str,280147]  = ["Ġ Ġ", "Ġ ĠĠĠ", "ĠĠ ĠĠ", "...
llama_model_loader: - kv  25:                tokenizer.ggml.bos_token_id u32              = 128000
llama_model_loader: - kv  26:                tokenizer.ggml.eos_token_id u32              = 128009
llama_model_loader: - kv  27:                    tokenizer.chat_template str              = {{- bos_token }}\n{%- if custom_tools ...
llama_model_loader: - kv  28:               general.quantization_version u32              = 2
llama_model_loader: - type  f32:  162 tensors
llama_model_loader: - type q4_0:  561 tensors
llama_model_loader: - type q6_K:    1 tensors
⠦ llm_load_vocab: special tokens cache size = 256
⠧ llm_load_vocab: token to piece cache size = 0.7999 MB
llm_load_print_meta: format           = GGUF V3 (latest)
llm_load_print_meta: arch             = llama
llm_load_print_meta: vocab type       = BPE
llm_load_print_meta: n_vocab          = 128256
llm_load_print_meta: n_merges         = 280147
llm_load_print_meta: vocab_only       = 0
llm_load_print_meta: n_ctx_train      = 131072
llm_load_print_meta: n_embd           = 8192
llm_load_print_meta: n_layer          = 80
llm_load_print_meta: n_head           = 64
llm_load_print_meta: n_head_kv        = 8
llm_load_print_meta: n_rot            = 128
llm_load_print_meta: n_swa            = 0
llm_load_print_meta: n_embd_head_k    = 128
llm_load_print_meta: n_embd_head_v    = 128
llm_load_print_meta: n_gqa            = 8
llm_load_print_meta: n_embd_k_gqa     = 1024
llm_load_print_meta: n_embd_v_gqa     = 1024
llm_load_print_meta: f_norm_eps       = 0.0e+00
llm_load_print_meta: f_norm_rms_eps   = 1.0e-05
llm_load_print_meta: f_clamp_kqv      = 0.0e+00
llm_load_print_meta: f_max_alibi_bias = 0.0e+00
llm_load_print_meta: f_logit_scale    = 0.0e+00
llm_load_print_meta: n_ff             = 28672
llm_load_print_meta: n_expert         = 0
llm_load_print_meta: n_expert_used    = 0
llm_load_print_meta: causal attn      = 1
llm_load_print_meta: pooling type     = 0
llm_load_print_meta: rope type        = 0
llm_load_print_meta: rope scaling     = linear
llm_load_print_meta: freq_base_train  = 500000.0
llm_load_print_meta: freq_scale_train = 1
llm_load_print_meta: n_ctx_orig_yarn  = 131072
llm_load_print_meta: rope_finetuned   = unknown
llm_load_print_meta: ssm_d_conv       = 0
llm_load_print_meta: ssm_d_inner      = 0
llm_load_print_meta: ssm_d_state      = 0
llm_load_print_meta: ssm_dt_rank      = 0
llm_load_print_meta: model type       = 70B
llm_load_print_meta: model ftype      = Q4_0
llm_load_print_meta: model params     = 70.55 B
llm_load_print_meta: model size       = 37.22 GiB (4.53 BPW) 
llm_load_print_meta: general.name     = Meta Llama 3.1 70B Instruct
llm_load_print_meta: BOS token        = 128000 '<|begin_of_text|>'
llm_load_print_meta: EOS token        = 128009 '<|eot_id|>'
llm_load_print_meta: LF token         = 128 'Ä'
llm_load_print_meta: EOT token        = 128009 '<|eot_id|>'
llm_load_print_meta: max token length = 256
⠇ 
rocBLAS error: Could not initialize Tensile host: No devices found
f5emj3cl

f5emj3cl1#

你正在使用哪个docker命令来启动容器?

8cdiaqws

8cdiaqws2#

你正在使用哪个docker命令来启动容器?
@rick-github 我是通过dstack与RunPod的集成来运行它的。基本上,RunPod运行容器。
在HF的TGI中它可以完美运行,但在Ollama中不行。

qoefvg9y

qoefvg9y3#

你能看到容器启动时使用的参数吗?例如,它是否有 --device /dev/kfd --device /dev/dri 标志?如果没有这些,Ollama 将无法访问 GPU。

3phpmpom

3phpmpom4#

你能看到容器启动时使用的参数吗?例如,它是否有 --device /dev/kfd --device /dev/dri 标志?如果没有这些,ollama 将无法访问 GPU。
100% 设备已挂载。甚至在 ollama serve 的日志中也可以看到这一点:

time=2024-08-19T16:42:30.603Z level=INFO source=types.go:105 msg="inference compute" id=3 library=rocm compute=gfx942 driver=6.7 name=1002:74a1 total="192.0 GiB" available="191.7 GiB"
i2loujxw

i2loujxw5#

从日志来看,似乎是amdgpu驱动程序在sysfs中枚举了8个GPU,GPU 3是正确的一个。我的怀疑是GPU选择中可能有些混淆,然后ROCm试图连接到一个错误的GPU上。使用-e OLLAMA_DEBUG=1运行可能会有更多的信息,或者您也可以尝试将HIP_VISIBLE_DEVICES设置为不同的值(我建议从3开始),看看是否能得到一个有效的设置。

相关问题