Comment 5 for bug 1993019

Revision history for this message
Vic Lim (limw0144) wrote (last edit ):

I confirmed @westonkelliher 's method and I have changed the python script with the file name '{usr-directory}/detect.py and it worked.

Thanks @westonkelliher !

# detect.py
def nvidia_desktop_pre_installation_hook(to_install):
    '''Applies changes that need to happen before installing the NVIDIA drivers'''
    with_nvidia_kms = False

    # Enable KMS if nvidia >= 470
    for package_name in to_install:
        if package_name.startswith('nvidia-driver-'):
            try:
                version = int(package_name.split('-')[-2]) #Line 839
            except ValueError:
                pass
            finally:
                with_nvidia_kms = version >= 470

    if with_nvidia_kms:
        set_nvidia_kms(1)