-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into sbosisio/ssh-action
- Loading branch information
Showing
11 changed files
with
103 additions
and
326 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/bash | ||
|
||
set -ex | ||
|
||
CUDNN_MAJOR_VERSION=9 | ||
|
||
# Create a prefix with include/ and lib/ directories containing symlinks to the cuDNN | ||
# version that was just installed; this is useful to pass to XLA to avoid it fetching | ||
# its own copy of cuDNN. | ||
prefix=/opt/nvidia/cudnn | ||
if [[ -d "${prefix}" ]]; then | ||
echo "Skipping link farm creation" | ||
exit 1 | ||
fi | ||
|
||
arch=$(uname -m)-linux-gnu | ||
libcudnn_pkgs=$(dpkg -l 'libcudnn*' | awk '/^ii/ {print $2}') | ||
if [[ -z "${libcudnn_pkgs}" ]]; then | ||
echo "No libcudnn packages installed." | ||
exit 1 | ||
fi | ||
|
||
for cudnn_file in $(dpkg -L ${libcudnn_pkgs} | sort -u); do | ||
# Real files and symlinks are linked into $prefix | ||
if [[ -f "${cudnn_file}" || -h "${cudnn_file}" ]]; then | ||
# Replace /usr with $prefix | ||
nosysprefix="${cudnn_file#"/usr/"}" | ||
# include/x86_64-linux-gpu -> include/ | ||
noarchinclude="${nosysprefix/#"include/${arch}"/include}" | ||
# cudnn_v9.h -> cudnn.h | ||
noverheader="${noarchinclude/%"_v${CUDNN_MAJOR_VERSION}.h"/.h}" | ||
# lib/x86_64-linux-gnu -> lib/ | ||
noarchlib="${noverheader/#"lib/${arch}"/lib}" | ||
link_name="${prefix}/${noarchlib}" | ||
link_dir=$(dirname "${link_name}") | ||
mkdir -p "${link_dir}" | ||
ln -s "${cudnn_file}" "${link_name}" | ||
else | ||
echo "Skipping ${cudnn_file}" | ||
fi | ||
done |
Oops, something went wrong.