Hello,
We have an SoC which contains the MALI G78AE GPU. In the SoC, we have a linux image with the needed drivers for MALI and we are gathering metrics from the Performance Monitor Counters available through Streamline application.
The GPU has 4 slices, each slice with 2 shader cores. According to the document "Arm® Immortalis and Mali GPU Virtualization Guide", it is possible to change the partitioning of the GPU dynamically (or on the fly, without needing to rebuild the Linux image) through the utilization of sysfs interface. This means basically that the current configuration can be read using a "cat /sys/path/to/gpu/" or it can be written using a "echo 0x1 > /sys/path/to/gpu/", for instance.
We are interested in controlling the partitioning so that we can be sure we are exercising a single slice of the GPU and check its performance metrics. The document provides a few examples of possible modifications, but the logic to control the partitioning is not further explained. One of the examples is pasted below:
The following example shows the use of the sysfs interface to allocate slices 0, 1, 2, and 3 tothe first partition. In the example, all literal values are hex bitmasks, where each bit representsa slice or access window.
echo "0xF" > /sys/bus/platform/devices/6e0a0000.gpu_resource_group/arbiter/partitions/partition0/active_slices
This example is basic as probably the F means 1111 in binary, which asserts every slice to the first partition defined with the path ".../partitions/partition0/active_slices".
But, for instance, how could I change the partitioning of the system after if I want multiple partitions?
The system currently has only the partition0 directory, should I do a "mkdir partition1" in partitions directory and then create a new "active_slices" file? Will that work? I am not very familiarized with the sysfs interface to have a proper understanding on the topic.
Can anyone point me towards the documentation which explains this definition?
Any reply will be appreciated,
thanks, Luca.
Hi Richard,
Thanks for your reply and clear explanations on the matter.
Is it possible to dynamically change the AXI interfaces for different resource groups or is this interface assigned only during compilation time of the kernel?
I also read on the ARM virtualization document (page 45 of 364, version 3.2 - Documentation – Arm Developer) that it is possible to assign (re-assign?) module parameters:
I am interested in assigning more access windows to each resource group dynamically, so I tried to add it:
$ echo ",B:S0:P0:W0:W2,A:S1:S2:S3:P1:W1:W3" > /sys/module/mali_gpu_assign/parameters/ptm_config
$ modprobe mali_gpu_power
But, when I tried to see if the windows had been assigned, I didn't see any modification.
$ cat /sys/bus/platform/devices/104b0000.gpu_resource_group/arbiter/partitions/partition0/assigned_access_windows0x1
Can you tell me if it is possible and how this is supposed to be done if possible?
Kind regards, Luca.
edit: added question about dynamically assigning access windows.