Skip to content

onnxruntime-gpu cannot use cuda libs that installed via pip? #22563

Discussion options

You must be logged in to vote

nvidia-cublas-cu12 contains the libcublasLt.so.12 and libcublas.so.12.

Please run the following shell script to update LD_LIBRARY_PATH:

site_packages_dir="$(python3 -c "import sysconfig; print(sysconfig.get_path('purelib'))")"
dirs=$(find "$site_packages_dir/nvidia" -type f \( -name "*.so" -o -name "*.so.*" \) -exec dirname {} \; | sort -u)
for dir in $dirs; do
    if [[ ":$LD_LIBRARY_PATH:" != *":$dir:"* ]]; then
        export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$dir"
    fi
done
echo "$LD_LIBRARY_PATH"

After that you can try your python script again.

You can also do it in python like

import os
import sys
from glob import glob

def find_dirs_with_shared_objects(base_dir):
    # Patterns …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by braindevices
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants