Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small fix on how to get GPU memory for CUDA devices #2582

Open
wants to merge 1 commit into
base: xz9/test-rel-2
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions userbenchmark/release-test/monitor_proc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ get_gpu_max_memory_usage_cuda() {
local my_pid=$1
local max=$2
local curr
# Some processes might not use the GPU
if ! nvidia-smi dmon -s m -c 1 -o T -i 0 | grep "${my_pid}" >/dev/null 2>/dev/null; then
curr=$(nvidia-smi dmon -s m -c 1 -o T -i 0 | tail -n 1 | awk '{print $4}' | sort | tail -1 | grep -o "[0-9.]*")
# Some processes might not use the GPU, then memory usage should be 0
if [ "${curr}" -eq 0 ] ; then
echo "${max}"
return
fi
curr=$(nvidia-smi dmon -s m -c 1 -o T -i 0 | grep "${my_pid}" | awk '{print $4}' | sort | tail -1 | grep -o "[0-9.]*")
max "${curr}" "${max}"
}

Expand Down
Loading