Skip to content

Commit 9790c29

Browse files
committed
Use new residency model by default
Related-To: NEO-5007 Change-Id: Id39ac53e00e126237200d80e493706e2eed53b30 Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
1 parent 912af26 commit 9790c29

File tree

6 files changed

+35
-0
lines changed

6 files changed

+35
-0
lines changed

opencl/source/dll/linux/drm_neo_create.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,11 @@ Drm *Drm::create(std::unique_ptr<HwDeviceId> hwDeviceId, RootDeviceEnvironment &
110110
}
111111
return drmObject.release();
112112
}
113+
114+
void Drm::overrideBindSupport(bool &useVmBind) {
115+
if (DebugManager.flags.UseVmBind.get() != -1) {
116+
useVmBind = DebugManager.flags.UseVmBind.get();
117+
}
118+
}
119+
113120
} // namespace NEO

opencl/test/unit_test/linux/main_linux_dll.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,23 @@ TEST(DrmTest, GivenSelectedIncorectDeviceWhenGetDeviceFdThenFail) {
215215
EXPECT_TRUE(hwDeviceIds.empty());
216216
}
217217

218+
TEST(DrmTest, givenUseVmBindFlagWhenOverrideBindSupportThenReturnProperValue) {
219+
DebugManagerStateRestore dbgRestorer;
220+
bool useVmBind = false;
221+
222+
DebugManager.flags.UseVmBind.set(1);
223+
Drm::overrideBindSupport(useVmBind);
224+
EXPECT_TRUE(useVmBind);
225+
226+
DebugManager.flags.UseVmBind.set(0);
227+
Drm::overrideBindSupport(useVmBind);
228+
EXPECT_FALSE(useVmBind);
229+
230+
DebugManager.flags.UseVmBind.set(-1);
231+
Drm::overrideBindSupport(useVmBind);
232+
EXPECT_FALSE(useVmBind);
233+
}
234+
218235
TEST_F(DrmTests, createReturnsDrm) {
219236
auto drm = DrmWrap::createDrm(*rootDeviceEnvironment);
220237
EXPECT_NE(drm, nullptr);

opencl/test/unit_test/os_interface/linux/drm_neo_create.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,12 @@ Drm *Drm::create(std::unique_ptr<HwDeviceId> hwDeviceId, RootDeviceEnvironment &
4040
}
4141
return drm;
4242
}
43+
44+
void Drm::overrideBindSupport(bool &useVmBind) {
45+
useVmBind = false;
46+
if (DebugManager.flags.UseVmBind.get() == 1) {
47+
useVmBind = true;
48+
}
49+
}
50+
4351
} // namespace NEO

opencl/test/unit_test/test_files/igdrcl.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ DirectSubmissionDiagnosticExecutionCount = 30
8686
DirectSubmissionDisableCacheFlush = 0
8787
DirectSubmissionDisableMonitorFence = 0
8888
USMEvictAfterMigration = 1
89+
UseVmBind = -1
8990
EnableNullHardware = 0
9091
ForceLinearImages = 0
9192
ForceSLML3Config = 0

shared/source/debug_settings/debug_variables_base.inl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ DECLARE_DEBUG_VARIABLE(int32_t, ForceUserptrAlignment, -1, "-1: no force (4kb),
203203
DECLARE_DEBUG_VARIABLE(int64_t, ForceSystemMemoryPlacement, 0, "0: default, >0: (bitmask) for given Graphics Allocation Type, force system memory placement")
204204
DECLARE_DEBUG_VARIABLE(int64_t, ForceNonSystemMemoryPlacement, 0, "0: default, >0: (bitmask) for given Graphics Allocation Type, force non-system memory placement")
205205
DECLARE_DEBUG_VARIABLE(int64_t, DisableIndirectAccess, -1, "0: default, 0: Indirect access for L0 kernels is enabled, 1: Indirect is disabled")
206+
DECLARE_DEBUG_VARIABLE(int32_t, UseVmBind, -1, "Use new residency model on Linux (requires kernel support), -1: default, 0: disabled, 1: enabled")
206207
DECLARE_DEBUG_VARIABLE(bool, UseMaxSimdSizeToDeduceMaxWorkgroupSize, false, "With this flag on, max workgroup size is deduced using SIMD32 instead of SIMD8, this causes the max wkg size to be 4 times bigger")
207208
DECLARE_DEBUG_VARIABLE(bool, ReturnRawGpuTimestamps, false, "Driver returns raw GPU tiemstamps instead of calculated ones.")
208209
DECLARE_DEBUG_VARIABLE(bool, ForcePerDssBackedBufferProgramming, false, "Always program per-DSS memory backed buffer in preamble")

shared/source/os_interface/linux/drm_neo.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ class Drm {
141141
static bool isi915Version(int fd);
142142

143143
static Drm *create(std::unique_ptr<HwDeviceId> hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment);
144+
static void overrideBindSupport(bool &useVmBind);
144145

145146
protected:
146147
int getQueueSliceCount(drm_i915_gem_context_param_sseu *sseu);

0 commit comments

Comments
 (0)