UnboundLocalError: local variable 't' referenced before assignment

Bug #1948362 reported by Lialosiu
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
nvidia-prime (Ubuntu)
Fix Released
Medium
Dan Bungert

Bug Description

```
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
```

at file `prime-select`, line 198

https://git.launchpad.net/ubuntu/+source/nvidia-prime/tree/prime-select#n198

that `t` should be `vendor` I think. :)

Revision history for this message
yoloClin (yoloclin) wrote :

Ran into this exact issue, and modifying line 198 to

```
     if vendor.find('8086') != -1 or vendor.lower().find('1002') != -1:
```

successfully allowed me to use the utility. Thanks @Lialosiu.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in nvidia-prime (Ubuntu):
status: New → Confirmed
Revision history for this message
Steven Clarkson (sclarkson) wrote :

Same problem, here. The fix looks right to me.

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

Linked MP sponsored.

Changed in nvidia-prime (Ubuntu):
assignee: nobody → Dan Bungert (dbungert)
importance: Undecided → Medium
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package nvidia-prime - 0.8.17.2

---------------
nvidia-prime (0.8.17.2) mantic; urgency=medium

  [ Gary Wang ]
  * prime-select:
    - Fix usage of an undefined variable. Affects at least Ampere arm64
      server workstation + NVIDIA RTX A4500 GPU (LP: #1948362).

 -- Dan Bungert <email address hidden> Tue, 13 Jun 2023 09:45:03 -0600

Changed in nvidia-prime (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.