Skip to content
This repository was archived by the owner on Sep 25, 2023. It is now read-only.

Commit 877e442

Browse files
committed
add print_env.sh (copy from cuDF and replace cuDF with cuSignal)
1 parent 2e2c3b4 commit 877e442

File tree

1 file changed

+87
-0
lines changed

1 file changed

+87
-0
lines changed

print_env.sh

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
#!/usr/bin/env bash
2+
# Reports relevant environment information useful for diagnosing and
3+
# debugging cuSignal issues.
4+
# Usage:
5+
# "./print_env.sh" - prints to stdout
6+
# "./print_env.sh > env.txt" - prints to file "env.txt"
7+
8+
print_env() {
9+
echo "**git***"
10+
if [ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" == "true" ]; then
11+
git log --decorate -n 1
12+
echo "**git submodules***"
13+
git submodule status --recursive
14+
else
15+
echo "Not inside a git repository"
16+
fi
17+
echo
18+
19+
echo "***OS Information***"
20+
cat /etc/*-release
21+
uname -a
22+
echo
23+
24+
echo "***GPU Information***"
25+
nvidia-smi
26+
echo
27+
28+
echo "***CPU***"
29+
lscpu
30+
echo
31+
32+
echo "***CMake***"
33+
which cmake && cmake --version
34+
echo
35+
36+
echo "***g++***"
37+
which g++ && g++ --version
38+
echo
39+
40+
echo "***nvcc***"
41+
which nvcc && nvcc --version
42+
echo
43+
44+
echo "***Python***"
45+
which python && python -c "import sys; print('Python {0}.{1}.{2}'.format(sys.version_info[0], sys.version_info[1], sys.version_info[2]))"
46+
echo
47+
48+
echo "***Environment Variables***"
49+
50+
printf '%-32s: %s\n' PATH $PATH
51+
52+
printf '%-32s: %s\n' LD_LIBRARY_PATH $LD_LIBRARY_PATH
53+
54+
printf '%-32s: %s\n' NUMBAPRO_NVVM $NUMBAPRO_NVVM
55+
56+
printf '%-32s: %s\n' NUMBAPRO_LIBDEVICE $NUMBAPRO_LIBDEVICE
57+
58+
printf '%-32s: %s\n' CONDA_PREFIX $CONDA_PREFIX
59+
60+
printf '%-32s: %s\n' PYTHON_PATH $PYTHON_PATH
61+
62+
echo
63+
64+
65+
# Print conda packages if conda exists
66+
if type "conda" &> /dev/null; then
67+
echo '***conda packages***'
68+
which conda && conda list
69+
echo
70+
# Print pip packages if pip exists
71+
elif type "pip" &> /dev/null; then
72+
echo "conda not found"
73+
echo "***pip packages***"
74+
which pip && pip list
75+
echo
76+
else
77+
echo "conda not found"
78+
echo "pip not found"
79+
fi
80+
}
81+
82+
echo "<details><summary>Click here to see environment details</summary><pre>"
83+
echo " "
84+
print_env | while read -r line; do
85+
echo " $line"
86+
done
87+
echo "</pre></details>"

0 commit comments

Comments
 (0)