From 5a14ff8aced335d60833a2fb24afba61191ca46e Mon Sep 17 00:00:00 2001 From: Andrey Talman Date: Fri, 28 Feb 2025 00:35:47 +0000 Subject: [PATCH] Add cufile to list of libraries to preload (#148137) Fixes: https://github.com/pytorch/pytorch/issues/148120 Test with almalinux/9-base:latest : ``` >>> import torch Traceback (most recent call last): File "", line 1, in File "/usr/local/lib64/python3.9/site-packages/torch/__init__.py", line 401, in from torch._C import * # noqa: F403 ImportError: libcufile.so.0: cannot open shared object file: No such file or directory >>> exit() [root@18b37257e416 /]# vi /usr/local/lib64/python3.9/site-packages/torch/__init__.py [root@18b37257e416 /]# python3 Python 3.9.19 (main, Sep 11 2024, 00:00:00) [GCC 11.5.0 20240719 (Red Hat 11.5.0-2)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import torch /usr/local/lib64/python3.9/site-packages/torch/_subclasses/functional_tensor.py:276: UserWarning: Failed to initialize NumPy: No module named 'numpy' (Triggered internally at /pytorch/torch/csrc/utils/tensor_numpy.cpp:81.) cpu = _conversion_method_template(device=torch.device("cpu")) >>> torch.__version__ '2.7.0.dev20250227+cu126' ``` Pull Request resolved: https://github.com/pytorch/pytorch/pull/148137 Approved by: https://github.com/malfet --- torch/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/torch/__init__.py b/torch/__init__.py index dfd465396810..c49ae87f2221 100644 --- a/torch/__init__.py +++ b/torch/__init__.py @@ -343,6 +343,7 @@ def _load_global_deps() -> None: "cufft": "libcufft.so.*[0-9]", "curand": "libcurand.so.*[0-9]", "nvjitlink": "libnvJitLink.so.*[0-9]", + "cufile": "libcufile.so.*[0-9]", "cusparse": "libcusparse.so.*[0-9]", "cusparselt": "libcusparseLt.so.*[0-9]", "cusolver": "libcusolver.so.*[0-9]",