Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing index & type errors in prime_offload_tester.py (Bugfix) #1588

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

tomli380576
Copy link
Contributor

@tomli380576 tomli380576 commented Nov 8, 2024

Description

This PR fixes the issue in the Resolved Issues section and replaced some type annotations with ones supported in python 3.5

Resolved issues

If prime_offload_tester.py was run with arguments like python3 prime_offload_tester.py -d i915 -p 0000:00:02.0 and the command to check is glxgears, the test always passes because it was checking if "glxgears"[0] is one of the clients of this GPU. Since "glxgears"[0] == 'g', it always matches the g in "tgid" in /sys/kernel/debug/dri/<card_pci_id>/clients.

command  tgid dev master a   uid      magic
systemd-logind  1124   1   y    y     0          0
      Xwayland  3014 128   n    n  1000          0
 gsd-xsettings  3403 128   n    n  1000          0
          code  4943 128   n    n  1000          0
          code  4943 128   n    n  1000          0
          code  4943 128   n    n  1000          0
xdg-desktop-por  3317 128   n    n  1000          0

Now it will check if the entire string "glxgears" appears in the file

Documentation

Tests

Unit tests
Ran the script on 202408-34290 with -d i915 -p 0000:00:02.0 (Intel + NVIDIA desktop, expected to fail) and it correctly reports that prime offload didn't work

Copy link

codecov bot commented Nov 8, 2024

Codecov Report

Attention: Patch coverage is 93.75000% with 1 line in your changes missing coverage. Please review.

Project coverage is 48.00%. Comparing base (76d8f30) to head (81fe325).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
providers/base/bin/prime_offload_tester.py 93.75% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1588   +/-   ##
=======================================
  Coverage   48.00%   48.00%           
=======================================
  Files         371      371           
  Lines       39833    39837    +4     
  Branches     6730     6730           
=======================================
+ Hits        19121    19125    +4     
  Misses      19994    19994           
  Partials      718      718           
Flag Coverage Δ
provider-base 24.73% <93.75%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tomli380576 tomli380576 marked this pull request as ready for review November 8, 2024 08:25
@tomli380576 tomli380576 changed the title Fixing type errors in prime_offload_tester.py (Bugfix) Fixing index & type errors in prime_offload_tester.py (Bugfix) Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant