下記の条件において、docker-composeの設定ファイルとしては正しいと思えるのに
GPUを使ってくれなかったことがあったので、対策を説明する。
<条件>
・OS:Windows11
・GPU:NVIDIA RTX4070Ti
・動作状況: WSL2+ubuntu24.4+Docker
<当初のdocker-compose.ymlの設定>
version: '3'
services:
llm-server:
image: ollama/ollama:latest
volumes:
- ollama_data:/root/.ollama
ports:
- "11434:11434"
environment:
- CUDA_VISIBLE_DEVICES=all
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [ gpu ]
restart: unless-stopped
webui:
image: ghcr.io/open-webui/open-webui:latest
container_name: open-webui
ports:
- "3000:8080"
environment:
- OLLAMA_BASE_URL=http://llm-server:11434
volumes:
- webui_storage:/app/backend/data
depends_on:
- llm-server
restart: unless-stopped
services:
llm-server:
image: ollama/ollama:latest
volumes:
- ollama_data:/root/.ollama
ports:
- "11434:11434"
environment:
- CUDA_VISIBLE_DEVICES=all
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [ gpu ]
restart: unless-stopped
webui:
image: ghcr.io/open-webui/open-webui:latest
container_name: open-webui
ports:
- "3000:8080"
environment:
- OLLAMA_BASE_URL=http://llm-server:11434
volumes:
- webui_storage:/app/backend/data
depends_on:
- llm-server
restart: unless-stopped
volumes:
ollama_data:
webui_storage:
<対策>
以下の2行を削除(コメント化)してGPU検出をollama側に任せた。
# environment:
# - CUDA_VISIBLE_DEVICES=all
# - CUDA_VISIBLE_DEVICES=all
0 件のコメント:
コメントを投稿