"custom_nodes/comfyui_controlnet_aux/dev_interface.py" did not exist on "57b0ad8e820e370e608810364d80d8212d2407e9"
Unverified Commit c4175fca authored by Santosh Bhavani's avatar Santosh Bhavani Committed by GitHub
Browse files

fix(build): Handle namespace packages for PyPI CUDA detection (#2580)



fix: handle nvidia namespace packages where __file__ is None
Signed-off-by: default avatarSantosh Bhavani <santosh.bhavani@live.com>
Co-authored-by: default avatarKirthi Shankar Sivamani <ksivamani@nvidia.com>
parent 402ea54b
......@@ -245,11 +245,13 @@ def _nvidia_cudart_include_dir() -> str:
return ""
# Installing some nvidia-* packages, like nvshmem, create nvidia name, so "import nvidia"
# above doesn't through. However, they don't set "__file__" attribute.
if nvidia.__file__ is None:
return ""
# above doesn't throw. However, they don't set "__file__" attribute.
if nvidia.__file__ is not None:
nvidia_root = Path(nvidia.__file__).parent
else:
nvidia_root = Path(nvidia.__path__[0]) # namespace package
include_dir = Path(nvidia.__file__).parent / "cuda_runtime"
include_dir = nvidia_root / "cuda_runtime"
return str(include_dir) if include_dir.exists() else ""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment