From 02854e6b95a4e5c70c3b708086942ee4c6e640ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= Date: Wed, 22 May 2024 13:54:19 -0700 Subject: [PATCH] Add paranoid checks and debug messages for Xe KMD MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Xe is the new KMD driver for Intel GPUs on Linux, replacing i915 on LNL and newer. So here just checking if '/proc/sys/dev/xe/perf_stream_paranoid' is also set to 0 and printing debug messages when it is set to 1. Signed-off-by: José Roberto de Souza --- .../driver/ihv/intel/intel_gl_counters.cpp | 31 ++++++++++++++----- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/renderdoc/driver/ihv/intel/intel_gl_counters.cpp b/renderdoc/driver/ihv/intel/intel_gl_counters.cpp index 0cf5a6182..efe7c13e6 100644 --- a/renderdoc/driver/ihv/intel/intel_gl_counters.cpp +++ b/renderdoc/driver/ihv/intel/intel_gl_counters.cpp @@ -66,8 +66,8 @@ CounterDescription IntelGlCounters::GetCounterDescription(GPUCounter index) cons desc.name = "Counters limited, see description"; desc.category = "More counters are available"; desc.description = - "Not all counters available, run 'sudo sysctl dev.i915.perf_stream_paranoid=0' to enable " - "more counters!"; + "Not all counters available, run 'sudo sysctl dev.i915.perf_stream_paranoid=0' or " + "'sudo sysctl dev.xe.perf_stream_paranoid=0' to enable more counters!"; desc.resultType = CompType::UInt; desc.resultByteWidth = 8; @@ -197,13 +197,17 @@ bool IntelGlCounters::Init() m_Paranoid = false; #if defined(RENDERDOC_PLATFORM_ANDROID) || defined(RENDERDOC_PLATFORM_LINUX) - rdcstr contents; - FileIO::ReadAll("/proc/sys/dev/i915/perf_stream_paranoid", contents); - contents.trim(); - if(!contents.empty()) + rdcstr i915_contents, xe_contents; + + FileIO::ReadAll("/proc/sys/dev/i915/perf_stream_paranoid", i915_contents); + i915_contents.trim(); + + FileIO::ReadAll("/proc/sys/dev/xe/perf_stream_paranoid", xe_contents); + xe_contents.trim(); + + if(!i915_contents.empty()) { - int paranoid = atoi(contents.c_str()); - if(paranoid) + if(atoi(i915_contents.c_str())) { RDCWARN( "Not all counters available, run " @@ -211,6 +215,17 @@ bool IntelGlCounters::Init() m_Paranoid = true; } } + + if(!xe_contents.empty()) + { + if(atoi(xe_contents.c_str())) + { + RDCWARN( + "Not all counters available, run " + "'sudo sysctl dev.xe.perf_stream_paranoid=0' to enable more counters!"); + m_Paranoid = true; + } + } #endif do