Here is the output without the fix:
Traceback (most recent call last):
  File "/usr/bin/nvidia-detector", line 8, in <module>
    a = NvidiaDetection(printonly=True, verbose=False)
  File "/usr/lib/python3/dist-packages/NvidiaDetector/nvidiadetector.py", line 
73, in __init__
    self.getData()
  File "/usr/lib/python3/dist-packages/NvidiaDetector/nvidiadetector.py", line 
163, in getData
    driver_version = self.__get_value_from_name(stripped_package_name)
  File "/usr/lib/python3/dist-packages/NvidiaDetector/nvidiadetector.py", line 
92, in __get_value_from_name
    v = int(name)
ValueError: invalid literal for int() with base 10: 'server'

Here are is my solution:

In function
    # line 88
    def __get_value_from_name(self, name):
        '''Get the integer associated to the name of a driver'''
        v = self.__driver_aliases.get(name)
        if v is None:
            if name.isdigit(): # I made sure is an int.
                v = int(name)
        return v

    # in line 164 I replaced with :
            if not (driver_version := 
self.__get_value_from_name(stripped_package_name)):
                continue

** Attachment added: "nvidiadetector.py"
   
https://bugs.launchpad.net/ubuntu/+source/ubuntu-drivers-common/+bug/1891183/+attachment/5403712/+files/nvidiadetector.py

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1891183

Title:
  the new -server drivers break nvidia-detector

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-drivers-common/+bug/1891183/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to