# Getting more information about the gpu and libraries loaded



## AbsoluteZero (Jun 15, 2021)

This will be my first post here on these forums, I'm excited to take part in FreeBSD in any way I can. For now I am still learning, previously as an Arch Linux user information about specific issues was more abundant. Now that I've made the switch to FreeBSD entirely,  searching for specific information on a given topic is a greater challenge. This is not a criticism, I enjoy doing this, just something that I've observed. Of course I am always ready to learn from the BSD's communities. 

*So here is what I'm trying to do*: I'm trying to get more information to double-check if I am actually using hardware acceleration on applications like Firefox. Previously I just used glxinfo on a linux system but I can't seem to find the same utility to do the same. In the past I've had problems with OpenGL not being used therefore experiencing slow performance. I'm kind of getting the same feeling as I'm using FreeBSD currently, so to troubleshoot I'd like to know if OpenGL is being used, and therefore Hardware Accel. 

What i'm experiencing right now: O.K. Performance, videos in firefox seem to stutter but not tear (I've fixed tearing in Nvidia-settings), window clients struggle to move on the screen smoothly.

Hardware:
Nvidia GeForce GTX 1080ti
Latest Driver "460"


What i've already done:
1. Installed FreeBSD 13
2. Installed Xorg, Nvidia-driver, Nvidia-settings(tweaked it)

Also if I need to share dmesg's output, how would I do this within the forums "thread poster"?
Ok many thanks to all of your help.


----------



## T-Daemon (Jun 16, 2021)

AbsoluteZero said:


> I'm trying to get more information to double-check if I am actually using hardware acceleration on applications like Firefox. Previously I just used glxinfo on a linux system but I can't seem to find the same utility to do the same.


You can find missing programs, if available as port (package) for FreeBSD, mostly searching on https://freshports.org/search.php. Programs can be found searching by it's name or, if it's not listed as the ports name, or is included as a secondary program into a port (package), by searching the ports pkg-plist. There are more options available to fine grain the search.

If the default, 'Port Name', gives no useful results, search the pkg-plist. pkg-plist is a description file most ports have, listing all files which are going to be installed on system by the port.

In case of glxinfo searching pkg-plists shows different ports including it. The first hit, graphics/glx-utils, seems to be appropriate, or if there is the need of more testing tools besides glxinfo, graphics/mesa-demos (click on 'Expand this list ...' beneath *pkg-plist:* to see list).

If you have a ports tree on system those pkg-plists can also be searched (find(1) and  grep)(1)) , but the disadvantage is it takes to long.



AbsoluteZero said:


> What i'm experiencing right now: O.K. Performance, videos in firefox seem to stutter but not tear (I've fixed tearing in Nvidia-settings), window clients struggle to move on the screen smoothly.
> ...
> Also if I need to share dmesg's output, how would I do this within the forums "thread poster"?


Better let's have a look at /var/log/Xorg.0.log than to dmesg(8). Choose from the editors icon menu the three dots on the right side of the picture icon, then </> for code. If the text is very long, as it is in case of Xorg.0.log, send it to a pastebin storage site. Most useful is, without installing third party programs, nc(1) from base:

`cat /var/log/Xorg.0.log | nc termbin.com 9999`

Only the pastebin solution has the disadvantage to be present for a limited time.


----------



## AbsoluteZero (Jun 16, 2021)

Great tip on using freshports.org I had looked at it in the past just wasn't aware of the pkg-plists, very useful for novices. here are the contents of Xorg.0.log, also decided to just post the output for 
posterity:

btw, I installed the package with glxinfo but I didn't really find anything indicated that something had gone wrong from its output.

About mid way down I noticed this:
Not sure if this may be my problem...

```
[     7.794] (II) Initializing extension GLX
[     7.794] (II) Initializing extension GLX
Indirect GLX disabled.
[     7.794] (II) GLX: Another vendor is already registered for screen 0
[     7.794] (II) Initializing extension XFree86-VidModeExtension
[     7.795] (II) Initializing extension XFree86-DGA
[     7.795] (II) Initializing extension XFree86-DRI
[     7.796] (II) Initializing extension DRI2
[     7.796] (II) Initializing extension NV-GLX
[     7.796] (II) Initializing extension NV-CONTROL
[     7.797] (II) Initializing extension XINERAMA
```
Another possibility is that things are actually working fine and I'm too sensitive to the overall smoothness of the environment.


```
[     6.788]
X.Org X Server 1.20.11
X Protocol Version 11, Revision 0
[     6.788] Build Operating System: FreeBSD 13.0-RELEASE-p2 amd64
[     6.788] Current Operating System: FreeBSD M5-053 13.0-RELEASE-p1 FreeBSD 13.0-RELEASE-p1 #0: Wed May 26 22:15:09 UTC 2021     root@amd64-builder.daemonology.net:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64
[     6.788] Build Date: 03 June 2021  07:17:57AM
[     6.788]
[     6.788] Current version of pixman: 0.40.0
[     6.788]     Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
[     6.788] Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[     6.788] (==) Log file: "/var/log/Xorg.0.log", Time: Wed Jun 16 12:39:24 2021
[     6.790] (==) Using config directory: "/usr/local/etc/X11/xorg.conf.d"
[     6.790] (==) Using system config directory "/usr/local/share/X11/xorg.conf.d"
[     6.790] (==) ServerLayout "Default Layout"
[     6.790] (**) |-->Screen "Screen0" (0)
[     6.790] (**) |   |-->Monitor "Monitor0"
[     6.791] (**) |   |-->Device "Device0"
[     6.791] (**) |-->Input Device "Keyboard0"
[     6.791] (**) |-->Input Device "Mouse0"
[     6.791] (**) Option "Xinerama" "0"
[     6.791] (==) Automatically adding devices
[     6.791] (==) Automatically enabling devices
[     6.791] (==) Not automatically adding GPU devices
[     6.791] (==) Max clients allowed: 256, resource mask: 0x1fffff
[     6.794] (==) 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
[     6.794] (==) ModulePath set to "/usr/local/lib/xorg/modules"
[     6.794] (WW) Hotplugging is on, devices using drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.
[     6.794] (WW) Disabling Keyboard0
[     6.794] (WW) Disabling Mouse0
[     6.794] (II) Loader magic: 0x4359f0
[     6.794] (II) Module ABI versions:
[     6.794]     X.Org ANSI C Emulation: 0.4
[     6.794]     X.Org Video Driver: 24.1
[     6.794]     X.Org XInput driver : 24.1
[     6.794]     X.Org Server Extension : 10.0
[     6.795] (--) PCI:*(1@0:0:0) 10de:1b06:19da:5471 rev 161, Mem @ 0xde000000/16777216, 0xc0000000/268435456, 0xd0000000/33554432, I/O @ 0x0000e000/128, BIOS @ 0x????????/65536
[     6.795] (II) LoadModule: "glx"
[     6.795] (II) Loading /usr/local/lib/xorg/modules/extensions/libglx.so
[     6.805] (II) Module glx: vendor="X.Org Foundation"
[     6.805]     compiled for 1.20.11, module version = 1.0.0
[     6.805]     ABI class: X.Org Server Extension, version 10.0
[     6.806] (II) LoadModule: "nvidia"
[     6.806] (II) Loading /usr/local/lib/xorg/modules/drivers/nvidia_drv.so
[     6.810] (II) Module nvidia: vendor="NVIDIA Corporation"
[     6.810]     compiled for 1.6.99.901, module version = 1.0.0
[     6.810]     Module class: X.Org Video Driver
[     6.811] (II) NVIDIA dlloader X Driver  460.67  Thu Mar 11 00:05:52 UTC 2021
[     6.811] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
[     6.811] (--) Using syscons driver with X support (version 2.0)
[     6.811] (++) using VT number 9

[     6.812] (II) Loading sub module "fb"
[     6.812] (II) LoadModule: "fb"
[     6.813] (II) Loading /usr/local/lib/xorg/modules/libfb.so
[     6.813] (II) Module fb: vendor="X.Org Foundation"
[     6.813]     compiled for 1.20.11, module version = 1.0.0
[     6.813]     ABI class: X.Org ANSI C Emulation, version 0.4
[     6.813] (II) Loading sub module "wfb"
[     6.814] (II) LoadModule: "wfb"
[     6.814] (II) Loading /usr/local/lib/xorg/modules/libwfb.so
[     6.815] (II) Module wfb: vendor="X.Org Foundation"
[     6.815]     compiled for 1.20.11, module version = 1.0.0
[     6.815]     ABI class: X.Org ANSI C Emulation, version 0.4
[     6.815] (II) Loading sub module "ramdac"
[     6.815] (II) LoadModule: "ramdac"
[     6.815] (II) Module "ramdac" already built-in
[     6.816] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
[     6.816] (**) NVIDIA(0): Depth 24, (--) framebuffer bpp 32
[     6.816] (==) NVIDIA(0): RGB weight 888
[     6.816] (==) NVIDIA(0): Default visual is TrueColor
[     6.816] (==) NVIDIA(0): Using gamma correction (1.0, 1.0, 1.0)
[     6.817] (**) NVIDIA(0): Option "Stereo" "0"
[     6.817] (**) NVIDIA(0): Option "nvidiaXineramaInfoOrder" "DFP-2"
[     6.817] (**) NVIDIA(0): Option "SLI" "Off"
[     6.817] (**) NVIDIA(0): Option "MultiGPU" "Off"
[     6.817] (**) NVIDIA(0): Option "BaseMosaic" "off"
[     6.818] (**) NVIDIA(0): Stereo disabled by request
[     6.818] (**) NVIDIA(0): NVIDIA SLI disabled.
[     6.818] (**) NVIDIA(0): NVIDIA Multi-GPU disabled.
[     6.818] (**) NVIDIA(0): Option "MetaModes" "nvidia-auto-select +0+0 {ForceCompositionPipeline=On}"
[     6.818] (**) NVIDIA(0): Enabling 2D acceleration
[     6.818] (II) Loading sub module "glxserver_nvidia"
[     6.818] (II) LoadModule: "glxserver_nvidia"
[     6.818] (II) Loading /usr/local/lib/xorg/modules/extensions/libglxserver_nvidia.so
[     6.903] (II) Module glxserver_nvidia: vendor="NVIDIA Corporation"
[     6.903]     compiled for 1.6.99.901, module version = 1.0.0
[     6.903]     Module class: X.Org Server Extension
[     6.903] (II) NVIDIA GLX Module  460.67  Thu Mar 11 00:03:14 UTC 2021
[     6.904] (II) NVIDIA: The X server supports PRIME Render Offload.
[     7.620] (--) NVIDIA(0): Valid display device(s) on GPU-0 at PCI:1:0:0
[     7.620] (--) NVIDIA(0):     DFP-0
[     7.620] (--) NVIDIA(0):     DFP-1
[     7.620] (--) NVIDIA(0):     DFP-2 (boot)
[     7.620] (--) NVIDIA(0):     DFP-3
[     7.620] (--) NVIDIA(0):     DFP-4
[     7.620] (--) NVIDIA(0):     DFP-5
[     7.620] (--) NVIDIA(0):     DFP-6
[     7.620] (--) NVIDIA(0):     DFP-7
[     7.621] (II) NVIDIA(0): NVIDIA GPU GeForce GTX 1080 Ti (GP102-A) at PCI:1:0:0 (GPU-0)
[     7.621] (--) NVIDIA(0): Memory: 11534336 kBytes
[     7.621] (--) NVIDIA(0): VideoBIOS: 86.02.39.40.36
[     7.621] (II) NVIDIA(0): Detected PCI Express Link width: 16X
[     7.622] (--) NVIDIA(GPU-0): DFP-0: disconnected
[     7.622] (--) NVIDIA(GPU-0): DFP-0: Internal TMDS
[     7.622] (--) NVIDIA(GPU-0): DFP-0: 330.0 MHz maximum pixel clock
[     7.622] (--) NVIDIA(GPU-0):
[     7.623] (--) NVIDIA(GPU-0): DFP-1: disconnected
[     7.623] (--) NVIDIA(GPU-0): DFP-1: Internal TMDS
[     7.623] (--) NVIDIA(GPU-0): DFP-1: 165.0 MHz maximum pixel clock
[     7.623] (--) NVIDIA(GPU-0):
[     7.624] (--) NVIDIA(GPU-0): Ancor Communications Inc MX27AQ (DFP-2): connected
[     7.624] (--) NVIDIA(GPU-0): Ancor Communications Inc MX27AQ (DFP-2): Internal DisplayPort
[     7.624] (--) NVIDIA(GPU-0): Ancor Communications Inc MX27AQ (DFP-2): 1440.0 MHz maximum pixel clock
[     7.624] (--) NVIDIA(GPU-0):
[     7.627] (--) NVIDIA(GPU-0): DFP-3: disconnected
[     7.627] (--) NVIDIA(GPU-0): DFP-3: Internal TMDS
[     7.627] (--) NVIDIA(GPU-0): DFP-3: 165.0 MHz maximum pixel clock
[     7.627] (--) NVIDIA(GPU-0):
[     7.627] (--) NVIDIA(GPU-0): DFP-4: disconnected
[     7.627] (--) NVIDIA(GPU-0): DFP-4: Internal DisplayPort
[     7.627] (--) NVIDIA(GPU-0): DFP-4: 1440.0 MHz maximum pixel clock
[     7.627] (--) NVIDIA(GPU-0):
[     7.628] (--) NVIDIA(GPU-0): DFP-5: disconnected
[     7.628] (--) NVIDIA(GPU-0): DFP-5: Internal TMDS
[     7.628] (--) NVIDIA(GPU-0): DFP-5: 165.0 MHz maximum pixel clock
[     7.628] (--) NVIDIA(GPU-0):
[     7.628] (--) NVIDIA(GPU-0): DFP-6: disconnected
[     7.628] (--) NVIDIA(GPU-0): DFP-6: Internal DisplayPort
[     7.628] (--) NVIDIA(GPU-0): DFP-6: 1440.0 MHz maximum pixel clock
[     7.628] (--) NVIDIA(GPU-0):
[     7.629] (--) NVIDIA(GPU-0): DFP-7: disconnected
[     7.629] (--) NVIDIA(GPU-0): DFP-7: Internal TMDS
[     7.629] (--) NVIDIA(GPU-0): DFP-7: 165.0 MHz maximum pixel clock
[     7.629] (--) NVIDIA(GPU-0):
[     7.637] (II) NVIDIA(0): Validated MetaModes:
[     7.637] (II) NVIDIA(0):     "nvidia-auto-select+0+0{ForceCompositionPipeline=On}"
[     7.637] (II) NVIDIA(0): Virtual screen size determined to be 2560 x 1440
[     7.643] (--) NVIDIA(0): DPI set to (108, 107); computed from "UseEdidDpi" X config
[     7.643] (--) NVIDIA(0):     option
[     7.644] (II) NVIDIA: Reserving 24576.00 MB of virtual memory for indirect memory
[     7.644] (II) NVIDIA:     access.
[     7.665] (II) NVIDIA(0): Setting mode "nvidia-auto-select+0+0{ForceCompositionPipeline=On}"
[     7.780] (==) NVIDIA(0): Disabling shared memory pixmaps
[     7.780] (==) NVIDIA(0): Backing store enabled
[     7.780] (==) NVIDIA(0): Silken mouse enabled
[     7.781] (==) NVIDIA(0): DPMS enabled
[     7.782] (II) Loading sub module "dri2"
[     7.782] (II) LoadModule: "dri2"
[     7.782] (II) Module "dri2" already built-in
[     7.782] (II) NVIDIA(0): [DRI2] Setup complete
[     7.782] (II) NVIDIA(0): [DRI2]   VDPAU driver: nvidia
[     7.782] (II) Initializing extension Generic Event Extension
[     7.783] (II) Initializing extension SHAPE
[     7.784] (II) Initializing extension MIT-SHM
[     7.784] (II) Initializing extension XInputExtension
[     7.785] (II) Initializing extension XTEST
[     7.785] (II) Initializing extension BIG-REQUESTS
[     7.786] (II) Initializing extension SYNC
[     7.786] (II) Initializing extension XKEYBOARD
[     7.787] (II) Initializing extension XC-MISC
[     7.787] (II) Initializing extension SECURITY
[     7.788] (II) Initializing extension XFIXES
[     7.788] (II) Initializing extension RENDER
[     7.789] (II) Initializing extension RANDR
[     7.790] (II) Initializing extension COMPOSITE
[     7.790] (II) Initializing extension DAMAGE
[     7.791] (II) Initializing extension MIT-SCREEN-SAVER
[     7.791] (II) Initializing extension DOUBLE-BUFFER
[     7.792] (II) Initializing extension RECORD
[     7.792] (II) Initializing extension DPMS
[     7.792] (II) Initializing extension Present
[     7.793] (II) Initializing extension DRI3
[     7.793] (II) Initializing extension X-Resource
[     7.793] (II) Initializing extension XVideo
[     7.794] (II) Initializing extension XVideo-MotionCompensation
[     7.794] (II) Initializing extension GLX
[     7.794] (II) Initializing extension GLX
[     7.794] (II) Indirect GLX disabled.
[     7.794] (II) GLX: Another vendor is already registered for screen 0
[     7.794] (II) Initializing extension XFree86-VidModeExtension
[     7.795] (II) Initializing extension XFree86-DGA
[     7.795] (II) Initializing extension XFree86-DRI
[     7.796] (II) Initializing extension DRI2
[     7.796] (II) Initializing extension NV-GLX
[     7.796] (II) Initializing extension NV-CONTROL
[     7.797] (II) Initializing extension XINERAMA
## REMOVED some things to keep the post short
[     7.948] (--) NVIDIA(GPU-0):
[     7.948] (II) config/udev: removing device Logitech USB Receiver
[     7.948] (II) event8  - Logitech USB Receiver, class 0/0, rev 2.00/24.11, addr 4: device removed
[     7.948] (II) UnloadModule: "libinput"
[     7.948] (II) config/udev: Adding input device Logitech USB Receiver (/dev/input/event8)
[     7.948] (**) Logitech USB Receiver: Applying InputClass "libinput pointer catchall"
[     7.948] (II) Using input driver 'libinput' for 'Logitech USB Receiver'
[     7.948] (**) Logitech USB Receiver: always reports core events
[     7.948] (**) Option "Device" "/dev/input/event8"
[     7.948] (**) Option "_source" "server/udev"
[     7.948] (II) event8  - Logitech USB Receiver, class 0/0, rev 2.00/24.11, addr 4: is tagged by udev as: Mouse
[     7.948] (II) event8  - Logitech USB Receiver, class 0/0, rev 2.00/24.11, addr 4: device is a pointer
[     7.948] (II) event8  - Logitech USB Receiver, class 0/0, rev 2.00/24.11, addr 4: device removed
[     7.948] (**) Option "config_info" "udev:/dev/input/event8"
[     7.948] (II) XINPUT: Adding extended input device "Logitech USB Receiver" (type: MOUSE, id 14)
[     7.948] (**) Option "AccelerationScheme" "none"
[     7.948] (**) Logitech USB Receiver: (accel) selected scheme none/0
[     7.948] (**) Logitech USB Receiver: (accel) acceleration factor: 2.000
[     7.948] (**) Logitech USB Receiver: (accel) acceleration threshold: 4
[     7.949] (II) event8  - Logitech USB Receiver, class 0/0, rev 2.00/24.11, addr 4: is tagged by udev as: Mouse
[     7.949] (II) event8  - Logitech USB Receiver, class 0/0, rev 2.00/24.11, addr 4: device is a pointer
```


----------



## Deleted member 30996 (Jun 16, 2021)

AbsoluteZero said:


> [ 7.794] (II) GLX: Another vendor is already registered for screen 0


Have you installed x11/nvidia-xconfig and ran `# nvidia-xconfig`?

There were new commits yesterday for x11/nvidia-settings, Nvidia Secondary Drivers and one for Hybrid Graphics with Optimus Technology Support:






						FreeBSD Ports Search
					






					www.freebsd.org


----------



## astyle (Jun 16, 2021)

T-Daemon said:


> Only the pastebin solution has the disadvantage to be present for a limited time.


use this forum feature to show your code: 




Or better yet, hide it in a spoiler.

Back to the topic: OP is probably looking for something like nvtop... this should compile on FreeBSD, but proceed at your own risk - it may or may not work.


----------



## AbsoluteZero (Jun 17, 2021)

Trihexagonal said:


> Have you installed x11/nvidia-xconfig and ran `# nvidia-xconfig`?
> 
> There were new commits yesterday for x11/nvidia-settings, Nvidia Secondary Drivers and one for Hybrid Graphics with Optimus Technology Support:
> 
> ...



Hmmm... I gave that a shot and it looks like it wrote a file to /etc/X11/xorg.conf
Interestingly I followed the instructions from the handbook and instead wrote my setup in "/usr/local/share/X11/xorg.conf.d/ " previously.  I also have this in /etc/rc.conf


```
# Load Nvidia
linux_load="YES"
kld_list="nvidia-modeset nvidia"
```

(Thanks astyle)

So just to be clear. Here is my reasoning. I have a 1080ti GPU, a pretty good video card, at least for being able to run windows and Firefox. Yet It runs less than optimal. This could be because I'm expecting it to run like in Windows 10. The symptoms are again: Slow firefox performance when running many tabs (~6-8), Videos stutter, webpages with many elements, especially video ads will run noticeably slugglishly. However as a whole it is quite useable,  It's just not optimal. I will probably consider this matter addressed if I can't find the cause soon.  Also I will look into nvtop, looks interesting. 

Its important to note that I've never had good experience with Nvidia GPUs in a unix-like OS. So it would be informative to know others experiences with Nvidia hardware and Linux or better yet FreeBSD.


----------



## sko (Jun 17, 2021)

AbsoluteZero said:


> Slow firefox performance when running many tabs (~6-8), Videos stutter, webpages with many elements, especially video ads will run noticeably slugglishly.


Except for video acceleration (IF enabled in the firefox settings) nothing of that has to do with the graphics acceleration, especially OpenGL or any other 3D acceleration.
Firefox is degrading in performance (and overall stability and code quality) for quite a while - I can barely run it for more than 2-3 days before it gets slow, tabs start to crash or it just crashes. firefox-ESR is somewhat bearable, mainline with its almost daily updates and constant breakage is unbearable if you want/have to work with it.
Are you using KDE by any chance? That's as bloated as a desktop can get and will drag performance down even on modern systems. I haven't seen a KDE setup in recent years that felt responsive and crisp, even on high-end desktops and myself abandoned it quite some time ago and switched to Xfce.

As for the nvidia driver/module:
At least on my 12.2-RELEASE system I only specified the nvidia-modeset module, which itself also loads the nvidia module. Because you specified both in your kld_list, you might try to load that module twice and hence get that `GLX: Another vendor is already registered for screen 0` message.

The nvidia drivers are usually 'fire and forget' - install them, follow the (now very short and simple) steps at the end of the setup (i.e. load the module via loader.conf or rc.conf) and it 'just works'™ - regardless if you're using ports/packages or download them from nvidia (careful with those though - they are installed outside of the pkg system, so be sure to never try to install/update that driver from packages unless you've deinstalled them first via the nvidia script!)


----------



## T-Daemon (Jun 17, 2021)

astyle said:


> use this forum feature to show your code: View attachment 10201
> 
> Or better yet, hide it in a spoiler.


You missed my comment about 'Code':


T-Daemon said:


> Choose from the editors icon menu the three dots on the right side of the picture icon, then </> for code.


Also this is what my accounts Forums editor looks like:




Spoilers are not appreciated by all users, the one or other might not bother to open it.


----------



## SirDice (Jun 17, 2021)

Please read: https://forums.freebsd.org/threads/formatting-guidelines.49535/


----------



## T-Daemon (Jun 17, 2021)

AbsoluteZero said:


> About mid way down I noticed this:
> Not sure if this may be my problem...


That's not a problem, I've the same in the logs.

Xorg.0.log shows nothing noticeable.



AbsoluteZero said:


> ```
> # Load Nvidia
> linux_load="YES"
> kld_list="nvidia-modeset nvidia"
> ```


Try `kld_list="nvidia"`. `linux_enable="YES"` is needed if you are planning to run Linux graphical programs inside FreeBSD.



AbsoluteZero said:


> Its important to note that I've never had good experience with Nvidia GPUs in a unix-like OS. So it would be informative to know others experiences with Nvidia hardware and Linux or better yet FreeBSD.


I have an older GeForce GT 630, I can't speak for other NVIDIA models, but no complains here, works as expected with x11/nvidia-driver, videos in www/firefox play without stutter (30+ tabs open) and all windows move smoothly.


----------



## Deleted member 30996 (Jun 17, 2021)

AbsoluteZero said:


> Hmmm... I gave that a shot and it looks like it wrote a file to /etc/X11/xorg.conf


So what happened then? Was it just not what you thought you should be doing?

I've got 2 Thinkpad T61's running Nvidia Quadro NVS 140M and 2 Thinkpad W520 with Nvidia Quadro M. I couldn't be happier with any of them and here are recent screenshots of them all in that thread.

Here's the /etc/x11/xorg.conf for the W520 I'm using now. Notice what is says at the very top:


```
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 460.67


Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/sysmouse"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 460.67


Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 460.67


Section "ServerLayout"# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 460.67


Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/sysmouse"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Keyboard0"
    Driver         "keyboard"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection


    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/sysmouse"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Keyboard0"
    Driver         "keyboard"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 460.67


Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/sysmouse"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Keyboard0"
    Driver         "keyboard"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection


    ModelName      "Unknown"
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection


    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/sysmouse"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Keyboard0"
    Driver         "keyboard"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection
    # generated from default
    Identifier     "Keyboard0"
    Driver         "keyboard"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection
```


----------



## SirDice (Jun 17, 2021)

Trihexagonal said:


> Here's the /etc/x11/xorg.conf for the W520 I'm using now.


You can remove that. You really don't need to generate an xorg.conf any more. 

Just create a /usr/local/etc/X11/xorg.conf.d/driver-nvidia.conf:

```
Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
EndSection
```
That's all the configuration you need to do for X nowadays.


----------



## Deleted member 30996 (Jun 17, 2021)

It's not broke and running like I want it to, so I'll leave it alone for now. I have to practice what I preach to new people or I'll never get them to listen. I haven't tried the hybrid graphics driver yet either.


----------



## astyle (Jun 17, 2021)

Problems described by OP are one reason why I compile from ports, as opposed to packages. At least the system will make an effort to be snappy after a local compilation.


----------



## AbsoluteZero (Jun 17, 2021)

Ok so I am going to call this "issue" resolved, even though it wasn't technically an issue since things were working at 90% to begin with, just not 100% smoothly. This also gives me the opportunity to try out new browsers as you've said. However I'll try to give a report in case someone else has similar problems.

   nvidia-xconfig did write a new file in /etc/X11/xorg.conf however there wasn't any noticeable difference that I could see, both methods work whether you write such a file in this directory or in /usr/local/etc/X11/xorg.conf.d/driver-nvidia.conf - so all is well here.

This is what was found when I ran `glxinfo | grep render`

```
direct rendering: Yes
OpenGL renderer string: GeForce GTX 1080 Ti/PCIe/SSE2
    GL_ARB_conditional_render_inverted, GL_ARB_conservative_depth,
    GL_NVX_conditional_render, GL_NVX_gpu_memory_info, GL_NVX_nvenc_interop,
    GL_NV_command_list, GL_NV_compute_program5, GL_NV_conditional_render,
    GL_NV_path_rendering, GL_NV_path_rendering_shared_edge,
    GL_NV_stereo_view_rendering, GL_NV_texgen_reflection,
    GL_ARB_compute_variable_group_size, GL_ARB_conditional_render_inverted,
    GL_NVX_conditional_render, GL_NVX_gpu_memory_info, GL_NVX_nvenc_interop,
    GL_NV_command_list, GL_NV_compute_program5, GL_NV_conditional_render,
    GL_NV_path_rendering, GL_NV_path_rendering_shared_edge,
    GL_NV_stereo_view_rendering, GL_NV_texgen_reflection,
    GL_EXT_multisample_compatibility, GL_EXT_multisampled_render_to_texture,
    GL_EXT_multisampled_render_to_texture2,
    GL_EXT_raster_multisample, GL_EXT_render_snorm, GL_EXT_robustness,
    GL_NV_clip_space_w_scaling, GL_NV_conditional_render,
    GL_NV_path_rendering, GL_NV_path_rendering_shared_edge,
    GL_NV_shadow_samplers_cube, GL_NV_stereo_view_rendering,
    GL_OES_fbo_render_mipmap, GL_OES_geometry_point_size,
    GL_OVR_multiview_multisampled_render_to_texture
```

Again everything looks fine, OpenGL seems to be working. And as others stated it may not be the actual reason why Firefox is not as smooth as can be.
Also I did change some settings in Firefox in `about:config` This didn't remove the stutters, but at least I'm using Webrender.

T-Daemon that's interesting that you have different results with the GT 630, this tells me that I'm doing something wrong somewhere in the setup (very likely). But since things are working good enough its not a big deal, I'm mainly using this as a main development computer HTML/CSS JavaScript Python etc. So it's not totally crucial to be at 100% performance.
Another thing I am using is the Dynamic Window Manager for windows and that's about it. So the system is pretty lightweight.

Also I have had the same issue on Linux before but curiously I was able to fix it by removing lightdm, apparently this package was using the "nouveau" drivers which are open source drivers for Nvidia GPU's. It was doing this without me knowing, and as a result were not allowing the nvidia drivers to load after I logged into my session. Removing it loaded the Nvidia drivers from the start, problem solved, everything smooth. I have lightdm installed now but as I understand it nvidia drivers are in fact loaded in my system.

The ultimate solution for me is to switch over to AMD graphics  though because of the chip shortage this will be easier said than done.


----------



## astyle (Jun 17, 2021)

AbsoluteZero said:


> The ultimate solution for me is to switch over to AMD graphics  though because of the chip shortage this will be easier said than done.


AMD does keep things simple on config end of things, under FreeBSD, and is reasonably reliable, but hardware performance can be all over the place.


----------



## sko (Jun 18, 2021)

Since we have what was previously called drm-next, the intel i915kms drivers are by far the easiest to set up and much more feature-complete than nvidia or amd. E.g. nvidia still lacking CUDA and everything that depends on it, like NVENC which is needed for video transcoding.


----------



## shkhln (Jun 18, 2021)

sko said:


> much more feature-complete


Not really.


sko said:


> E.g. nvidia still lacking CUDA and everything that depends on it


How exactly this is the point for Intel?


----------



## shkhln (Jun 18, 2021)

Anyway, judging by stutter complaints, OP likely has a Ryzen machine.


----------



## sko (Jun 18, 2021)

shkhln said:


> How exactly this is the point for Intel?



Intel QuickSync for transcoding works out of the box with the i915kms drivers - and you basically get that "for free" with every desktop CPU...

I haven't looked at ATI/AMD graphics for quite a long time since ATI open sourced their drivers for anything but windows (where their drivers also were a minefield) and left them to die. Back then they open sourced a crippled and barely working driver and just went "well, there it is, now you can do your own drivers, we're out...". Their Hardware was always quite promising back in the ATI days, but drivers were a nightmare, especially for BSD and even Linux. This went on for 10+ years, so I just started to ignore them even after the acquisition by AMD. I'm still mostly on the Intel side for most hardware, just because they put a lot of effort and manpower in their drivers and everything usually "just works".


----------



## astyle (Jun 18, 2021)

sko said:


> Since we have what was previously called drm-next, the intel i915kms drivers are by far the easiest to set up and much more feature-complete than nvidia or amd. E.g. nvidia still lacking CUDA and everything that depends on it, like NVENC which is needed for video transcoding.


This whole thing is not accurate, but I'm too busy figuring out how to run OpenCL kernels on my Asus Radeon RX 550 4GB  card under FreeBSD to do the homework and dig up the links to put in the effort to correct that post. And I may be missing my boat already: At Blender's Cycles X announcement, the Deprecation section, they say they're moving away from OpenCL...

FWIW, nvenc is a lib that gets compiled if you try to compile multimedia/handbrake with all options enabled.


----------



## shkhln (Jun 20, 2021)

astyle said:


> FWIW, nvenc is a lib that gets compiled if you try to compile multimedia/handbrake with all options enabled.


That's not correct.


----------



## BawdyAnarchist (Jul 22, 2021)

sko said:


> careful with those though - they are installed outside of the pkg system, so be sure to never try to install/update that driver from packages unless you've deinstalled them first via the nvidia script!


 
I'm not really understanding this. Do I need to be doing something other than `pkg upgrade` when updating nvidia-driver? I installed from packages originally. What's the problem there?


----------



## BawdyAnarchist (Jul 22, 2021)

shkhln said:


> Anyway, judging by stutter complaints, OP likely has a Ryzen machine.



Interesting. I have a (relatively) new shiny Threadripper with an Nvidia GPU that has constant stuttering issues on YT, both Firefox and Falkon. 

Are you saying this is a CPU issue? Is there anything I can do about that? Because I was scratching my head over this like OP, and just assumed that it probably had something to do with the unlocked functionality of the Nvidia.


----------



## sko (Jul 22, 2021)

BawdyAnarchist said:


> I'm not really understanding this. Do I need to be doing something other than `pkg upgrade` when updating nvidia-driver? I installed from packages originally. What's the problem there?


If you installed the nvidia-driver package then yes, you can update it via pkg. If you build them from ports, you should update them that way, and if you installed some (beta) driver directly downloaded from nvidia you are on your own!


----------



## astyle (Jul 22, 2021)

BawdyAnarchist said:


> Interesting. I have a (relatively) new shiny Threadripper with an Nvidia GPU that has constant stuttering issues on YT, both Firefox and Falkon.
> 
> Are you saying this is a CPU issue? Is there anything I can do about that? Because I was scratching my head over this like OP, and just assumed that it probably had something to do with the unlocked functionality of the Nvidia.


I don't think that CPU is the issue... I have an all-AMD setup (Ryzen 5 1400 for CPU, RX 550 4 GB for GPU) that I build myself back in 2017,  and had no stutteting issues on YT.

 (Not that I specifically went to check for that, but with plenty of embedded YT vids all over the Internet, some of 'em actually useful in the moment, it was an unavoidable, in-your-face fly-by, and I had no issues at all with loading or stuttering in Konqueror that I compiled from ports with everything enabled). 

I guess compiling multimedia/ffmpeg with EVERYTHING enabled (even for deps of deps of deps of deps) proved useful. Pre-compiled packages (the ones that get installed with `# pkg install` tend to be compiled with minimal options. When proper codecs are not installed (or compiled without usable options), video playback suffers, and even a good GPU will be unable to compensate for that.


----------



## BawdyAnarchist (Jul 23, 2021)

astyle said:


> I don't think that CPU is the issue... I have an all-AMD setup (Ryzen 5 1400 for CPU, RX 550 4 GB for GPU) that I build myself back in 2017,  and had no stutteting issues on YT.
> 
> (Not that I specifically went to check for that, but with plenty of embedded YT vids all over the Internet, some of 'em actually useful in the moment, it was an unavoidable, in-your-face fly-by, and I had no issues at all with loading or stuttering in Konqueror that I compiled from ports with everything enabled).
> 
> I guess compiling multimedia/ffmpeg with EVERYTHING enabled (even for deps of deps of deps of deps) proved useful. Pre-compiled packages (the ones that get installed with `# pkg install` tend to be compiled with minimal options. When proper codecs are not installed (or compiled without usable options), video playback suffers, and even a good GPU will be unable to compensate for that.


Are you sure? It might be a slight mistake to assume that just because your particular setup isn't having problems, that others aren't either. I have quite a different Ryzen than you (3960x), along with a different generation of motherboard, and an Nvidia GPU.


----------



## astyle (Jul 23, 2021)

BawdyAnarchist said:


> Are you sure? It might be a slight mistake to assume that just because your particular setup isn't having problems, that others aren't either. I have quite a different Ryzen than you (3960x), along with a different generation of motherboard, and an Nvidia GPU.


To be honest, I'm surprised that newer (and way more expensive) stuff is having issues. I would blame the stuttering issue on lack of proper codecs and drivers, rather than hardware design. Back in my days with a Celeron (ca. 2000), I had to install CCCP(Combined Community Codec Pack) to play some weird formats. Before installation, Windows Media Player did try to play the vids, but stuttered. After installing CCCP - stuttering did go away on the same hardware.

I think it would take a dud unit of hardware to have stuttering problems that are unsolvable with a simple codec/driver reinstall/recompile. I'm having a hard time buying the idea that I just lucked out on hardware.


----------



## BawdyAnarchist (Jul 23, 2021)

astyle said:


> To be honest, I'm surprised that newer (and way more expensive) stuff is having issues. I would blame the stuttering issue on lack of proper codecs and drivers, rather than hardware design. Back in my days with a Celeron (ca. 2000), I had to install CCCP(Combined Community Codec Pack) to play some weird formats. Before installation, Windows Media Player did try to play the vids, but stuttered. After installing CCCP - stuttering did go away on the same hardware.
> 
> I think it would take a dud unit of hardware to have stuttering problems that are unsolvable with a simple codec/driver reinstall/recompile. I'm having a hard time buying the idea that I just lucked out on hardware.


It probably is related to drivers, but that kinda comes as a package deal with these hardware components. Lord knows I'm not competent to write/fix a driver.


----------



## Styrsven (Jul 23, 2021)

I have a ryzen 3900x with a AMD RX5600 card, and I found this link just a few days ago:
https://lists.freebsd.org/pipermail/freebsd-current/2021-March/079237.html
So I set `sysctl kern.sched.steal_thresh=1` and the stuttering disappeared.
It may be worth a try.


----------



## astyle (Jul 23, 2021)

BawdyAnarchist said:


> It probably is related to drivers, but that kinda comes as a package deal with these hardware components. Lord knows I'm not competent to write/fix a driver.


I don't write/fix drivers, that's beyond my abilities, too. I just look on Internet for up-to-date versions to download and try... And I try out other software-based fixes like the one just above.


----------



## BawdyAnarchist (Jul 24, 2021)

Styrsven said:


> I have a ryzen 3900x with a AMD RX5600 card, and I found this link just a few days ago:
> https://lists.freebsd.org/pipermail/freebsd-current/2021-March/079237.html
> So I set `sysctl kern.sched.steal_thresh=1` and the stuttering disappeared.
> It may be worth a try.


Great find. That fixed it right away. Thanks for sharing.


----------

