mirror of
https://github.com/Comfy-Org/comfy-kitchen.git
synced 2026-11-04 23:37:42 +00:00
[PR #244] Fix source-wheel CMake cache invalidation for CUDA and Python toolchains #253
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/comfy-kitchen#253
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/comfy-kitchen/pull/244
Author: @xmarre
Created: 10/12/2026
Status: 🔄 Open
Base:
main← Head:fix/kitchen-cmake-build-cache-python-toolchain-20261012📝 Commits (1)
0e2d78cFix source-wheel CMake toolchain cache including stale CUDART provenance📊 Changes
2 files changed (+252 additions, -0 deletions)
View changed files
📝
setup.py(+103 -0)➕
tests/test_cuda_cmake_cache.py(+149 -0)📄 Description
Summary
Fix source-wheel builds that unintentionally reuse CMake compiler, FindPython or CUDA runtime-library discovery from a previous environment. This is build-system only:
setup.pyandtests/test_cuda_cmake_cache.py; it changes no CUDA kernels, attention numerics or model API. Separated from numerical PR #242.Observed failures
In a managed Python 3.12 / CUDA 13.0 WSL source build, stale
CMAKE_CUDA_COMPILERfrom CUDA 11.5 caused CMake to reset mid-configuration, losingCOMFY_CUDA_ARCHS. Separately, CMake's internal_Python_EXECUTABLE/_Python_INCLUDE_DIRpointed at system Python 3.10 despite a correct command-linePython_EXECUTABLE. Later CUDA interoperability investigation #245 also showed a build with CUDA 13 NVCC linked tolibcudart.so.11.0: checking compiler identity alone is insufficient whenCUDA_cudart_LIBRARYhas been cached independently.Fix
CUDAToolkit_ROOT, and cached shared/static CUDA runtime libraries against the selected toolkit root.build/temp.../cudaCMake state when a mismatch is found. Preserve the HIP build folder and incremental CUDA builds when identities match. Handle staleCMakeFilesleft without a cache.Python_EXECUTABLE,Python_INCLUDE_DIRandPython_ROOT_DIRexplicitly; fail early and clearly if the selected interpreter has noPython.h.commonpatherrors.Verification
Review notes
Review how FindCUDAToolkit caches library paths across environments, whether cache invalidation is sufficiently narrow, and CMake/Python discovery on Windows. A bad external CUDA runtime found again after a cache reset is rejected independently by #246 in its Linux shared-runtime mode. No promise that the cache reset alone repairs PyTorch/CUDA runtime interoperability.
Patch structure: one commit on upstream
mainbe9985bf2977133fb5a48aac4a9df8b6760194c8.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.