Merge ~gabrielzchen/plainbox-provider-resource:on-demand-support into plainbox-provider-resource:master

Proposed by Gabriel Zhi Chen
Status: Rejected
Rejected by: Gabriel Zhi Chen
Proposed branch: ~gabrielzchen/plainbox-provider-resource:on-demand-support
Merge into: plainbox-provider-resource:master
Diff against target: 12 lines (+1/-1)
1 file modified
bin/graphics_card_resource.py (+1/-1)
Reviewer Review Type Date Requested Status
Pierre Equoy Pending
StanleyHuang Pending
Gabriel Zhi Chen Pending
Kent Lin Pending
Review via email: mp+420164@code.launchpad.net

Commit message

change the file graphics_card_resource.py to fix the switching between 'Performance' mode and 'On-demand' mode.

Description of the change

Please refer to the bug for the reason of this commit https://bugs.launchpad.net/sutton/+bug/1967979

The commit can only meet our current testing needs, but it is not the final modification of the checkbox. By looking at the code, I found the checkbox will get the graphic id by:
$ ./graphics_card_resource.py -c ./udev_resource.py

bus: pci
category: VIDEO
driver: i915
gpu_count: 2
index: 1
path: /devices/pci0000:00/0000:00:02.0
prime_gpu_offload: Off
product: PCI ID 0x46a6
product_id: 18086
product_slug: PCI_ID_0x46a6
subproduct_id: 8952
subvendor_id: 6058
switch_to_cmd: prime-select on-demand
vendor: Intel Corporation
vendor_id: 32902
vendor_slug: Intel_Corporation

bus: pci
category: VIDEO
driver: nvidia
gpu_count: 2
index: 2
path: /devices/pci0000:00/0000:00:01.0/0000:01:00.0
prime_gpu_offload: Off
product: PCI ID 0x25a0
product_id: 9632
product_slug: PCI_ID_0x25a0
subproduct_id: 8952
subvendor_id: 6058
switch_to_cmd: prime-select nvidia
vendor: NVIDIA Corporation
vendor_id: 4318
vendor_slug: NVIDIA_Corporation

Checkbox will base on the index value to judge which graphic card will be tested.

In the future, we probably drop the 'power saving' mode when the config is 'I+N'. So I take the test to modify the file graphics_card_resource.py. It works, but I think that is ugly :(

Though the test order becomes :
'On-demand mode' before suspend -> Performance mode before suspend -> Performance mode after suspend -> 'On-demand' after suspend;
Actually, QA still see 'Intel PCI ID' and 'NVIDIA PCI ID'. Even at this point the part of the 'Intel PCI ID' has been replaced with 'on-demand' related tests

I want to stress again that this modification is only temporary. It cannot satisfy the global requirement of checkbox. This requires Cert, SWE and QA to negotiate and improve. Thanks

To post a comment you must log in.
Revision history for this message
Pierre Equoy (pieq) wrote :

First of all, thanks a lot for submitting this proposal and taking the time to explain the issue!

I agree with you, we need to discuss between the different teams to decide exactly what we should be testing once and for all.

Regarding your proposal, I know that `prime-select query` returns the current mode. Until now, we just assume the image is pre-installed with `prime-select` set at `intel`, but as you mention, on laptops, it's not the case anymore. You could update the script so that it checks for the current mode (using `prime-select query`), save this information (e.g. `initial_mode`), switch to `nvidia`, then switch back to `initial_mode`.

What do you think?

Revision history for this message
StanleyHuang (stanley31) wrote :

Agreed with Pierre. Considering that the default rendering profile might be different on each platform, I thought we have to capture the default rendering profile in the beginning, and restore the settings back to default.
We also need to think about which modes need to be tested on a system with different default rendering profile.

e.g.
1. the default rendering profile is "nvidia"
2. the default rendering profile is "on-demand"
3. the default rendering profile is "intel"

Unmerged commits

609b0b0... by Gabriel Zhi Chen

switch intel to on-demand mode

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/bin/graphics_card_resource.py b/bin/graphics_card_resource.py
2index 6a48ccd..4a970a0 100755
3--- a/bin/graphics_card_resource.py
4+++ b/bin/graphics_card_resource.py
5@@ -127,7 +127,7 @@ def main():
6 # commands needed to switch to and from particular GPU,
7 # keyed by the driver name. Defaults to 'false'/'false' commands.
8 switch_cmds = collections.defaultdict(lambda: ('false', 'false'))
9- switch_cmds['nvidia'] = ('prime-select nvidia', 'prime-select intel')
10+ switch_cmds['nvidia'] = ('prime-select nvidia', 'prime-select on-demand')
11 # nvidia uses 'pcieport' driver when the dGPU is disabled
12 switch_cmds['pcieport'] = ('prime-select nvidia', 'prime-select intel')
13

Subscribers

People subscribed via source and target branches