mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-07-02 20:26:16 +00:00
This removes cut and pasted code and uses a more central source. Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
43 lines
835 B
Bash
Executable File
43 lines
835 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# Testcase: Simulate gpu hang
|
|
#
|
|
# This check uses the stop_rings facility to exercise the gpu hang code.
|
|
# by reading /sys/kernel/debug/dri/0/i915_emon_status too quickly
|
|
#
|
|
|
|
. ./drm_lib.sh
|
|
|
|
cd $i915_path
|
|
|
|
if [ ! -f i915_ring_stop ] ; then
|
|
echo "kernel doesn't support ring stopping"
|
|
exit 77
|
|
fi
|
|
|
|
if cat i915_error_state | grep -v "no error state collected" > /dev/null ; then
|
|
echo "gpu hang dectected"
|
|
exit 1
|
|
fi
|
|
|
|
# stop rings
|
|
echo 0xf > i915_ring_stop
|
|
|
|
# need to run it twice, otherwise there are no waiters
|
|
$cur_path/gem_exec_nop > /dev/null 2>&1 &
|
|
$cur_path/gem_exec_nop > /dev/null 2>&1 &
|
|
|
|
sleep 10
|
|
|
|
if cat i915_error_state | grep -v "no error state collected" > /dev/null ; then
|
|
echo "gpu hang correctly dectected"
|
|
else
|
|
echo "gpu hang not dectected"
|
|
exit 2
|
|
fi
|
|
|
|
# clear error state
|
|
echo 0 > i915_ring_stop
|
|
|
|
exit 0
|