mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-21 14:56:18 +00:00
scripts: Add a trivial script to show which programs are using the GPU
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
10e36edabe
commit
61ff1309ca
@ -1,5 +1,6 @@
|
||||
noinst_SCRIPTS = \
|
||||
throttle.py\
|
||||
who.sh \
|
||||
$(NULL)
|
||||
|
||||
EXTRA_DIST = $(noinst_SCRIPTS)
|
||||
|
13
scripts/who.sh
Executable file
13
scripts/who.sh
Executable file
@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# usage: sudo who.sh
|
||||
#
|
||||
# Requires root permissions to both query who has the device open,
|
||||
# and to read the mappings of likely root-owned processes
|
||||
#
|
||||
|
||||
for i in `lsof -t /dev/dri/card0`; do
|
||||
who=`readlink /proc/$i/exe`
|
||||
count=`grep /dev/dri/card0 /proc/$i/maps | wc -l | cut -f1 -d\ `
|
||||
echo "$who: $count"
|
||||
done
|
Loading…
x
Reference in New Issue
Block a user