mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 23:03:02 +08:00
feature: Support for ccs mode configuration via SysFs
Add support for configuring ccs mode for all applicable devices before KMD is loaded. Use ZEX_NUMBER_OF_CCS to configure ccs mode. Format is as follows: ZEX_NUMBER_OF_CCS=NumberOfCcs i,e Setting ZEX_NUMBER_OF_CCS to 4 sets ccs mode to 4 for all devices for which configuration is supported. Related-To: NEO-10378 Signed-off-by: Bellekallu Rajkiran <bellekallu.rajkiran@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
f496233462
commit
9736313d10
@@ -30,16 +30,34 @@ Depending on their execution patterns, applications may benefit more from using
|
||||
- A four-process job per tile with uniform work may benefit more from using 4 CCSs, with a quarter of EUs assigned to each.
|
||||
- A four-process job per tile with non uniform work may benefit from using 1 CCS with access to all EUs.
|
||||
|
||||
To help applications select the best mode that fits their needs, Level Zero driver is introducing a new driver experimental environment variable, named `ZEX_NUMBER_OF_CCS`. This environment variable is read at `zeInit()` time, after reading `ZE_AFFINITY_MASK`, and allows users to select one of the following modes:
|
||||
To help applications select the best mode that fits their needs, Level Zero driver is introducing a new driver experimental environment variable, named `ZEX_NUMBER_OF_CCS`. This environment variable behaves differently for PVC.
|
||||
|
||||
For PVC, This environment variable is read at `zeInit()` time, after reading `ZE_AFFINITY_MASK`, and allows users to select one of the supported modes.
|
||||
|
||||
For non-PVC, This environment variable is read before loading KMD at `zeinit()` time, and allows users to select one of the supported modes.
|
||||
|
||||
Following are supported modes:
|
||||
|
||||
- 1 CCS Mode (DEFAULT): Each tile exposes 1 CCS, which has access to all EUS. Other CCSs are disabled.
|
||||
- 2 CCS Mode: Each tile exposes 2 CCSs, each with half of the EUs assigned to it. If no work is submitted to one of the CCSs, then its EUs remain idle, even if the other CCS has active work.
|
||||
- 4 CCS Mode: Each tile exposes 4 CCSs, each having a quarter of the EUs assigned to it. As with 2 CCS mode, EUs of idle CCSs cannot be used by other CCSs.
|
||||
|
||||
The format for `ZEX_NUMBER_OF_CCS` is a comma-separated list of device-mode pairs, i.e., `ZEX_NUMBER_OF_CCS=<Root Device Index>:<CCS Mode>,<Root Device Index>:<CCS Mode>...`. For instance, in dual-PVC system, an application could have the following to set root device index 0 in 4 CCS mode, and root device index 1 in 1 CCS mode.
|
||||
The format for `ZEX_NUMBER_OF_CCS` for PVC is a comma-separated list of device-mode pairs, i.e., `ZEX_NUMBER_OF_CCS=<Root Device Index>:<CCS Mode>,<Root Device Index>:<CCS Mode>...`. For instance, in dual-PVC system, an application could have the following to set root device index 0 in 4 CCS mode, and root device index 1 in 1 CCS mode.
|
||||
|
||||
`ZEX_NUMBER_OF_CCS=0:4,1:1`
|
||||
|
||||
The format for `ZEX_NUMBER_OF_CCS` for devices other than PVC is a single integer representing CCS mode, i.e `ZEX_NUMBER_OF_CCS=<CCS Mode>`.
|
||||
CCS mode will be configured for all the supported devices. For instance, in multi card system, an application could have the following to set CCS mode to 2 for all cards.
|
||||
|
||||
`ZEX_NUMBER_OF_CCS=2`
|
||||
|
||||
For non-PVC, Level zero driver uses sysfs interface to configure CCS mode, i.e `/sys/class/drm/cardX/gt/gtY/ccs_mode`. System administrator must properly configure access to the mentioned sysfs file for configuring CCS mode. Recommendation is that access permissions are to be provided for video users group. Commands to do the same are described below.
|
||||
|
||||
`chown :video /sys/class/drm/cardX/gt/gtY/ccs_mode`
|
||||
`chmod g+rw /sys/class/drm/cardX/gt/gtY/ccs_mode`
|
||||
|
||||
where X refers to GPU ID and Y refers to tile ID.
|
||||
|
||||
# Functional and Performance Considerations
|
||||
|
||||
- *What happens when multiple applications run concurrently with different modes?*
|
||||
@@ -59,6 +77,8 @@ When implicit is enabled, only part of each tile is used for the split workgroup
|
||||
|
||||
# Interaction with Affinity Mask
|
||||
|
||||
Folowing is applicable only for PVC.
|
||||
|
||||
`ZE_AFFINITY_MASK` is read by the Level Zero driver prior to `ZEX_NUMBER_OF_CCS`. Therefore, mask can hide some root devices and change its indexes and `ZEX_NUMBER_OF_CCS` would apply for root device indexes after masking. For instance, in a 4-PVC system, we could have:
|
||||
|
||||
- Process 0 - `ZE_AFFINITY_MASK=0.0` `ZEX_NUMBER_OF_CCS=0:1`
|
||||
@@ -72,5 +92,4 @@ Alternatively, a process may select different modes for each tile. For instance,
|
||||
|
||||
# Availability
|
||||
|
||||
- `ZEX_NUMBER_OF_CCS` is only supported and meant to be used on PVC and DG2.
|
||||
- `ZEX_NUMBER_OF_CCS` can be used also by applications using Intel OpenCL GPU driver.
|
||||
Reference in New Issue
Block a user