mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-09-02 20:17:11 +08:00
chore: Add changes to support AMD on Linux
This commit is contained in:
parent
aeba0b3a26
commit
926af8eb6f
@ -169,7 +169,7 @@ def get_torch_device():
|
|||||||
elif is_mlu():
|
elif is_mlu():
|
||||||
return torch.device("mlu", torch.mlu.current_device())
|
return torch.device("mlu", torch.mlu.current_device())
|
||||||
else:
|
else:
|
||||||
return torch.device(torch.cuda.current_device())
|
return torch.device("cuda")
|
||||||
|
|
||||||
def get_total_memory(dev=None, torch_total_too=False):
|
def get_total_memory(dev=None, torch_total_too=False):
|
||||||
global directml_enabled
|
global directml_enabled
|
||||||
@ -202,7 +202,7 @@ def get_total_memory(dev=None, torch_total_too=False):
|
|||||||
mem_total = mem_total_mlu
|
mem_total = mem_total_mlu
|
||||||
else:
|
else:
|
||||||
stats = torch.cuda.memory_stats(dev)
|
stats = torch.cuda.memory_stats(dev)
|
||||||
mem_reserved = stats['reserved_bytes.all.current']
|
mem_reserved = torch.cuda.memory_reserved(dev)
|
||||||
_, mem_total_cuda = torch.cuda.mem_get_info(dev)
|
_, mem_total_cuda = torch.cuda.mem_get_info(dev)
|
||||||
mem_total_torch = mem_reserved
|
mem_total_torch = mem_reserved
|
||||||
mem_total = mem_total_cuda
|
mem_total = mem_total_cuda
|
||||||
|
|||||||
14
start.sh
Executable file
14
start.sh
Executable file
@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Start ComfyUI with AMD Radeon 7900 XTX (ROCm)
|
||||||
|
|
||||||
|
# Set ROCm architecture for Radeon 7900 XTX
|
||||||
|
echo "Setting ROCm environment for Radeon 7900 XTX (gfx1100)"
|
||||||
|
export PYTORCH_ROCM_ARCH=gfx1100
|
||||||
|
# Uncomment the next line if you encounter issues with ROCm version detection
|
||||||
|
export HSA_OVERRIDE_GFX_VERSION=11.0.0
|
||||||
|
|
||||||
|
# Optionally, activate your Python virtual environment here
|
||||||
|
source ../venv/bin/activate
|
||||||
|
|
||||||
|
# Start ComfyUI
|
||||||
|
python3 main.py --lowvram --use-split-cross-attention --fp16-unet --listen 0.0.0.0 "$@"
|
||||||
Loading…
x
Reference in New Issue
Block a user