Skip to content

Instantly share code, notes, and snippets.

@rhee-elten
Created January 9, 2023 01:39
Show Gist options
  • Save rhee-elten/5ee6f1a2b90791412545a43616c47e44 to your computer and use it in GitHub Desktop.
Save rhee-elten/5ee6f1a2b90791412545a43616c47e44 to your computer and use it in GitHub Desktop.
#!/bin/sh
_image=nvidia/cuda:10.0-devel-centos7 # 1.15, 1.13
#_image=nvidia/cuda:10.1-devel-centos7 # 2.4.1
#_image=nvidia/cuda:11.3.1-devel-centos7 # 2.5
_pwd="$(pwd)"
echo "=====================================" >> /tmp/ptxas_wrapper.log
echo "=== ptxas wrapper: $(date)" >> /tmp/ptxas_wrapper.log
echo "=== args:" "$@" >> /tmp/ptxas_wrapper.log
echo "=== pref:" "$CONDA_PREFIX" >> /tmp/ptxas_wrapper.log
echo "=== ppid:" "$PPID" >> /tmp/ptxas_wrapper.log
echo "=== proc:" "$(/bin/ps -p $PPID -h -o args)" >> /tmp/ptxas_wrapper.log
if test -f "$1"
then
echo "=== BEGIN file input:"
head -n 140 "$1" >> /tmp/ptxas_wrapper.log
echo "=== END"
fi
/usr/bin/docker run --rm \
-u "$(id -u):$(id -g)" \
-v /etc/localtime:/etc/localtime:ro \
-v /tmp:/tmp \
-v "$_pwd:$_pwd" \
-w "$_pwd" \
"$_image" \
ptxas "$@"
RET=$!
if test "$2" = "-o" -a -f "$3"
then
echo "=== BEGIN file output:"
\ls -l "$3" >> /tmp/ptxas_wrapper.log
file "$3" >> /tmp/ptxas_wrapper.log
echo "=== END"
fi
exit $RET
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment