mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-08-05 08:16:06 +08:00
test_onroad: assert the procs that use the GPU (#30359)
* test gpu * keep it localiized * has to be later * reduce diff --------- Co-authored-by: Comma Device <device@comma.ai>
This commit is contained in:
@@ -3,6 +3,8 @@ import bz2
|
||||
import math
|
||||
import json
|
||||
import os
|
||||
import pathlib
|
||||
import psutil
|
||||
import shutil
|
||||
import subprocess
|
||||
import time
|
||||
@@ -151,6 +153,8 @@ class TestOnroad(unittest.TestCase):
|
||||
cls.segments = cls.segments[:-1]
|
||||
|
||||
finally:
|
||||
cls.gpu_procs = {psutil.Process(int(f.name)).name() for f in pathlib.Path('/sys/devices/virtual/kgsl/kgsl/proc/').iterdir() if f.is_dir()}
|
||||
|
||||
if proc is not None:
|
||||
proc.terminate()
|
||||
if proc.wait(60) is None:
|
||||
@@ -296,6 +300,9 @@ class TestOnroad(unittest.TestCase):
|
||||
# expected to go up while the MSGQ buffers fill up
|
||||
self.assertLessEqual(max(mems) - min(mems), 3.0)
|
||||
|
||||
def test_gpu_usage(self):
|
||||
self.assertEqual(self.gpu_procs, {"weston", "_ui", "mapsd", "camerad", "selfdrive.modeld.modeld"})
|
||||
|
||||
def test_camera_processing_time(self):
|
||||
result = "\n"
|
||||
result += "------------------------------------------------\n"
|
||||
|
||||
Reference in New Issue
Block a user