Skip to content

Instantly share code, notes, and snippets.

@adujardin
Last active October 19, 2016 07:20
Show Gist options
  • Save adujardin/c33400da2459cc0a1cd8 to your computer and use it in GitHub Desktop.
Save adujardin/c33400da2459cc0a1cd8 to your computer and use it in GitHub Desktop.
Check which CUDA version has been linked against a given dynamic library
#!/bin/bash
# check which cuda version has been linked
# handles path like "/usr/local/lib/foo*.so*"
for lib in "$@"; do
cuda_version=$(ldd "$lib" | grep -Po '(?<=libcudart.so.)\d.\d.' | head -1);
if [ -n "$cuda_version" ]; then
printf "CUDA $cuda_version : $lib\n"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment