diff -Nru nvidia-prime-0.8.15.3~0.20.04.1/debian/changelog nvidia-prime-0.8.16~0.20.04.1/debian/changelog --- nvidia-prime-0.8.15.3~0.20.04.1/debian/changelog 2020-11-20 15:19:39.000000000 +0000 +++ nvidia-prime-0.8.16~0.20.04.1/debian/changelog 2021-02-10 11:38:51.000000000 +0000 @@ -1,3 +1,14 @@ +nvidia-prime (0.8.16~0.20.04.1) focal; urgency=medium + + * prime-select: + - Make sure to update the initramfs, so that + the driver options can be applied correctly. + This time around we can also provide visual + feedback (in the form of a progress spinner) + while update-initramfs is running (LP: #1915003). + + -- Alberto Milone Wed, 10 Feb 2021 12:38:51 +0100 + nvidia-prime (0.8.15.3~0.20.04.1) focal; urgency=medium [ Alberto Milone ] diff -Nru nvidia-prime-0.8.15.3~0.20.04.1/prime-select nvidia-prime-0.8.16~0.20.04.1/prime-select --- nvidia-prime-0.8.15.3~0.20.04.1/prime-select 2020-11-20 15:19:39.000000000 +0000 +++ nvidia-prime-0.8.16~0.20.04.1/prime-select 2021-02-10 11:38:51.000000000 +0000 @@ -43,6 +43,8 @@ import re import subprocess import shutil +import itertools +import time from copy import deepcopy from subprocess import Popen, PIPE, CalledProcessError @@ -152,10 +154,10 @@ # (No need to check if nvidia is available) self._enable_nvidia() elif profile == "on-demand": - self._disable_nvidia(keep_nvidia_modules=True) if self._supports_runtimepm(): self._enable_runtimepm() self._enable_kms() + self._disable_nvidia(keep_nvidia_modules=True) else: # Make sure that the installed packages support PRIME #if not self._supports_prime(): @@ -182,6 +184,9 @@ else: self._blacklist_nvidia() + # Update the initramfs + self._update_initramfs() + def _enable_nvidia(self): try: os.unlink(self._old_blacklist_file) @@ -201,6 +206,9 @@ if not os.path.isfile(self._nvidia_kms_file): self._enable_kms() + # Update the initramfs + self._update_initramfs() + def _blacklist_nvidia(self): blacklist_text = '''# Do not modify # This file was generated by nvidia-prime @@ -308,6 +316,25 @@ params.append(param) return params + def _update_initramfs(self): + # Create spinner to give feed back on the + # operation + spinner = itertools.cycle ( ['-', '/', '|', '\\']) + proc = subprocess.Popen(['update-initramfs', '-u'],stdout=subprocess.PIPE) + print('Updating the initramfs. Please wait for the operation to complete:') + + # Check if process is still running + while proc.poll()==None: + # Print the spinner + sys.stdout.write(spinner.__next__()) + sys.stdout.flush() + sys.stdout.write('\b') + time.sleep(0.2) + + print('Done') + + # Print out the output + output=proc.communicate()[0] def _update_grub(self): subprocess.call(['update-grub'])