# HP ZBook 17 G2 with NVIDIA Quadro K1100M (GK107GLM) and Intel HD Graphics 4600



## grahamperrin@ (Jul 27, 2021)

`i915kms` drives the integral display without difficulty.

What's the simplest way for me to drive a display on DisplayPort?

Eventually I'd like to try hybrid graphics but for now, all I want is to drive a second display. (I'll rarely use this computer without a dock.) 

I experimented, unsuccessfully, with some NVIDIA-related ports. I could load kernel modules etc. but there was no sign of the display being driven. The FreeBSD Handbook didn't help me to tell which software might be applicable.

Drivers are available from NVIDIA but for now, I'm ignoring them. (FreeBSD 14.0-CURRENT here.)


----------



## grahamperrin@ (Jul 27, 2021)

> Eventually I'd like to try hybrid graphics



For reference (the package message is missing from <https://www.freshports.org/x11/nvidia-hybrid-graphics/#message>): 


```
On install:
Running Xorg-nvidia-headless at startup is recommended especially on mobile
systems since leaving Nvidia GPU powered on with no Xorg may consume
significantly more power.

# sysrc nvidia_xorg_enable=YES
# service nvidia_xorg start

The Xorg instance uses separate configuration files from the defaults for Xorg:

    /usr/local/etc/X11/xorg-nvidia-headless.conf.d/

    /usr/local/etc/X11/xorg-nvidia-headless-template.conf
        Only used if xorg-nvidia-headless.conf does not exist.
    This file is passed through nvidia-xconfig, which does not preserve
    all options.

    /usr/local/etc/X11/xorg-nvidia-headless.conf
        Created by manually invoking /usr/local/bin/nvidia-headless-xconfig.
        Once created, this configuration is not passed through nvidia-xconfig.

Configuration is not normally needed for typical OpenGL acceleration usage.

A properly configured xorg-nvidia-headless.conf will allow Xorg-nvidia-headless
to be started by non-superuser if Xorg has been installed setuid.
```

The service does not run in response to `service nvidia_xorg start`, I got this /var/log/Xorg.8.log:


```
[   120.045]
X.Org X Server 1.20.11
X Protocol Version 11, Revision 0
[   120.045] Build Operating System: FreeBSD 14.0-CURRENT amd64
[   120.045] Current Operating System: FreeBSD mowa219-gjp4-freebsd-d31121-mobile 14.0-CURRENT FreeBSD 14.0-CURRENT #0 main-f4e67f18b-dirty: Fri Jul 23 23:23:04 BST 2021     root@mowa219-gjp4-freebsd-d31121-diff92312-mobile:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG amd64
[   120.046] Build Date: 22 July 2021  02:17:02AM
[   120.046] 
[   120.046] Current version of pixman: 0.40.0
[   120.046]     Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
[   120.046] Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[   120.046] (==) Log file: "/var/log/Xorg.8.log", Time: Tue Jul 27 01:44:52 2021
[   120.047] (++) Using config file: "/usr/local/etc/X11/xorg-nvidia-headless.conf"
[   120.047] (EE) Unable to locate/open config directory: "xorg-nvidia-headless.conf.d"
[   120.047] (==) Using system config directory "/usr/local/share/X11/xorg.conf.d"
[   120.047] (==) ServerLayout "nvidia"
[   120.047] (**) |-->Screen "Screen0" (0)
[   120.047] (**) |   |-->Monitor "Monitor0"
[   120.048] (**) |   |-->Device "Device0"
[   120.048] (**) |-->Input Device "fake"
[   120.048] (**) Option "AutoAddDevices" "false"
[   120.048] (**) Not automatically adding devices
[   120.048] (==) Automatically enabling devices
[   120.048] (==) Not automatically adding GPU devices
[   120.049] (==) Max clients allowed: 256, resource mask: 0x1fffff
[   120.049] (==) FontPath set to:
    /usr/local/share/fonts/misc/,
    /usr/local/share/fonts/TTF/,
    /usr/local/share/fonts/OTF/,
    /usr/local/share/fonts/Type1/,
    /usr/local/share/fonts/100dpi/,
    /usr/local/share/fonts/75dpi/,
    catalogue:/usr/local/etc/X11/fontpath.d
[   120.049] (**) ModulePath set to "/usr/local/lib/xorg/modules-NVIDIA,/usr/local/lib/xorg/modules"
[   120.049] (II) Loader magic: 0x434270
[   120.049] (II) Module ABI versions:
[   120.049]     X.Org ANSI C Emulation: 0.4
[   120.049]     X.Org Video Driver: 24.1
[   120.049]     X.Org XInput driver : 24.1
[   120.049]     X.Org Server Extension : 10.0
[   120.049] (!!) More than one possible primary device found
[   120.049] (--) PCI: (0@0:2:0) 8086:0416:103c:2255 rev 6, Mem @ 0xce400000/4194304, 0xa0000000/268435456, I/O @ 0x00006000/64, BIOS @ 0x????????/65536
[   120.049] (--) PCI: (1@0:0:0) 10de:0ff6:103c:2255 rev 161, Mem @ 0xcd000000/16777216, 0x50000000/268435456, 0x60000000/33554432, I/O @ 0x00005000/128, BIOS @ 0x????????/65536
[   120.050] (WW) "efifb" will not be loaded unless you've specified it to be loaded elsewhere.
[   120.050] (II) "glx" will be loaded. This was enabled by default and also specified in the config file.
[   120.050] (II) LoadModule: "dri3"
[   120.050] (II) Module "dri3" already built-in
[   120.050] (II) LoadModule: "glx"
[   120.050] (II) Loading /usr/local/lib/xorg/modules/extensions/libglx.so
[   120.053] (II) Module glx: vendor="X.Org Foundation"
[   120.053]     compiled for 1.20.11, module version = 1.0.0
[   120.053]     ABI class: X.Org Server Extension, version 10.0
[   120.053] (II) LoadModule: "nvidia"
[   120.053] (II) Loading /usr/local/lib/xorg/modules/drivers/nvidia_drv.so
[   120.053] (II) Module nvidia: vendor="NVIDIA Corporation"
[   120.054]     compiled for 1.6.99.901, module version = 1.0.0
[   120.054]     Module class: X.Org Video Driver
[   120.054] (II) NVIDIA dlloader X Driver  460.84  Wed May 26 20:00:39 UTC 2021
[   120.054] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
[   120.054] (--) Using syscons driver with X support (version 2.0)
[   120.054] (++) using VT number 2

[   120.054] (EE) No devices detected.
[   120.054] (EE)
Fatal server error:
[   120.054] (EE) no screens found(EE)
[   120.054] (EE)
Please consult the The X.Org Foundation support
     at http://wiki.x.org
 for help.
[   120.054] (EE) Please also check the log file at "/var/log/Xorg.8.log" for additional information.
[   120.054] (EE)
[   120.055] (EE) Server terminated with error (1). Closing log file.
```


----------



## grahamperrin@ (Jul 27, 2021)

grahamperrin said:


> … for now, all I want is to drive a second display. …



Success:

hybrid graphics _disabled_ in BIOS
/usr/local/etc/X11/xorg-nvidia-headless.conf removed
/etc/X11/xorg.conf generated by nvidia-xconfig(1).


```
% uclcmd get --file /boot/loader.conf nvidia-modeset_load
"YES"
% sysrc -f /etc/rc.conf kld_list
kld_list: fusefs usbhid nvidia
% pkg info -x nvidia
linux-nvidia-libs-460.84
nvidia-driver-460.84
nvidia-settings-470.42.01
nvidia-texture-tools-2.0.8.1_24
nvidia-xconfig-470.42.01
% uname -KUv
FreeBSD 14.0-CURRENT #102 main-n248139-3a57f08b504: Thu Jul 22 05:30:35 BST 2021     root@mowa219-gjp4-8570p:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG  1400026 1400026
%
```

<https://bsd-hardware.info/?probe=c7fb9e9dee>



> … Eventually I'd like to try hybrid graphics …



No rush.


----------



## astyle (Jul 27, 2021)

grahamperrin : Do a Google search on mux switch. On most laptops with discrete GPU's, the dGPU is usually off unless you're playing a graphics-intensive game. I did some research for myself (with different objectives in mind). This may be of interest for you, because of the NVidia GPU: https://en.wikipedia.org/wiki/Nvidia_Optimus.

Sometimes, you get a physical mux switch on the laptop's body, sometimes you have to get into the BIOS to force the switch. Sometimes, a laptop will detect a DP cable, and switch to the dGPU automatically. notebookcheck.net is a good resource. 

Basically - don't neglect the hardware manuals.


----------



## grahamperrin@ (Jul 27, 2021)

grahamperrin said:


> ```
> % uclcmd get --file /boot/loader.conf nvidia-modeset_load
> "YES"
> % sysrc -f /etc/rc.conf kld_list
> ...



Better: 


```
% uclcmd get --file /boot/loader.conf nvidia-modeset_load
"NO"
% sysrc -f /etc/rc.conf kld_list
kld_list: fusefs usbhid nvidia-modeset
% kldstat | grep -e drm -e nv
20    1 0xffffffff836ae000   10c310 nvidia-modeset.ko
21    1 0xffffffff83800000  1e8a5a8 nvidia.ko
%
```

Also: 


```
% pkg info -x drm-devel-kmod
drm-devel-kmod-5.5.19.g20210709
%
```



astyle said:


> BIOS



Three settings for hybrid graphics:

enable
disable
auto
– plus this, which I can disable: 

☑ Hybrid Graphics Enhanced Display Feature


----------



## grahamperrin@ (Jul 27, 2021)

Whoa. I think BT's online store needs a wee update …


----------



## astyle (Jul 27, 2021)

Whoa, that's nearly $8500 USD! Seriously, you can get a brand-new Z laptop with a Xeon for about a third of the price...


----------



## grahamperrin@ (Jul 28, 2021)

FreeBSD Handbook

<https://docs.freebsd.org/en/books/handbook/x11/#x-config-video-cards-nvidia> confused me because it refers to an NVIDIA page that's dated 2013. Taking the next logical link, <https://download.nvidia.com/XFree86/FreeBSD-x86_64/465.19.01/README/supportedchips.html> is undated and does not list the K1100M, however at the head of the page:



> For the most complete and accurate listing of supported GPUs, please see the Supported Products List, available from the NVIDIA FreeBSD x86_64 Graphics Driver download page. Please go to http://www.nvidia.com/object/unix.html, follow the Archive link under the FreeBSD x86_64 heading, follow the link for the 465.19.01 driver, and then go to the Supported Products List. …



– then (for _FreeBSD x64_):



> Latest Production Branch Version: 470.57.02
> Latest New Feature Branch Version: 465.31



– neither of which lists support for the K1100M.

Elsewhere

What's a legacy driver? | NVIDIA (undated) does not list the K1100M, from which a person might assume that this hardware is supported by the _regular NVIDIA Unified UNIX Graphics Driver_. Maybe false; see above and below.

<https://www.nvidia.co.uk/Download/index.aspx?lang=en-uk> leads to inferior versions:

production 418.113 (2019.11.5)
new feature branch 415.27 (2019.1.15)
– both of which *do* list support for the K1100M.

Ported


```
% pkg search -r FreeBSD nvidia-driver | sort
pkg: Repository poudriere missing. 'pkg update' required
nvidia-driver-304-304.137_9    NVidia graphics card binary drivers for hardware OpenGL rendering
nvidia-driver-340-340.108_3    NVidia graphics card binary drivers for hardware OpenGL rendering
nvidia-driver-390-390.143_1    NVidia graphics card binary drivers for hardware OpenGL rendering
nvidia-driver-460.84           NVidia graphics card binary drivers for hardware OpenGL rendering
%
```

<https://www.freshports.org/x11/nvidia-driver/#history> currently at 460.84.

<https://www.nvidia.com/Download/driverResults.aspx/175877/en-us> for 460.84 (2021.6.3) does *not* list support for the K1100M.

Context

The initial wake from sleep was mostly successful, with one exception:

for windows that were open before sleep, title bars lacked colour.
All subsequent attempts failed; no image, no response to keyboard input, it was necessary to force off the computer.

(Side note: around this time I also replaced the packaged emulators/virtualbox-ose-kmod with a build from ports.)

Given the lack of clarity about support for the K1100M, I might experiment with one of the legacy versions of the driver, beginning with x11/nvidia-driver-390 …


----------



## grahamperrin@ (Aug 5, 2021)

grahamperrin said:


> … Given the lack of clarity about support for the K1100M, I might experiment with one of the legacy versions of the driver, beginning with x11/nvidia-driver-390 …



x11/nvidia-driver-390 390.144 seemed no better, no worse than x11/nvidia-driver 460.84. 

<https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=257456#c13> clarified: 



> … use x11/nvidia-driver. K1100M is a Kepler series, and 470 is the last driver release to support those.








						Kepler (microarchitecture) - Wikipedia
					






					en.wikipedia.org


----------



## grahamperrin@ (Aug 5, 2021)

grahamperrin said:


> Eventually I'd like to try hybrid graphics



No longer planned. 

I'll not keep this notebook. 

Failure to wake from sleep is a show-stopper.


----------



## Deleted member 30996 (Aug 5, 2021)

I have 2 W520's with a Nvidia Quadro 1000M and two T61 with Quadro NVS 140M running Nvidia drivers.

I used the x11/nvidia-driver-304 and have used the x11/nvidia-driver-340 on ths same box when the 304 wouldn't act like it should.

You're not appearing imposing enough for it to stop resisting, give in and submit to your will. A beard might work.


----------



## astyle (Aug 5, 2021)

Trihexagonal said:


> A beard might work.


Shaved mine just to be able to wear a mask at all. But IMHO, you just need to be a BOFH and show those machines who's the boss. Then even a Daemon will say uncle and obey.


----------



## Deleted member 30996 (Aug 6, 2021)

Do not try and bend the spoon. That's impossible. Instead... only try to realize the truth.

That's a plastic spoon you're holding.


----------



## astyle (Aug 6, 2021)

Trihexagonal said:


> Do not try and bend the spoon. That's impossible. Instead... only try to realize the truth.
> 
> That's a plastic spoon you're holding.


My fingers are strong enough to bend one. I think I busted 3 or 4 of them - and no, that was not plastic or spoon handles. Granted, they were cheap and crappy.


----------



## Deleted member 30996 (Aug 6, 2021)

I remember when Uri Geller was in the news for doing that. And seeing him try on TV, get frustrated and walk off set. 

Now, Ingo Swan, there was a someone to inspire young impressional minds. And who doesn't want to penetrate someones brain with their mysterious powers of the mind. Or learn how to in 3 easy lessons?

I sure do! And so would you!  

I would pass that arcane knowledge down to you right here, right now, but the .pdf is awesome in mind boggling Title alone let alone content subject matter within for the average mind to comprehend and the .pdf too large for the server to process.

I will upload it and PM you a link to the question asked in dark corners by hushed voices from time immemorial only Ingo Sawn, and I, hear your every thought to asnswer:

Penetration

The Question of Extraterrestrial and Human Telepathy
By Ingo Swan

Now brace yourself for gut wrenching terror and Runaway Monster Truck sized Madness, for I am about to expose the World to the insanity of the index page. Parents make sure Children leave the room. You have been warned!


----------



## grahamperrin@ (Aug 6, 2021)

Window borders appear too large, not all of what appears to be the border _is_ a border:





As if, maybe, what should be a faint drop shadow is wrongly opaque.

The true size of window borders is seen only in window-specific screenshots, for example:



Is this peculiarity with KWin seen only with NVIDIA graphics?

Postscript

It seems that nvidia-xconfig(1) writes `"UseEdidDpi" "FALSE"` to the `Screen` section but not the `Device` section of /etc/X11/xorg.conf.

After manually adding the line to the `Device` section, no problem (with SDDM): 


```
% grep -A 15 Section\ \"Screen /etc/X11/xorg.conf
Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-4"
    Option         "metamodes" "DP-3: nvidia-auto-select +1920+90, DP-4: nvidia-auto-select +0+0"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    Option         "UseEdidDpi" "FALSE"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection
% grep -A 6 Section\ \"Device /etc/X11/xorg.conf
Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "Quadro K1100M"
    Option         "UseEdidDpi" "FALSE"
EndSection
%
```

Without SDDM: `startx` fails to start X but honestly, I don't want to waste my time with X-related problems.


----------



## grahamperrin@ (Oct 30, 2021)

grahamperrin said:


> Failure to wake from sleep is a show-stopper.



Today I stumbled across this, from around four months before I encountered the failures:

Experiments with suspend/resume (amd64; nvidia-driver)

Postscript (2021-11-28)

FreeBSD bug 253733 – vesa.ko: Invalid BIOS call when resuming from S3 suspend/sleep causes nvidia driver hang via <https://forums.freebsd.org/posts/504284> thanks Snurg


----------

