Skip to content

Commit

Permalink
fix the bug in the cuda compat settings (deepjavalibrary#1278)
Browse files Browse the repository at this point in the history
  • Loading branch information
Qing Lan authored Nov 7, 2023
1 parent fcd10eb commit 68056dd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions serving/docker/dockerd-entrypoint-with-cuda-compat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ verlte() {

# Follow https://docs.aws.amazon.com/sagemaker/latest/dg/inference-gpu-drivers.html
if [ -f /usr/local/cuda/compat/libcuda.so.1 ]; then
cat /usr/local/cuda/version.txt
CUDA_COMPAT_MAX_DRIVER_VERSION=$(readlink /usr/local/cuda/compat/libcuda.so.1 |cut -d'.' -f 3-)
echo "CUDA compat package requires Nvidia driver ⩽${CUDA_COMPAT_MAX_DRIVER_VERSION}"
NVIDIA_DRIVER_VERSION=$(sed -n 's/^NVRM.*Kernel Module *\([0-9.]*\).*$/\1/p' /proc/driver/nvidia/version 2>/dev/null || true)
echo "Current installed Nvidia driver version is ${NVIDIA_DRIVER_VERSION}"
if [ $(verlte $CUDA_COMPAT_MAX_DRIVER_VERSION $NVIDIA_DRIVER_VERSION) ]; then
if [ $(verlte $NVIDIA_DRIVER_VERSION $CUDA_COMPAT_MAX_DRIVER_VERSION) ]; then
echo "Setup CUDA compatibility libs path to LD_LIBRARY_PATH"
export LD_LIBRARY_PATH=/usr/local/cuda/compat:$LD_LIBRARY_PATH
echo $LD_LIBRARY_PATH
Expand Down

0 comments on commit 68056dd

Please sign in to comment.