Skip to content

libnvrtc not found, v13 #8317

Closed
Closed
@ccoulombe

Description

@ccoulombe

Description

When trying to show config or running the example below, Cupy fails to find libnvrtc:

RuntimeError: CuPy failed to load libnvrtc.so.12: OSError: libnvrtc.so.12: cannot open shared object file: No such file or directory

On our HPC systems, cuda libraries are installed on non-standard location.
This was never an issue until v13 (worked in previous versions).

To Reproduce

import numpy as np
import cupy as cp
a = np.zeros((10,10))
d = cp.asarray(a)
d += 1.  ## fails

Installation

Built from GitHub source

Environment

Linux, Centos, HPC system, python 3.11, cuda 12.2.
Cupy v13.0.0

Cuda libraries are not installed in standard location.

Additional Information

The rpaths are present and correct :

$ patchelf --print-rpath $VIRTUAL_ENV/lib/python3.11/site-packages/cupy_backends/cuda/libs/nvrtc.cpython-311-x86_64-linux-gnu.so 
/cvmfs/soft.computecanada.ca/easybuild/software/2023/x86-64-v3/Core/cudacore/12.2.2/lib64:/cvmfs/soft.computecanada.ca/easybuild/software/2023/x86-64-v3/Core/cudacore/12.2.2/lib

and librairies are found.

But nvrtc library is not needed :

$ patchelf --print-needed $VIRTUAL_ENV/lib/python3.11/site-packages/cupy_backends/cuda/libs/nvrtc.cpython-311-x86_64-linux-gnu.so 
libcublas.so.12
libcufft.so.11
libcurand.so.10
libcusparse.so.12
libstdc++.so.6
libm.so.6
libgcc_s.so.1
libc.so.6

A quick fix: add libnvrtc as needed :

$ patchelf --add-needed libnvrtc.so.12 $VIRTUAL_ENV/lib/python3.11/site-packages/cupy_backends/cuda/libs/nvrtc.cpython-311-x86_64-linux-gnu.so

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions