Dynamic NVIDIA lib path discovery in entrypoint for bitsandbytes
Browse files- entrypoint.sh +12 -4
entrypoint.sh
CHANGED
|
@@ -1,12 +1,20 @@
|
|
| 1 |
#!/bin/bash
|
| 2 |
# OpenGrid entrypoint — switches between UI server and GRPO training
|
| 3 |
-
# based on the OPENGRID_MODE environment variable.
|
| 4 |
-
#
|
| 5 |
-
# OPENGRID_MODE=training → runs GRPO training pipeline
|
| 6 |
-
# OPENGRID_MODE=server → runs the FastAPI UI server (default)
|
| 7 |
|
| 8 |
set -e
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
MODE="${OPENGRID_MODE:-server}"
|
| 11 |
|
| 12 |
if [ "$MODE" = "training" ]; then
|
|
|
|
| 1 |
#!/bin/bash
|
| 2 |
# OpenGrid entrypoint — switches between UI server and GRPO training
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
set -e
|
| 5 |
|
| 6 |
+
# Dynamically find all pip-installed NVIDIA library paths
|
| 7 |
+
NVIDIA_LIBS=$(python -c "
|
| 8 |
+
import glob, os
|
| 9 |
+
paths = glob.glob('/home/user/.local/lib/python3.10/site-packages/nvidia/*/lib')
|
| 10 |
+
print(':'.join(paths))
|
| 11 |
+
" 2>/dev/null || echo "")
|
| 12 |
+
|
| 13 |
+
if [ -n "$NVIDIA_LIBS" ]; then
|
| 14 |
+
export LD_LIBRARY_PATH="${NVIDIA_LIBS}:${LD_LIBRARY_PATH}"
|
| 15 |
+
echo "Set LD_LIBRARY_PATH with NVIDIA libs: $NVIDIA_LIBS"
|
| 16 |
+
fi
|
| 17 |
+
|
| 18 |
MODE="${OPENGRID_MODE:-server}"
|
| 19 |
|
| 20 |
if [ "$MODE" = "training" ]; then
|