Merged updates from Comfy-Org/comfy-aimdo#20 and Windows build chore#6
Merged updates from Comfy-Org/comfy-aimdo#20 and Windows build chore#6Apophis3158 wants to merge 20 commits intoasagi4:hack/rocm-supportfrom
Conversation
These are deprecated on HIP. Apparently you're supposed to use device and stream APIs
| Remove-Item -Recurse -Force $detoursDir | ||
| Write-Host "Build successful: comfy_aimdo\aimdo_rocm.dll" | ||
|
|
||
| # Copy amdhip64_7.dll to comfy_aimdo directory |
There was a problem hiding this comment.
Will try this PR locally - would be great if it works.
There was a problem hiding this comment.
Don't try this yet, it seems specified 4 hooks working well because using _rocm_sdk_core, but Adrenalin one loaded first still used somewhere and will cause hang.
There was a problem hiding this comment.
You're right, we need to investigate further to ensure it doesn’t use the driver .dll at all.
3dae483 to
afbd5c1
Compare
|
Update: use
|
|
|
In my system running example.py with I'll try this test case later. |
| if ((ret < 0) || (ret >= BUFF_SIZE)) { | ||
| log(ERROR, "%s: Buffer overflow in snprintf\n", __func__); | ||
| } else { | ||
| log(DEBUG, "%s: driver_dlls[%d] = %s\n", __func__, i, driver_dlls[i]); |
There was a problem hiding this comment.
This prints:
aimdo: src-win\cuda-detour.c:96:DEBUG:aimdo_setup_hooks: driver_dlls[0] = C:\ComfyUI\venv\Lib\site-packages\_rocm_sdk_core\bin\amdhip64.dll
aimdo: src-win\cuda-detour.c:96:DEBUG:aimdo_setup_hooks: driver_dlls[1] = C:\ComfyUI\venv\Lib\site-packages\_rocm_sdk_core\bin\amdhip64_7.dll
The first file (_rocm_sdk_core\bin\amdhip64.dll) doesn't exist on my system, and presumably not on yours either - this print should be removed.
AMD renamed/versioned it - what used to be amdhip64.dll is now amdhip64_7.dll on current drivers. (AFAIK amdhip64.dll = ROCm 5, amdhip64_6.dll = ROCm 6)
|
|
||
| ret = _dupenv_s(&venv, &buff_size, "VIRTUAL_ENV"); | ||
| if ((ret == 0) && (venv != NULL)) { | ||
| log(DEBUG, "%s: found VIRTUAL_ENV: %s\n", __func__, venv); |
There was a problem hiding this comment.
I think we shouldn't really add more debug logs - the console is already crowded enough, as the original NVIDIA Windows version already has three aimdo-related prints.
afbd5c1 to
965a63d
Compare
|
@0xDELUXA after some further tests and looking up, I became frustrated with This PR only retains merge Comfy-Org#20 and Windows chore. |
|
In some PR, setting PATH to dll will fix loading, but didn't work with me. And this print come out when torch is called first time, such as torch.cuda.current_device() in example.py or torch.cuda.is_available() from comfy_kitchen in ComfyUI. Maybe the right dll was loaded without print when aimdo not installed, then the wrong dll will be load with print when aimdo installed, but why? |
|
@asagi4 please help test this merge on Linux. |
Same here.
Indeed. But why would that happen? That’s what I’d like to know too. |
So we stick with the manual copy approach then? |
| # ── Compile ──────────────────────────────────────────────────────────────────── | ||
| $sources = @(Get-Item "$root\src\*.c" -ErrorAction SilentlyContinue) + @(Get-Item "$root\src-win\*.c" -ErrorAction SilentlyContinue) | ForEach-Object { "`"$(F $_.FullName)`"" } | ||
| if (-not $sources) { throw "No .c source files found in src\ or src-win\." } | ||
| # use pure command to build: pwsh will handel *.c expanding and \ slash |
There was a problem hiding this comment.
@asagi4 Looks like this typo made its way into the PR as-is: Comfy-Org@8480e31#diff-d876599642c83c7fd9405bc52e67f83c7172209100023d010558721949f39db0R36
|
I can take a look later. I don't mind keeping the support PR up to date with changes to master but since on Linux making aimdo work seems to depend entirely on AMD fixing HIP / rocr (unless someone can figure out a workaround), I'm not really actively working on it at the moment. |
|
Yeah, we ran into problems that we can't fix locally. AMD should look at the Linux side regarding the |
bd6b9bf to
80ce863
Compare
|
I merged this manually and dropped some of the type fixes and just downgraded the incompatible pointer type errors to warnings. |
Tested on RX 9070 XT (gfx1201), Windows 10, torch 2.10.0+rocm7.12.0a20260304: example.py debug log