Merge ~sylvain-pineau/plainbox-provider-resource:fix_graphics_card_resource_missing_vendor_id into plainbox-provider-resource:master

Proposed by Sylvain Pineau
Status: Merged
Approved by: Sylvain Pineau
Approved revision: 98ddcb1b59c78903b64b8412c9c6265f52c889fd
Merged at revision: f365223d513225539cd785dbce192a0752501d5b
Proposed branch: ~sylvain-pineau/plainbox-provider-resource:fix_graphics_card_resource_missing_vendor_id
Merge into: plainbox-provider-resource:master
Diff against target: 13 lines (+1/-1)
1 file modified
bin/graphics_card_resource.py (+1/-1)
Reviewer Review Type Date Requested Status
Sylvain Pineau (community) Approve
Review via email: mp+391598@code.launchpad.net

Commit message

bin:graphics_card_resource: Properly handle devices w/o vendor_id

Description of the change

bin:graphics_card_resource: Properly handle devices w/o vendor_id

Video devices found using /dev/dri/card* only have a product field.

To post a comment you must log in.
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

self-approved

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/bin/graphics_card_resource.py b/bin/graphics_card_resource.py
index edd3b3b..6a48ccd 100755
--- a/bin/graphics_card_resource.py
+++ b/bin/graphics_card_resource.py
@@ -140,7 +140,7 @@ def main():
140 for index, record in enumerate(video_devices, 1):140 for index, record in enumerate(video_devices, 1):
141 record['index'] = index141 record['index'] = index
142 record['gpu_count'] = len(video_devices)142 record['gpu_count'] = len(video_devices)
143 if record['vendor_id'] == '4098': # vendor == amd/ati143 if record.get('vendor_id', '') == '4098': # vendor == amd/ati
144 if subprocess.call(144 if subprocess.call(
145 ['dpkg-query', '-W', 'vulkan-amdgpu-pro'],145 ['dpkg-query', '-W', 'vulkan-amdgpu-pro'],
146 stderr=subprocess.STDOUT,146 stderr=subprocess.STDOUT,

Subscribers

People subscribed via source and target branches