Thursday, November 16, 2017

Dell Precision 5520; NVIDIA Optimus PRIME with openSUSE TW and Leap

NVIDIA Optimus is a technology that allows an Intel integrated GPU and discrete NVIDIA GPU to be built into and accessible through a laptop. Getting Optimus graphics to work on Linux requires a few somewhat complicated steps and there are several methods to choose from.
  • disabling one of the devices in BIOS, which may result in improved battery life if the NVIDIA device is disabled, but may not be available with all BIOSes and does not allow GPU switching 
  • using the official Optimus support (PRIME) included with the proprietary NVIDIA driver, which offers the best NVIDIA performance but does not allow GPU switching unless in offload mode which doesn't work yet. 
  • using the PRIME functionality of the open-source nouveau driver, which allows GPU switching and powersaving but offers poor performance compared to the proprietary NVIDIA driver. 
  • using the third-party Bumblebee program to implement Optimus-like functionality, which offers GPU switching and powersaving but requires extra configuration. 
In this blog I'm going to focus on setting things up using the official Optimus support of PRIME output mode included with the proprietary NVIDIA driver. You can read about it here at the NVIDIA devtalk forums.

1) First we will need to disable open source nuoveau driver. You can follow the link here which will walk you through the hard way of installing and setting up the NVIDIA driver.

2) Once the NVIDIA driver is installed and nuoveau is blacklisted and the module is not loading it should look like this.
# lsmod | grep nvidia
nvidia_drm 53248 3
nvidia_modeset 843776 9 nvidia_drm
nvidia 13033472 1190 nvidia_modeset
drm_kms_helper 192512 2 i915,nvidia_drm
drm 417792 6 i915,nvidia_drm,drm_kms_helper

3) You can now begin the process of setting up your xorg.conf file to use both the Intel integrated GPU (iGPU) and the dedicated NVIDIA GPU (dGPU) in the output mode which is explained in the NVIDIA devtalk forum link above.

The below is the /etc/X11/xorg.conf I use with my Dell Precision 5520 running openSUSE TW
Section "Module"
Load "modesetting"

Section "Device"
Identifier "nvidia"
Driver "nvidia"
BusID "PCI:1:0:0"
Option "AllowEmptyInitialConfiguration"

Section "Device" Identifier "Intel" Driver "modesetting" BusID "PCI:0:2:0" Option "AccelMethod" "sna"
The BusID for both cards can be discovered with this command: 
# lspci | grep -e VGA -e NVIDIA
00:02.0 VGA compatible controller: Intel Corporation HD Graphics 530 (rev 06)
01:00.0 3D controller: NVIDIA Corporation GM107GLM [Quadro M1200 Mobile] (rev a2)
The format for the BusID is explained here

4) Once you have your xorg.conf file setup right you will also need to setup your ~/.xinitrc file like this.
xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto

if [ -d /etc/X11/xinit/xinitrc.d ]; then
for f in /etc/X11/xinit/xinitrc.d/*; do
[ -x "$f" ] && . "$f"
unset f

exec dbus-launch startkde
exit 0
Of course I'm setup for KDE. If you want to load Gnome instead then change startkde to startx in your ~/.xinitrc file.

5) Reboot, Login, and enjoy your new setup with discrete NVIDIA graphics with Optimus.

Have a lot of fun!

Note: Nvidia PRIME on Linux Currently does not work like MS Windows where it offloads 3D and performance graphics to the Nvidia GPU. It works in an output method. The definition of the two methods is 

"Output" allows you to use the discrete GPU as the sole source of rendering, just as it would be in a traditional desktop configuration. A screen-sized buffer is shared from the dGPU to the iGPU, and the iGPU does nothing but present it to the screen. 

"Offload" attempts to mimic more closely the functionality of Optimus on Windows. Under normal operation, the iGPU renders everything, from the desktop to the applications. Specific 3D applications can be rendered on the dGPU, and shared to the iGPU for display. When no applications are being rendered on the dGPU, it may be powered off. NVIDIA has no plans to support PRIME render offload at this time. 

So in "Output" mode this will cause the dGPU to always be running.. I've not tested to see how this affects the battery life. 🙂 time will tell. I'll update the post to let everyone know.


Thursday, November 9, 2017

Dell Precision 5520 Touchpad; openSUSE TW and Leap with libinput

Going forward libinput is in favor of using synaptics touchpad driver and will integrate better with future DE environments especially as things move towards the use of Wayland. Some DE environments allow you to set some of the settings today. You can use the following method to make sure you have libinput setup and some most desired settings defined such as 2 and 3 finger clicking. At least for me. ☺

1) Make sure you remove all synaptics packages. There should be maybe 4 or 5 installed by default
# rpm -qa  | grep synaptics

2) Make sure that you have libinput and friends installed (The following outputs are from TW)
# rpm -qa | grep libinput

# rpm -qa | grep xinput

# rpm -qa | grep xdotool

3) Execute the following if you don't have some of them installed.

# zypper in libinput-udev libinput-tools libinput10 libinput10-32bit
xf86-input-libinput xinput xdotool


4) Now your ready to setup some properties for your Touchpad. First lets find
out which ID is yours.

# xinput list | grep Touchpad
⎜   ↳ DLL07BF:01 06CB:7A13 Touchpad             id=14   [slave  pointer  (2)]

On mine the id=14 from the output above. We can use this id to set some properties for the touchpad. There are 3 properties which make sense to me to have enabled in Linux.

Enabling of two-finger and three-finger clicking for the touchpad.  This will allow you to use two-finger for left click and three-finger for middle mouse button actions in Linux such as paste. To enable this use the below command. Notice that I use the 14 which is the id from the previous command in the command options.

# xinput set-prop 14 "libinput Click Method Enabled" 0 1

Another one I like and some might not is the enablement of the natural scrolling ability. To enable this run the following command.

# xinput set-prop 14 "libinput Natural Scrolling Enabled" 1

I also found that my mouse was not moving quite as fast as I would have liked so I changed the pointer speed.

# xinput set-prop 14 "libinput Accel Speed" 1

Those 3 properties I really like to use.  However there are quite a few others you can tweak and tune. Use the following command to get a full list of the properties available to the trackpad. Again makind sure to use your id in the command options.

# xinput list-props 14

If you really like the tapping options you can enable those. Yuk!

There is a small GUI utility you can install called lxinput which has some basic stuff, but not feature complete. Both Gnome and KDE are integrating the ability to use the libinput drivers for the touchpad and both are not feature complete yet. In KDE Plasma you can set the Accel Speed from your System Settings.

To enable some libinput persistence between reboots and sleep modes you can add the following to your xorg configuration.

Edit /etc/X11/xorg.conf.d/40-libinput.conf (This is a default file that's installed with openSUSE)
Modify the Input Class that's labeled with an identifier of "touchpad catchall" to look like the below. Notice I removed the Tapping Option

Section "InputClass"
        Identifier "libinput touchpad catchall"
        MatchIsTouchpad "on"
        MatchDevicePath "/dev/input/event*"
        MatchProduct "DLL07BF:01 06CB:7A13 Touchpad"
        Driver "libinput"
        Option "ClickMethod" "clickfinger"
        Option "NaturalScrolling" "false"
        Option "AccelSpeed" "1"

man libinput 4


Friday, March 24, 2017

VMware Workstation 12.x.x for latest openSUSE Tumbleweed

As you know Tumbleweed is constantly churning and as such there are points in time where some of the libraries required to run VMware Workstation get a new version that isn't compatible with the latest release or the version you have installed. Mostly the Kernel problems get worked around with simple patches so that the vmmon and vmnet drivers can compile correctly and I've posted a few here on my blog with a tool that can help as well. See my post from January.

So what if for example (which is what happened this month with a newer library version of curl) that we have a newer version of library than what is supported by VMware Workstation. So you go ahead and launch vmware, but no VMware Workstation windows opens. The first thing you can do is inspect the log craeted at /tmp/vmware-<your_home_user>/vmware-apploader-<some_number>.log. It will show you in the beginning which libraries it will be using from either SYSTEM or SHIPPED with VMware Workstation. From the output this month we have the following which is suspect in our log.
017-03-24T08:59:45.773-06:00| appLoader| I125: Marking node as SHIPPED.
2017-03-24T08:59:45.773-06:00| appLoader| I125: Marking node as SHIPPED.
2017-03-24T08:59:45.773-06:00| appLoader| I125: Marking node as SYSTEM.
2017-03-24T08:59:45.789-06:00| appLoader| I125: System has OpenSSL version OpenSSL/1.0.2k, ours is OpenSSL/1.0.2k.
2017-03-24T08:59:45.789-06:00| appLoader| I125: System has version 7.53.1 (need 7.51.0) and has been compiled with c-ares support (SSL compatibility? yes).
2017-03-24T08:59:45.789-06:00| appLoader| I125: Marking node as SYSTEM.
Since was marked as SYSTEM we know that it is trying to use the library from our installed packages. libcurl had some recent upgrades. We can try to mitigate this in two ways.

We can execute from the command line forcing to use all SHIPPED libraries from VMware Workstation.
# VMWARE_USE_SHIPPED_LIBS=force vmware &
We can force the one library to be run from the SHIPPED libraries by running the following.
# export LD_LIBRARY_PATH=/usr/lib/vmware/lib/$LD_LIBRARY_PATH
# vmware & 
Both ways are acceptable, but in some cases the later can have better performance in my experience.

Hopefully this can help with future changes in openSUSE Tumbleweed and ensure that you can continue to run VMware Workstation no matter the outcome of the installed packages.


Tuesday, February 21, 2017

OpenStack Summit Boston 2017 Presentation Votes (ends Feb. 21st, 2017 at 11:59pm PST)

Open voting is available for all session submissions until Tuesday, Feb 21, 2017 at 11:59PM PST. This is a great way for the community to decide what they want to hear.

I have submitted a handful of sessions which I hope will be voted for. Below are some short summary's and links to their voting pages.

Avoid the storm! Tips on deploying the Enterprise Cloud
The primary driver for enterprise organizations choosing to deploy a private cloud is to enable on-demand access to the resources that the business needs to respond to market opportunities. But business agility requires availability...
Keys to Successful Data Center Modernization to Infrastructure Agility
Data center modernization and consolidation is the continuous optimization and enhancement of existing data center infrastructure, enabling better support for mission-critical and Mode 1 applications. The companion Key Initiative, "Infrastructure Agility" focuses on Mode 2...
Best Practices with Cloud Native Microservices on OpenStack
It doesn't matter where your at with your implementation of Microservices, but you do need to understand some key fundamentals when it comes to designing and properly deploying on OpenStack. If your just starting out then you will need to learn some key things such as the common characteristics, monolithic vs  microservice, componetization, decentralized governance, to name a few. In this session you'll learn some of these basics and where to start...
Thanks for your support.

Wednesday, January 4, 2017

VMware Workstation 12.5.2 patch for Linux Kernel 4.9

I've rounded up the working patches from the public posts and created my own patch files. You can use my updated VMware module compile script to patch it as well. It also does a bit of cleanup. Grab the script and the patch files from here. Once downloaded then make sure they are all in the same directory and you have made the script executable. Follow the rest of the steps below.

1) Directory should look like this:
# ls -al mkvm* *.patch
-rwxr-xr-x 1 cseader users 2965 Jan  4 21:11        
-rwxr-xr-x 1 cseader users 1457 Sep 26 15:47
-rw-r--r-- 1 cseader users  650 Jan  4 19:16 vmmon-hostif.patch        
-rw-r--r-- 1 cseader users  650 Jan  4 21:21 vmnet-userif.patch
2) Execute with sudo or login as root

# ./                                                
It will immediately start the cleanup and then extracting the VMware source. If the patch files are in the same Directory as it looks like above then it will patch the source for compiling against Kernel 4.9

3) Now Start VMware Workstation.