Merge ~gary-wzl77/ubuntu/+source/nvidia-prime:fix_undefined_variable into ubuntu/+source/nvidia-prime:ubuntu/devel

Proposed by Gary.Wang
Status: Merged
Merge reported by: Robie Basak
Merged at revision: 3a718d24ea8f884e362700f4f4baa88c461a40dc
Proposed branch: ~gary-wzl77/ubuntu/+source/nvidia-prime:fix_undefined_variable
Merge into: ubuntu/+source/nvidia-prime:ubuntu/devel
Diff against target: 12 lines (+1/-1)
1 file modified
prime-select (+1/-1)
Reviewer Review Type Date Requested Status
Ubuntu Sponsors Pending
git-ubuntu import Pending
Review via email: mp+434959@code.launchpad.net

Commit message

fix(prime-select): fix the undefined variable in the _has_integrated_gpu function

Fix the undefined variable when detecting the integrated gpu.

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks, a similar fix has been submitted upstream on https://github.com/tseliot/nvidia-prime/pull/25

Revision history for this message
Robie Basak (racb) wrote :

Looks like that pull request was submitted in November, with no response from upstream yet.

This merge proposal is still in the sponsorship queue. What do we need to do with it? Can it be closed - just effectively replaced with the upstream PR? Or does this need to land in an Ubuntu delta in the meantime?

What's the actual problem being fixed, please? How important is it?

Revision history for this message
Gary.Wang (gary-wzl77) wrote :

> Looks like that pull request was submitted in November, with no response from
> upstream yet.
>
> This merge proposal is still in the sponsorship queue. What do we need to do
> with it? Can it be closed - just effectively replaced with the upstream PR? Or
> does this need to land in an Ubuntu delta in the meantime?
A: I am not the maintainer of this package and not quite sure what's process/policy I need to go through to get this landed or just close it in favor of the upstream PR. I am fine with either way.
>
> What's the actual problem being fixed, please? How important is it?
A: My setup is a bit different than others. I have Ampere arm64 server[1] workstation + NVIDIA RTX A4500 GPU. After installing the nvidia-prime package and run

$ sudo prime-select nvidia
[sudo] password for gary:
Traceback (most recent call last):
  File "/usr/bin/prime-select", line 458, in <module>
    switcher.enable_profile(arg)
  File "/usr/bin/prime-select", line 223, in enable_profile
    if not self._has_integrated_gpu():
  File "/usr/bin/prime-select", line 198, in _has_integrated_gpu
    if t.find('8086') != -1 or t.lower().find('1002') != -1:
UnboundLocalError: local variable 't' referenced before assignment

To me, generally, this bug would affect the use case where the arm64 server + NVIDIA GPU both are in use.

[1] https://www.ipi.wiki/pages/comhpc-docs?page=index.html

Revision history for this message
Dan Bungert (dbungert) wrote :

Uploaded

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/prime-select b/prime-select
2index 1d46ffe..572e17e 100755
3--- a/prime-select
4+++ b/prime-select
5@@ -194,7 +194,7 @@ class Switcher(object):
6 else:
7 card = self._get_bootvga_card()
8 if card:
9- vendor = self._get_card_vendor(card)
10+ t = self._get_card_vendor(card)
11 if t.find('8086') != -1 or t.lower().find('1002') != -1:
12 status = True
13

Subscribers

People subscribed via source and target branches