History

drm/xe/uapi: Use hint for guc to set GT frequency

Allow user to provide a low latency hint. When set, KMD sends a hint to GuC which results in special handling for that process. SLPC will ramp the GT frequency aggressively every time it switches to this process. We need to enable the use of SLPC Compute strategy during init, but it will apply only to processes that set this bit during process creation. Improvement with this approach as below: Before, :~$ NEOReadDebugKeys=1 EnableDirectSubmission=0 clpeak --kernel-latency Platform: Intel(R) OpenCL Graphics Device: Intel(R) Graphics [0xe20b] Driver version : 24.52.0 (Linux x64) Compute units : 160 Clock frequency : 2850 MHz Kernel launch latency : 283.16 us After, :~$ NEOReadDebugKeys=1 EnableDirectSubmission=0 clpeak --kernel-latency Platform: Intel(R) OpenCL Graphics Device: Intel(R) Graphics [0xe20b] Driver version : 24.52.0 (Linux x64) Compute units : 160 Clock frequency : 2850 MHz Kernel launch latency : 63.38 us Compute PR: https://github.com/intel/compute-runtime/pull/794 Mesa PR: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33214 IGT PR: https://patchwork.freedesktop.org/patch/639989/ V10(Lucas): - Remove doc from drm-uapi.rst v9(Vinay): - remove extra line, align commit message v8(Vinay): - Add separate example for using low latency hint v7(Jose): - Update UMD PR - applicable to all gpus V6: - init flags, remove redundant flags check (MAuld) V5: - Move uapi doc to documentation and GuC ABI specific change (Rodrigo) - Modify logic to restrict exec queue flags (MAuld) V4: - To make it clear, dont use exec queue word (Vinay) - Correct typo in description of flag (Jose/Vinay) - rename set_strategy api and replace ctx with exec queue(Vinay) - Start with 0th bit to indentify user flags (Jose) V3: - Conver user flag to kernel internal flag and use (Oak) - Support query config for use to check kernel support (Jose) - Dont need to take runtime pm (Vinay) V2: - DRM_XE_EXEC_QUEUE_LOW_LATENCY_HINT 1 planned for other hint(Szymon) - Add motivation to description (Lucas)

Tejas Upadhyay committed 1 year ago

Commit 5488bec1 parent 067a9747 files · +58 −4Browse files

Showing the changes to include/uapi (1 of 7 files). Show all

Unified · Split

include/uapi/drm/xe_drm.h+20−1
@@ -393,6 +393,8 @@ struct drm_xe_query_mem_regions { · 392 unmodified lines
393 *393 *
394 * - %DRM_XE_QUERY_CONFIG_FLAG_HAS_VRAM - Flag is set if the device394 * - %DRM_XE_QUERY_CONFIG_FLAG_HAS_VRAM - Flag is set if the device
395 * has usable VRAM395 * has usable VRAM
396 * - %DRM_XE_QUERY_CONFIG_FLAG_HAS_LOW_LATENCY - Flag is set if the device
397 * has low latency hint support
396 * - %DRM_XE_QUERY_CONFIG_MIN_ALIGNMENT - Minimal memory alignment398 * - %DRM_XE_QUERY_CONFIG_MIN_ALIGNMENT - Minimal memory alignment
397 * required by this device, typically SZ_4K or SZ_64K399 * required by this device, typically SZ_4K or SZ_64K
398 * - %DRM_XE_QUERY_CONFIG_VA_BITS - Maximum bits of a virtual address400 * - %DRM_XE_QUERY_CONFIG_VA_BITS - Maximum bits of a virtual address
@@ -409,6 +411,7 @@ struct drm_xe_query_config { · 10 unmodified lines
409#define DRM_XE_QUERY_CONFIG_REV_AND_DEVICE_ID 0411#define DRM_XE_QUERY_CONFIG_REV_AND_DEVICE_ID 0
410#define DRM_XE_QUERY_CONFIG_FLAGS 1412#define DRM_XE_QUERY_CONFIG_FLAGS 1
411 #define DRM_XE_QUERY_CONFIG_FLAG_HAS_VRAM (1 << 0)413 #define DRM_XE_QUERY_CONFIG_FLAG_HAS_VRAM (1 << 0)
414 #define DRM_XE_QUERY_CONFIG_FLAG_HAS_LOW_LATENCY (1 << 1)
412#define DRM_XE_QUERY_CONFIG_MIN_ALIGNMENT 2415#define DRM_XE_QUERY_CONFIG_MIN_ALIGNMENT 2
413#define DRM_XE_QUERY_CONFIG_VA_BITS 3416#define DRM_XE_QUERY_CONFIG_VA_BITS 3
414#define DRM_XE_QUERY_CONFIG_MAX_EXEC_QUEUE_PRIORITY 4417#define DRM_XE_QUERY_CONFIG_MAX_EXEC_QUEUE_PRIORITY 4
@@ -1205,6 +1208,21 @@ struct drm_xe_vm_bind { · 790 unmodified lines
1205 * };1208 * };
1206 * ioctl(fd, DRM_IOCTL_XE_EXEC_QUEUE_CREATE, &exec_queue_create);1209 * ioctl(fd, DRM_IOCTL_XE_EXEC_QUEUE_CREATE, &exec_queue_create);
1207 *1210 *
1211 * Allow users to provide a hint to kernel for cases demanding low latency
1212 * profile. Please note it will have impact on power consumption. User can
1213 * indicate low latency hint with flag while creating exec queue as
1214 * mentioned below,
1215 *
1216 * struct drm_xe_exec_queue_create exec_queue_create = {
1217 * .flags = DRM_XE_EXEC_QUEUE_LOW_LATENCY_HINT,
1218 * .extensions = 0,
1219 * .vm_id = vm,
1220 * .num_bb_per_exec = 1,
1221 * .num_eng_per_bb = 1,
1222 * .instances = to_user_pointer(&instance),
1223 * };
1224 * ioctl(fd, DRM_IOCTL_XE_EXEC_QUEUE_CREATE, &exec_queue_create);
1225 *
1208 */1226 */
1209struct drm_xe_exec_queue_create {1227struct drm_xe_exec_queue_create {
1210#define DRM_XE_EXEC_QUEUE_EXTENSION_SET_PROPERTY 01228#define DRM_XE_EXEC_QUEUE_EXTENSION_SET_PROPERTY 0
@@ -1223,7 +1241,8 @@ struct drm_xe_exec_queue_create { · 12 unmodified lines
1223 /** @vm_id: VM to use for this exec queue */1241 /** @vm_id: VM to use for this exec queue */
1224 __u32 vm_id;1242 __u32 vm_id;
1225 1243
1226 /** @flags: MBZ */1244#define DRM_XE_EXEC_QUEUE_LOW_LATENCY_HINT (1 << 0)
1245 /** @flags: flags to use for this exec queue */
1227 __u32 flags;1246 __u32 flags;
1228 1247
1229 /** @exec_queue_id: Returned exec queue ID */1248 /** @exec_queue_id: Returned exec queue ID */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t