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
[BUG]: run_in_spawned_child_process fails if used as script #1767
Forwwarding from cupy/cupy#9803. If everything else fails for e.g. header discovery, cuda-pathfinder falls back to using:
_resolve_system_loaded_abs_path_in_subprocess
and: run_in_spawned_child_process
However, if you use this inside a script (i.e. missing if __name__ == "__main__"), the process spawn is problematic, as it leads to the script itself being executed during bootstrapping.
I.e. there are (apparently) two possible outcomes here:
Python raises an error pointing out that if __name == "__main__" seems missing (I got this if I just call _resolve_system_loaded_abs_path_in_subprocess() directly.
In the OP the script spawning process just triggered a second run of the script with the first run hitting the 10 second time-out if the script runs more than 10 seconds.
(I am not sure why the nested call succeeds spawning, but I doubt it matters.)
Not sure if this is a priority, because I am not sure how likely it is for cuda-pathfinder to reach this path. The work-around of setting CUDA_PATH= is also straight-forward. But it limits the reliability of this fallback.
How to Reproduce
I am not sure what likely needs to be weird about the environment for cuda-pathfinder to go to such lengths to find the right paths.
However, calling:
Activity
rwgk commentedon Mar 16, 2026
FYI — the fix was released with https://github.com/NVIDIA/cuda-python/releases/tag/cuda-pathfinder-v1.4.3