Skip to content

Commit 2128a6a

Browse files
committed
searching for nvcuvid
1 parent f714f53 commit 2128a6a

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed

packaging/pre_build_script.sh

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,80 @@ set -ex
77
# and PyTorch actually has it included. PyTorch, however, does not have the
88
# CMake helpers.
99
conda install -y pybind11 -c conda-forge
10+
11+
# Search for nvcuvid library in various locations for debugging CI build issues
12+
echo "[NVCUVID-SEARCH] === Searching for nvcuvid library ==="
13+
14+
# Standard library search paths
15+
SEARCH_PATHS=(
16+
"/usr/lib"
17+
"/usr/lib64"
18+
"/usr/lib/x86_64-linux-gnu"
19+
"/usr/local/lib"
20+
"/usr/local/lib64"
21+
"/lib"
22+
"/lib64"
23+
"/opt/cuda/lib64"
24+
"/usr/local/cuda/lib64"
25+
"/usr/local/cuda/lib"
26+
"/usr/local/cuda-*/lib64"
27+
"/usr/local/cuda-*/lib"
28+
)
29+
30+
# Library name variations to search for
31+
LIB_PATTERNS=(
32+
"libnvcuvid.so*"
33+
"nvcuvid.so*"
34+
"libnvcuvid.a"
35+
"nvcuvid.a"
36+
"libnvcuvid*"
37+
"nvcuvid*"
38+
)
39+
40+
found_libraries=()
41+
42+
for search_path in "${SEARCH_PATHS[@]}"; do
43+
if [ -d "$search_path" ]; then
44+
echo "[NVCUVID-SEARCH] Searching in: $search_path"
45+
for pattern in "${LIB_PATTERNS[@]}"; do
46+
# Use find with error suppression to avoid permission errors
47+
found_files=$(find "$search_path" -maxdepth 3 -name "$pattern" 2>/dev/null || true)
48+
if [ -n "$found_files" ]; then
49+
echo "[NVCUVID-SEARCH] Found: $found_files"
50+
found_libraries+=($found_files)
51+
fi
52+
done
53+
else
54+
echo "[NVCUVID-SEARCH] Directory not found: $search_path"
55+
fi
56+
done
57+
58+
# Also try using ldconfig to find the library
59+
echo "[NVCUVID-SEARCH] Checking ldconfig cache for nvcuvid..."
60+
if command -v ldconfig >/dev/null 2>&1; then
61+
ldconfig_result=$(ldconfig -p 2>/dev/null | grep -i nvcuvid || echo "Not found in ldconfig cache")
62+
echo "[NVCUVID-SEARCH] ldconfig result: $ldconfig_result"
63+
fi
64+
65+
# Try pkg-config if available
66+
echo "[NVCUVID-SEARCH] Checking pkg-config for cuda libraries..."
67+
if command -v pkg-config >/dev/null 2>&1; then
68+
pkg_result=$(pkg-config --list-all 2>/dev/null | grep -i cuda || echo "No CUDA packages found in pkg-config")
69+
echo "[NVCUVID-SEARCH] pkg-config cuda packages: $pkg_result"
70+
fi
71+
72+
# Summary
73+
if [ ${#found_libraries[@]} -gt 0 ]; then
74+
echo "[NVCUVID-SEARCH] === SUMMARY: Found ${#found_libraries[@]} nvcuvid library files ==="
75+
for lib in "${found_libraries[@]}"; do
76+
echo "[NVCUVID-SEARCH] $lib"
77+
# Show file info if possible
78+
if [ -f "$lib" ]; then
79+
ls -la "$lib" 2>/dev/null || true
80+
fi
81+
done
82+
else
83+
echo "[NVCUVID-SEARCH] === SUMMARY: No nvcuvid libraries found ==="
84+
fi
85+
86+
echo "[NVCUVID-SEARCH] === End nvcuvid library search ==="

0 commit comments

Comments
 (0)