You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support ROCm on Windows with ADLX VRAM readings - #1799
On ROCm for Windows, torch.cuda.mem_get_info only counts the VRAM used by the current process, so the desktop and other programs look like free VRAM to vram_limit. With the desktop idle, torch reports 0.15 GiB used while the GPU has 2.54 GiB in use.
check_free_vram now goes through diffsynth.core.device.mem_get_info, which on Windows ROCm takes the VRAM used by other processes from ADLX (amd-adlx, new [amd] extra), so vram_limit behaves as it does on NVIDIA GPUs. The other-process share is refreshed at most once a second because an ADLX query takes about half a millisecond and check_free_vram runs on every layer forward; the call averages about 18 us. Without amd-adlx it prints a one-time hint and keeps the torch numbers. Other platforms are unchanged.
On ROCm, TORCH_ROCM_AOTRITON_ENABLE_EXPERIMENTAL=1 is now set by default, otherwise PyTorch SDPA has no flash or memory-efficient kernel on GPUs where AOTriton support is still experimental and fails or falls back to the math path. The setup docs (en/zh) also gain Windows install steps for AMD's ROCm 10 torch wheels.
@Artiprocher Thanks! ADLX (AMD Device Library eXtra) is AMD's official SDK for reading GPU state on Windows. It ships with the Adrenalin driver (amdadlx64.dll), so there is nothing extra to install on the driver side: https://gpuopen.com/adlx/
Nothing changes on other setups. mem_get_info only calls ADLX when sys.platform == "win32" and torch.version.hip is set. Everywhere else it returns torch.cuda.mem_get_info unchanged. On Windows ROCm without amd-adlx, it prints a one-time hint and uses the torch numbers as before.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On ROCm for Windows,
torch.cuda.mem_get_infoonly counts the VRAM used by the current process, so the desktop and other programs look like free VRAM tovram_limit. With the desktop idle, torch reports 0.15 GiB used while the GPU has 2.54 GiB in use.check_free_vramnow goes throughdiffsynth.core.device.mem_get_info, which on Windows ROCm takes the VRAM used by other processes from ADLX (amd-adlx, new[amd]extra), sovram_limitbehaves as it does on NVIDIA GPUs. The other-process share is refreshed at most once a second because an ADLX query takes about half a millisecond andcheck_free_vramruns on every layer forward; the call averages about 18 us. Withoutamd-adlxit prints a one-time hint and keeps the torch numbers. Other platforms are unchanged.On ROCm,
TORCH_ROCM_AOTRITON_ENABLE_EXPERIMENTAL=1is now set by default, otherwise PyTorch SDPA has no flash or memory-efficient kernel on GPUs where AOTriton support is still experimental and fails or falls back to the math path. The setup docs (en/zh) also gain Windows install steps for AMD's ROCm 10 torch wheels.