diff --git a/comfy/model_management.py b/comfy/model_management.py index a3a167503..d57d4efe2 100644 --- a/comfy/model_management.py +++ b/comfy/model_management.py @@ -132,13 +132,15 @@ def get_total_memory(dev=None, torch_total_too=False): _, mem_total_cuda = torch.cuda.mem_get_info(dev) mem_total_torch = mem_reserved mem_total = mem_total_cuda - if torch_total_too: - return (mem_total, mem_total_torch) + return mem_total, mem_total_torch else: return mem_total +# we're required to call get_device_name early on to initialize the methods get_total_memory will call +if torch.cuda.is_available() and hasattr(torch.version, "hip") and torch.version.hip is not None: + logging.info(f"Detected HIP device: {torch.cuda.get_device_name(torch.cuda.current_device())}") total_vram = get_total_memory(get_torch_device()) / (1024 * 1024) total_ram = psutil.virtual_memory().total / (1024 * 1024) logging.info("Total VRAM {:0.0f} MB, total RAM {:0.0f} MB".format(total_vram, total_ram)) diff --git a/setup.py b/setup.py index c3cee08d0..2e70ea4ed 100644 --- a/setup.py +++ b/setup.py @@ -162,7 +162,7 @@ def dependencies(force_nightly: bool = False) -> List[str]: index_urls_selected = [stable for (stable, _) in index_urls] _alternative_indices_selected = [stable for (stable, _) in _alternative_indices] try: - # pip 23 + # pip 23, 24 finder = PackageFinder.create(LinkCollector(session, SearchScope([], index_urls_selected, no_index=False)), SelectionPreferences(allow_yanked=False, prefer_binary=False, allow_all_prereleases=True))