- bmbtest
- nvidia-installer 0.0.5-2
- --
- 2017-01-18 12:00
- --
- Reading nvidia-installer-0.0.5 source on GitHub at https://github.com/Antergos/nvidia-installer/blob/master/nvidia-installer I see that @karasu has applied recent suggestions:
- - adds user to video group
- - corrects nvidia-settings.desktop with sed
- It's not easy to figure out from source what pkgs will be installed now, have they changed? Will check the list of packages with **nvidia-installer --test**.
- It's probably possible to start testing 0.0.5, without waiting for OK from @karasu.
- Will start testing.
- Are there bmb-@karasu packages already installed?
- ```
- ┌──[just]─[alexatp]:~$
- └─> pacman -Q nvidia nvidia-libgl nvidia-utils lib32-libvdpau lib32-nvidia-libgl libvdpau
- error: package 'nvidia' was not found
- error: package 'nvidia-libgl' was not found
- error: package 'nvidia-utils' was not found
- error: package 'lib32-libvdpau' was not found
- error: package 'lib32-nvidia-libgl' was not found
- libvdpau 1.1.1-2
- ┌──[just]─[alexatp]:~$
- └─>
- ```
- Except libvdpau, which comes from gstreamer0.10-bad-plugins, there are not. The situation is the same as before 0.0.4 tests. It's clean.
- Are there bmb-@just packages already installed?
- ```
- ┌──[just]─[alexatp]:~$
- └─> pacman -Q bbswitch bumblebee mesa nvidia nvidia-settings lib32-mesa-libgl lib32-nvidia-utils lib32-virtualgl xf86-video-intel
- error: package 'bbswitch' was not found
- error: package 'bumblebee' was not found
- mesa 13.0.3-1
- error: package 'nvidia' was not found
- error: package 'nvidia-settings' was not found
- lib32-mesa-libgl 13.0.3-1
- error: package 'lib32-nvidia-utils' was not found
- error: package 'lib32-virtualgl' was not found
- xf86-video-intel 1:2.99.917+747+g028c946d-1
- ┌──[just]─[alexatp]:~$
- └─>
- ```
- There are no bmb-specific pkgs installed, except three ones, already discussed earlier. lib32-mesa-libgl comes with steam. mesa and xf86-video-intel are installed by default. The situation is the same as before 0.0.4 tests. It's clean.
- Upgrading the system, explicitely display all repos, allow downgrades. Nvidia-installer must be upgraded to 0.0.5.
- ```
- ┌──[just]─[alexatp]:~$
- └─> sudo pacman -Syyuu
- :: Synchronizing package databases...
- antergos-staging 3.6 KiB 512K/s 00:00 [---------------------------------------] 100%
- antergos 139.5 KiB 2.72M/s 00:00 [---------------------------------------] 100%
- core 123.5 KiB 901K/s 00:00 [---------------------------------------] 100%
- extra 1722.4 KiB 2.39M/s 00:01 [---------------------------------------] 100%
- community 3.7 MiB 2.10M/s 00:02 [---------------------------------------] 100%
- multilib 185.9 KiB 1936K/s 00:00 [---------------------------------------] 100%
- :: Starting full system upgrade...
- resolving dependencies...
- looking for conflicting packages...
- Package (2) Old Version New Version Net Change Download Size
- antergos-staging/nvidia-installer 0.0.4-1 0.0.5-2 0.00 MiB 0.01 MiB
- extra/webkit2gtk 2.14.2-2 2.14.3-1 0.00 MiB 22.84 MiB
- Total Download Size: 22.84 MiB
- Total Installed Size: 101.96 MiB
- Net Upgrade Size: 0.01 MiB
- :: Proceed with installation? [Y/n] Y
- :: Retrieving packages...
- nvidia-installer-0.0.5-2-any 7.0 KiB 0.00B/s 00:00 [---------------------------------------] 0%
- webkit2gtk-2.14.3-1-x86_64 22.8 MiB 3.01M/s 00:08 [---------------------------------------] 100%
- (2/2) checking keys in keyring [---------------------------------------] 100%
- (2/2) checking package integrity [---------------------------------------] 100%
- error: nvidia-installer: signature from "Antergos Build Server (Automated Package Build System) <[email protected]>" is invalid
- :: File /var/cache/pacman/pkg/nvidia-installer-0.0.5-2-any.pkg.tar.xz is corrupted (invalid or corrupted package (PGP signature)).
- Do you want to delete it? [Y/n] Y
- error: failed to commit transaction (invalid or corrupted package)
- Errors occurred, no packages were upgraded.
- ┌──[just]─[alexatp]:~$
- └─>
- ```
- Oops. Signature problem with nvidia-installer package.
- ```
- ...
- error: nvidia-installer: signature from "Antergos Build Server (Automated Package Build System) <[email protected]>" is invalid
- :: File /var/cache/pacman/pkg/nvidia-installer-0.0.5-2-any.pkg.tar.xz is corrupted (invalid or corrupted package (PGP signature)).
- Do you want to delete it? [Y/n]
- error: failed to commit transaction (invalid or corrupted package)
- Errors occurred, no packages were upgraded.
- ```
- I rotated all antergos-mirrorlist, country by country, server by server inside each country. Nothing helps.
- Will install the pkg locally, without the signature:
- ```
- ┌──[just]─[alexatp]:/1st/dnl$
- └─> sudo pacman -U /1st/dnl/nvidia-installer-0.0.5-2-any.pkg.tar.xz
- loading packages...
- resolving dependencies...
- looking for conflicting packages...
- Package (1) Old Version New Version Net Change
- nvidia-installer 0.0.4-1 0.0.5-2 0.00 MiB
- Total Installed Size: 0.04 MiB
- Net Upgrade Size: 0.00 MiB
- :: Proceed with installation? [Y/n] Y
- (1/1) checking keys in keyring [---------------------------------------] 100%
- (1/1) checking package integrity [---------------------------------------] 100%
- (1/1) loading package files [---------------------------------------] 100%
- (1/1) checking for file conflicts [---------------------------------------] 100%
- (1/1) checking available disk space [---------------------------------------] 100%
- :: Processing package changes...
- (1/1) upgrading nvidia-installer [---------------------------------------] 100%
- ┌──[just]─[alexatp]:/1st/dnl$
- └─>
- ```
- Are there any pending upgrades? What is the current nvidia-installer's version?
- ```
- ┌──[just]─[alexatp]:/1st/dnl$
- └─> sudo pacman -Syyuu
- :: Synchronizing package databases...
- antergos-staging 3.6 KiB 512K/s 00:00 [---------------------------------------] 100%
- antergos 139.5 KiB 2.72M/s 00:00 [---------------------------------------] 100%
- core 123.5 KiB 908K/s 00:00 [---------------------------------------] 100%
- extra 1722.4 KiB 2.00M/s 00:01 [---------------------------------------] 100%
- community 3.7 MiB 2.64M/s 00:01 [---------------------------------------] 100%
- multilib 185.9 KiB 1737K/s 00:00 [---------------------------------------] 100%
- :: Starting full system upgrade...
- there is nothing to do
- ┌──[just]─[alexatp]:/1st/dnl$
- └─> pacman -Q nvidia-installer
- nvidia-installer 0.0.5-2
- ┌──[just]─[alexatp]:/1st/dnl$
- └─>
- ```
- Ready for test.
- A lunch break, then will start testing.
- 2017-01-18 14:00
- --
- At the end of all, check nvidia-installer for repairing capability!
- Bmb article from Antergos Wiki may be used as repairing tool. It may be applied more than once, eventually fixing a broken Bmb installation.
- Can nvidia-installer do the same?
- Final checks before running nvidia-installer.
- Is Bmb already installed?
- ```
- ┌──[just]─[alexatp]:~$
- └─> systemctl status bumblebeed
- Unit bumblebeed.service could not be found.
- ┌──[just]─[alexatp]:~$
- └─> optirun --status
- bash: optirun: command not found
- ┌──[just]─[alexatp]:~$
- └─>
- ```
- No, it is not.
- Is xf86-video-nouveau still present (installed):
- ```
- ┌──[just]─[alexatp]:~$
- └─> pacman -Q xf86-video-nouveau
- xf86-video-nouveau 1.0.13-2
- ┌──[just]─[alexatp]:~$
- └─>
- ```
- Yes, it is. Nvidia-installer should remove this damned thingie.
- What are my current groups?
- ```
- ┌──[just]─[alexatp]:~$
- └─> whoami
- just
- ┌──[just]─[alexatp]:~$
- └─> groups $USER
- wheel autologin users
- ┌──[just]─[alexatp]:~$
- └─>
- ```
- OK, no Bmb groups.
- I'm almost ready to run nvidia-installer.
- What it will do? A generic **--test**:
- ```
- ┌──[just]─[alexatp]:~$
- └─> nvidia-installer --test
- 2017-01-18 14:00:06 [INFO]: All logs will be stored in /tmp/nvidia-installer.log
- 2017-01-18 14:00:06 [INFO]: Running the installer in testing mode...
- 2017-01-18 14:00:06 [INFO]: Installing nvidia driver...
- 2017-01-18 14:00:06 [INFO]: Removing conflicting packages...
- 2017-01-18 14:00:06 [INFO]: pacman -Rs --noconfirm --noprogressbar --nodeps --nodeps xf86-video-nouveau
- 2017-01-18 14:00:06 [INFO]: pacman -Rs --noconfirm --noprogressbar --nodeps --nodeps mesa-libgl
- 2017-01-18 14:00:06 [INFO]: pacman -Rs --noconfirm --noprogressbar --nodeps --nodeps lib32-mesa-libgl
- 2017-01-18 14:00:06 [INFO]: Downloading and installing driver packages, please wait...
- 2017-01-18 14:00:06 [INFO]: pacman -Sqy --noconfirm --noprogressbar nvidia nvidia-utils nvidia-libgl libvdpau lib32-nvidia-libgl lib32-libvdpau
- 2017-01-18 14:00:06 [INFO]: Creating /etc/X11/xorg.conf.d/20-nvidia.conf file...
- 2017-01-18 14:00:06 [INFO]: Installation finished. Nothing has been modified as testing mode was ON.
- ┌──[just]─[alexatp]:~$
- └─>
- ```
- The output is nicely colorized now. The output looks a bit more detailed than in 0.0.4, though I can't immediately find what are the differences.
- I like a lot this piece:
- ```
- All logs will be stored in /tmp/nvidia-installer.log
- ```
- Will check and save the log after the installation.
- Seems like pkgs list is slightly changed, but I have no wish to check it in details - even older 0.0.4 bmb-@karasu works nicely.
- What nvidia-installer will do for Bmb? A Bmb-specific **--test --bumblebee**:
- ```
- ┌──[just]─[alexatp]:~$
- └─> sudo nvidia-installer --test --bumblebee
- 2017-01-18 14:20:03 [INFO]: All logs will be stored in /tmp/nvidia-installer.log
- 2017-01-18 14:20:03 [INFO]: Running the installer in testing mode...
- 2017-01-18 14:20:03 [INFO]: Installing bumblebee driver...
- 2017-01-18 14:20:03 [INFO]: Removing conflicting packages...
- 2017-01-18 14:20:03 [INFO]: pacman -Rs --noconfirm --noprogressbar --nodeps --nodeps xf86-video-nouveau
- 2017-01-18 14:20:03 [INFO]: Downloading and installing driver packages, please wait...
- 2017-01-18 14:20:03 [INFO]: pacman -Sqy --noconfirm --noprogressbar bumblebee mesa xf86-video-intel nvidia virtualgl nvidia-settings bbswitch lib32-nvidia-utils lib32-virtualgl lib32-mesa-libgl
- 2017-01-18 14:20:03 [INFO]: Adding user just to bumblebee group...
- 2017-01-18 14:20:03 [INFO]: gpasswd -a just bumblebee
- 2017-01-18 14:20:03 [INFO]: Adding user just to video group...
- 2017-01-18 14:20:03 [INFO]: gpasswd -a just video
- 2017-01-18 14:20:03 [INFO]: Enabling bumblebeed.service service...
- 2017-01-18 14:20:03 [INFO]: systemctl enable bumblebeed.service
- 2017-01-18 14:20:03 [INFO]: Could not find /usr/share/applications/nvidia-settings.desktop file. Is nvidia-settings installed?
- 2017-01-18 14:20:03 [INFO]: Installation finished. Nothing has been modified as testing mode was ON.
- ┌──[just]─[alexatp]:~$
- └─>
- ```
- Wow! It's looks just perfect! If it will do what is promised here, it should be a perfect installation.
- Let's start.
- Ready. Steady. Go. Running nvidia-installer-0.0.5 for the 1st time:
- ```
- ┌──[just]─[alexatp]:~$
- └─> sudo nvidia-installer --bumblebee
- 2017-01-18 14:31:05 [INFO]: All logs will be stored in /tmp/nvidia-installer.log
- 2017-01-18 14:31:05 [INFO]: Installing bumblebee driver...
- 2017-01-18 14:31:05 [INFO]: Removing conflicting packages...
- 2017-01-18 14:31:06 [INFO]: Downloading and installing driver packages, please wait...
- 2017-01-18 14:31:44 [INFO]: Adding user just to bumblebee group...
- 2017-01-18 14:31:44 [INFO]: Adding user just to video group...
- 2017-01-18 14:31:45 [INFO]: Enabling bumblebeed.service service...
- 2017-01-18 14:31:45 [INFO]: Patching /usr/share/applications/nvidia-settings.desktop...
- 2017-01-18 14:31:45 [WARNING]: Cannot patch /usr/share/applications/nvidia-settings.desktop file : sed: -e expression #1, char 1: unknown command: `''
- 2017-01-18 14:31:45 [INFO]: Installation finished. You need to reboot now!
- ┌──[just]─[alexatp]:~$
- └─>
- ```
- Not bad. Aside from nvidia-settings.desktop, the rest looks very good.
- Installation log is saved in /1st/tmp/bmbtest:
- ```
- ┌──[just]─[alexatp]:~$
- └─> cp /tmp/nvidia-installer.log /1st/tmp/bmbtest
- ┌──[just]─[alexatp]:~$
- └─> ls -lha /1st/tmp/bmbtest
- total 100K
- drwxr-xr-x 2 just users 4.0K Jan 18 14:34 .
- drwxrwxrwx 3 just users 4.0K Jan 18 12:02 ..
- -rw-r--r-- 1 just users 20K Jan 16 18:34 bmb-full-0.0.4
- -rw-r--r-- 1 just users 12K Jan 18 14:26 bmb-full-0.0.5
- -rw------- 1 just users 3.3K Jan 18 14:33 .bmb-full-0.0.5.kate-swp
- -rw-r--r-- 1 just users 9.6K Jan 16 18:50 bmb-post-1
- -rw-r--r-- 1 just users 11K Jan 17 10:52 bmb-post-2
- -rw-r--r-- 1 just 1001 26K Jan 18 11:41 nvidia-installer-0.0.5
- -rw-r--r-- 1 just users 890 Jan 18 14:34 nvidia-installer.log
- ┌──[just]─[alexatp]:~$
- └─>
- ```
- Ah, actually the log is the same as terminal's output. Nothing interesting.
- Reboot.
- Simple checks.
- 1. What pkgs are installed?
- Are all pkgs installed? Those listed in the Bumblebee article on Antergos Wiki?
- ```
- ┌──[just]─[alexatp]:/1st/tmp/bmbtest$
- └─> pacman -Q bbswitch bumblebee mesa nvidia nvidia-settings lib32-mesa-libgl lib32-nvidia-utils lib32-virtualgl xf86-video-intel
- bbswitch 0.8-55
- bumblebee 3.2.1-12
- mesa 13.0.3-1
- nvidia 375.26-1
- nvidia-settings 375.26-1
- lib32-mesa-libgl 13.0.3-1
- lib32-nvidia-utils 375.26-2
- lib32-virtualgl 2.5.1-1
- xf86-video-intel 1:2.99.917+747+g028c946d-1
- ┌──[just]─[alexatp]:/1st/tmp/bmbtest$
- └─>
- ```
- Yes, everything is present. Good. @karasu even reinstalls xf86-video-intel, as suggested by ArchWiki. Perfect.
- 2. Has nouveau been removed?
- ```
- ┌──[just]─[alexatp]:/1st/tmp/bmbtest$
- └─> pacman -Q xf86-video-nouveau
- error: package 'xf86-video-nouveau' was not found
- ┌──[just]─[alexatp]:/1st/tmp/bmbtest$
- └─>
- ```
- No more nouveau anymore! Thanks, Lord! Am I a poet? Perfect.
- 3. What are my groups?
- ```
- ┌──[just]─[alexatp]:/1st/tmp/bmbtest$
- └─> whoami
- just
- ┌──[just]─[alexatp]:/1st/tmp/bmbtest$
- └─> groups $USER
- wheel video autologin bumblebee users
- ┌──[just]─[alexatp]:/1st/tmp/bmbtest$
- └─>
- ```
- I'm in bumblebee and video now. Perfect.
- 4. bumblebeed status
- ```
- ┌──[just]─[alexatp]:~$
- └─> systemctl status bumblebeed
- ● bumblebeed.service - Bumblebee C Daemon
- Loaded: loaded (/usr/lib/systemd/system/bumblebeed.service; enabled; vendor preset: disabled)
- Active: active (running) since Wed 2017-01-18 14:39:22 MSK; 1min 37s ago
- Main PID: 458 (bumblebeed)
- Tasks: 1 (limit: 4915)
- CGroup: /system.slice/bumblebeed.service
- └─458 /usr/bin/bumblebeed
- Jan 18 14:39:22 alexatp.net systemd[1]: Started Bumblebee C Daemon.
- Jan 18 14:39:25 alexatp.net bumblebeed[458]: [ 18.348545] [INFO]/usr/bin/bumblebeed 3.2.1 started
- ┌──[just]─[alexatp]:~$
- └─>
- ```
- It's:
- - loaded
- - enabled
- - active
- - running
- I.e., perfect.
- 5. optirun status
- ```
- ┌──[just]─[alexatp]:~$
- └─> optirun --status
- Bumblebee status: Ready (3.2.1). X inactive. Discrete video card is off.
- ┌──[just]─[alexatp]:~$
- └─>
- ```
- Nvidia is OFF. Perfect.
- 6. Graphics acceleration
- 6.a Running on Intel, standard FPS, no accel
- ```
- ┌──[just]─[alexatp]:~$
- └─> glxspheres64
- Polygons in scene: 62464 (61 spheres * 1024 polys/spheres)
- Visual ID of window: 0xa7
- Context is Direct
- OpenGL Renderer: Mesa DRI Intel(R) Sandybridge Mobile
- 60.406499 frames/sec - 67.413653 Mpixels/sec
- 59.766651 frames/sec - 66.699582 Mpixels/sec
- 59.969403 frames/sec - 66.925853 Mpixels/sec
- 59.677892 frames/sec - 66.600528 Mpixels/sec
- 59.888442 frames/sec - 66.835501 Mpixels/sec
- 59.831687 frames/sec - 66.772163 Mpixels/sec
- 59.818511 frames/sec - 66.757458 Mpixels/sec
- ^C
- ┌──[just]─[alexatp]:~$
- └─>
- ```
- 6.b Running on Nvidia, higher FPS, accelerated
- ```
- ┌──[just]─[alexatp]:~$
- └─> optirun -c jpeg glxspheres64
- Polygons in scene: 62464 (61 spheres * 1024 polys/spheres)
- Visual ID of window: 0x20
- Context is Direct
- OpenGL Renderer: GeForce GT 555M/PCIe/SSE2
- 200.413514 frames/sec - 223.661482 Mpixels/sec
- 199.517629 frames/sec - 222.661675 Mpixels/sec
- 202.536455 frames/sec - 226.030684 Mpixels/sec
- 204.965754 frames/sec - 228.741782 Mpixels/sec
- 205.965920 frames/sec - 229.857967 Mpixels/sec
- 198.738659 frames/sec - 221.792344 Mpixels/sec
- 201.750740 frames/sec - 225.153826 Mpixels/sec
- ^C[ 521.268776] [WARN]Received Interrupt signal.
- ┌──[just]─[alexatp]:~$
- └─>
- ```
- Acceleration = 225 / 67 = 3.4x. Good.
- Rigorous tests.
- 1. Automatic power saving feature (automatic bbswitch)
- ```
- ┌──[just]─[alexatp]:/1st/tmp/bmbtest$
- └─> optirun --status
- Bumblebee status: Ready (3.2.1). X inactive. Discrete video card is off.
- ┌──[just]─[alexatp]:/1st/tmp/bmbtest$
- └─> optirun pwd
- /1st/tmp/bmbtest
- ┌──[just]─[alexatp]:/1st/tmp/bmbtest$
- └─> optirun --status
- Bumblebee status: Ready (3.2.1). X inactive. Discrete video card is off.
- ┌──[just]─[alexatp]:/1st/tmp/bmbtest$
- └─>
- ```
- Nvidia is OFF after multiple optirun executions. Perfect.
- 2. Manual power saving tweaking (bbswitch by hand)
- ```
- ┌──[just]─[alexatp]:/1st/tmp/bmbtest$
- └─> optirun --status
- Bumblebee status: Ready (3.2.1). X inactive. Discrete video card is off.
- ┌──[just]─[alexatp]:/1st/tmp/bmbtest$
- └─> sudo cat /proc/acpi/bbswitch
- 0000:01:00.0 OFF
- ┌──[just]─[alexatp]:/1st/tmp/bmbtest$
- └─>
- ```
- Low-level Nvidia interrogation returns the same result as the high-level optirun: Nvidia is OFF. Perfect.
- Forcing Nvidia ON by hand. There's no high-level analog for the command:
- ```
- ┌──[just]─[alexatp]:/1st/tmp/bmbtest$
- └─> optirun --status
- Bumblebee status: Ready (3.2.1). X inactive. Discrete video card is off.
- ┌──[just]─[alexatp]:/1st/tmp/bmbtest$
- └─> sudo tee /proc/acpi/bbswitch <<<ON
- ON
- ┌──[just]─[alexatp]:/1st/tmp/bmbtest$
- └─> optirun --status
- Bumblebee status: Ready (3.2.1). X inactive. Discrete video card is on.
- ┌──[just]─[alexatp]:/1st/tmp/bmbtest$
- └─> sudo cat /proc/acpi/bbswitch
- 0000:01:00.0 ON
- ┌──[just]─[alexatp]:/1st/tmp/bmbtest$
- └─>
- ```
- Nvidia is force ON and remains in that state. Perfect.
- Forcing it OFF again (a normal state):
- ```
- ┌──[just]─[alexatp]:/1st/tmp/bmbtest$
- └─> sudo tee /proc/acpi/bbswitch <<<OFF
- OFF
- ┌──[just]─[alexatp]:/1st/tmp/bmbtest$
- └─> sudo cat /proc/acpi/bbswitch
- 0000:01:00.0 OFF
- ┌──[just]─[alexatp]:/1st/tmp/bmbtest$
- └─> optirun --status
- Bumblebee status: Ready (3.2.1). X inactive. Discrete video card is off.
- ┌──[just]─[alexatp]:/1st/tmp/bmbtest$
- └─>
- ```
- Both low- and high-level interrogations return OFF. Perfect.
- 3. Nvidia modules unload
- When optirun turns Nvidia ON, it loads three modules in the memory:
- - nvidia_drm
- - nvidia_modeset
- - nvidia
- When optirun exits, it must automatically unload them. So a manual attempt to unload them must fail. Is that true?
- ```
- ┌──[just]─[alexatp]:/1st/tmp/bmbtest$
- └─> sudo rmmod nvidia_drm nvidia_modeset nvidia
- rmmod: ERROR: Module nvidia_drm is not currently loaded
- rmmod: ERROR: Module nvidia_modeset is not currently loaded
- rmmod: ERROR: Module nvidia is not currently loaded
- ┌──[just]─[alexatp]:/1st/tmp/bmbtest$
- └─>
- ```
- Yes, it's true. Nvidia is turned OFF, all its modules are unloaded. Perfect.
- All strictly Bmb-related tests are finished. All checkss are successfully passed by nvidia-installer-0.0.5.
- 2017-01-18 17:00
- --
- What about nvidia-settings.desktop adjustments? It returned the error:
- ```
- 2017-01-18 14:31:45 [WARNING]: Cannot patch /usr/share/applications/nvidia-settings.desktop file : sed: -e expression #1, char 1: unknown command: `''
- ```
- The file still contains the default, wrong on Optimus utility invocation:
- ```
- ┌──[just]─[alexatp]:~$
- └─> sudo cat /usr/share/applications/nvidia-settings.desktop | grep Exec=
- Exec=/usr/bin/nvidia-settings
- ┌──[just]─[alexatp]:~$
- └─>
- ```
- From nvidia-installer-0.0.5 source
- ```
- # Fix nvidia-settings.desktop
- desktop_path = "/usr/share/applications/nvidia-settings.desktop"
- if os.path.exists(desktop_path):
- log_info("Patching {}...".format(desktop_path))
- cmd = ["sed", "-i", "'s/Exec=nvidia-settings/Exec=optirun -b none nvidia-settings -c :8/'", "/usr/share/applications/nvidia-settings.desktop"]
- if TEST:
- log_info(" ".join(cmd))
- else:
- try:
- subprocess.check_output(cmd, stderr=subprocess.STDOUT)
- except subprocess.CalledProcessError as err:
- log_warning("Cannot patch {0} file : {1}".format(desktop_path, err.output.decode()))
- else:
- log_info("Could not find {0} file. Is nvidia-settings installed?".format(desktop_path))
- ```
- The sed is not quite correctl:
- ```
- ..."'s/Exec=nvidia-settings/Exec=optirun -b none nvidia-settings -c :8/'"...
- ```
- First, Exec= uses fully qualified path. My bad, I didn't tell it to @karasu. The actual command is:
- ```
- Exec=/usr/bin/nvidia-settings
- ```
- so the sed becomes:
- ```
- ..."'s/Exec=/usr/bin/nvidia-settings/Exec=optirun -b none nvidia-settings -c :8/'"...
- ```
- But there are slashes in the string, so either we must use backslashes to quote slashes:
- ```
- "'s/Exec=\/usr\/bin\/nvidia-settings/Exec=optirun -b none \/usr\/bin\/nvidia-settings -c :8/'", "/usr/share/applications/nvidia-settings.desktop"
- ```
- or simply use another delimiter in sed. I like to use pipe:
- ```
- "'s|Exec=/usr/bin/nvidia-settings|Exec=optirun -b none /usr/bin/nvidia-settings -c :8|'", "/usr/share/applications/nvidia-settings.desktop"
- ```
- Applying in terminal what is said above:
- - unmodified nvidia-settings.desktop
- - running sed
- - modified nvidia-settings.desktop
- Using backslashes:
- ```
- ┌──[just]─[alexatp]:~$
- └─> sudo cat /usr/share/applications/nvidia-settings.desktop | grep Exec=
- Exec=/usr/bin/nvidia-settings
- ┌──[just]─[alexatp]:~$
- └─> sudo sed -i 's/Exec=\/usr\/bin\/nvidia-settings/Exec=optirun -b none \/usr\/bin\/nvidia-settings -c :8/' /usr/share/applications/nvidia-settings.desktop
- ┌──[just]─[alexatp]:~$
- └─> sudo cat /usr/share/applications/nvidia-settings.desktop | grep Exec=
- Exec=optirun -b none /usr/bin/nvidia-settings -c :8
- ┌──[just]─[alexatp]:~$
- └─>
- ```
- The file /usr/share/applications/nvidia-settings.desktop was modified as needed.
- Restoring the original /usr/share/applications/nvidia-settings.desktop.
- Using pipes:
- ```
- ┌──[just]─[alexatp]:~$
- └─> sudo cat /usr/share/applications/nvidia-settings.desktop | grep Exec=
- Exec=/usr/bin/nvidia-settings
- ┌──[just]─[alexatp]:~$
- └─> sudo sed -i 's|Exec=/usr/bin/nvidia-settings|Exec=optirun -b none /usr/bin/nvidia-settings -c :8|' /usr/share/applications/nvidia-settings.desktop
- ┌──[just]─[alexatp]:~$
- └─> sudo cat /usr/share/applications/nvidia-settings.desktop | grep Exec=
- Exec=optirun -b none /usr/bin/nvidia-settings -c :8
- ┌──[just]─[alexatp]:~$
- └─>
- ```
- The file /usr/share/applications/nvidia-settings.desktop was modified as needed.
- All tests are finished.
- Nvidia-installer-0.0.5 has passed almost all checks. The only one failed is nvidia-settings.desktop not adjusted to run correctly on Optimus. It's enough to slightly correct sed instructions to solve the inconvenience.
- Regards
Antergos nvidia-installer 0.0.5.
Full report.