HOME TIP & TECH

TIP & TECH

TIP & TECH More information
intel arc gpu 로 comfyui 준비해보기

onionmixer 2025-09-18 22:31:15 24

## 기반 환경 ##

* ubuntu 22.04
* intel arc a770


#0) 일단 ip 를 고정 ip 로 설정
apt update
apt upgrade


#1) Intel GPU 저장소 키/리스트 추가 (Jammy client)
wget -qO - https://repositories.intel.com/gpu/intel-graphics.key | sudo gpg --dearmor --output /usr/share/keyrings/intel-graphics.gpg
echo "deb [arch=amd64,i386 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/gpu/ubuntu jammy client" | sudo tee /etc/apt/sources.list.d/intel-gpu-jammy.list
sudo apt update


#2) 런타임/미디어/그래픽 패키지 설치
sudo apt install -y intel-opencl-icd intel-level-zero-gpu level-zero intel-media-va-driver-non-free libmfx1 libmfxgen1 libvpl2 libegl-mesa0 libegl1-mesa libegl1-mesa-dev libgbm1 libgl1-mesa-dev libgl1-mesa-dri libglapi-mesa libgles2-mesa-dev libglx-mesa0 libigdgmm12 libxatracker2 mesa-va-drivers mesa-vdpau-drivers mesa-vulkan-drivers va-driver-all vainfo clinfo hwinfo


#3) GPU 디바이스 권한을 위해 현재 사용자를 render 그룹에 추가하고 재로그인/재부팅
sudo gpasswd -a $USER render
sudo newgrp render
sudo reboot


#4) ComfyUI 설치

#4.1) 의존 패키지
sudo apt update
sudo apt install -y python3-venv python3-dev build-essential git

#4.2) 소스 클론
git clone https://github.com/comfyanonymous/ComfyUI.git
cd ComfyUI

#4.3) 가상환경 구성
python3 -m venv .venv
source .venv/bin/activate

#4.4) 의존성 설치
pip install --upgrade pip
pip install -r requirements.txt


#5) ComfyUI 환경이 intel arc 를 지원하도록 변경
# ComfyUI 가상환경(venv)에서 다음을 실행한다

pip uninstall -y torch torchvision torchaudio
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/xpu

# ComfyUI 디렉터리의 venv 활성화 후 확인법
file::check_xpu.sh
#!/bin/sh
python -c "import torch; print('torch', torch.__version__); \
print('has xpu:', hasattr(torch,'xpu')); \
print('xpu available:', getattr(torch,'xpu').is_available()); \
print('xpu count:', getattr(torch,'xpu').device_count() if hasattr(torch,'xpu') else 0)"

================
torch 2.8.0+xpu
has xpu: True
xpu available: True
xpu count: 1
================


#6) /home/onion/ComfyUI/start_compy.sh 파일을 만들고 systemctl 에 등록하기
file::/home/onion/ComfyUI/start_compy.sh


file::/etc/systemd/system/comfyui.service
[Unit]
Description=ComfyUI (onion) on port 7860
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=onion
Group=onion
WorkingDirectory=/home/onion/ComfyUI
# 가상환경을 PATH에 잡거나, 스크립트 내부에서 venv 활성화
Environment=PATH=/home/onion/ComfyUI/.venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
ExecStart=/usr/bin/env bash -lc '/home/onion/ComfyUI/start_compy.sh'
Restart=on-failure
RestartSec=3
TimeoutStopSec=30
KillMode=control-group

[Install]
WantedBy=multi-user.target


sudo systemctl daemon-reload
sudo systemctl enable comfyui.service
sudo systemctl start comfyui.service
sudo systemctl status comfyui.service


#7) comfyui-manager 를 설치하기

cd ~/ComfyUI
source .venv/bin/activate
cd custom_nodes
git clone https://github.com/ltdrdata/ComfyUI-Manager comfyui-manager


#8) huggingface 관련 download 사용하는 방법
# (옵션) 토큰 로그인
# hf auth login  # 또는: HF_TOKEN=hf_xxx hf auth login --token $HF_TOKEN

# 단일 파일을 대상 폴더로 직접 다운로드
hf download city96/Qwen-Image-gguf qwen-image-Q4_K_S.gguf \
 --local-dir ~/ComfyUI/models/diffusion_models


#9) 최신버전 nvtop 을 사용하기

https://github.com/Syllo/nvtop/releases

여기에서 가장 최신버전의 AppImage 파일을 받아서 chmod 로 퍼미션을 조절해서 사용하면 된다.

댓글 0개

Previous / Next
Next IBM RS/6000 43p 관련 자료 링크 모음 및 약간의 정보