nvidia and GeForce 3060 on FreeBSD 14.4 - not a happy experience

In my continuing adventures (see here and here) to get my workstation working at an acceptable level with FreeBSD 14.x, I took out the Sapphire Radeon R7 240 4G DDR3 graphics card, an put in a MSI GeForce RTX 3060 Ventus 2X 12G OC instead.
It shows up like this in pciconf -lv output
Code:
vgapci0@pci0:7:0:0: class=0x030000 rev=0xa1 hdr=0x00 vendor=0x10de device=0x2504 subvendor=0x1462 subdevice=0x397d
    vendor     = 'NVIDIA Corporation'
    device     = 'GA106 [GeForce RTX 3060 Lite Hash Rate]'
    class      = display
    subclass   = VGA
before replacing the graphics card I had installed the necessary nvidia packages, from /var/log/messages
Code:
Aug  5 19:27:08 kg-core2 pkg[55814]: egl-wayland-1.1.21 installed
Aug  5 19:27:08 kg-core2 pkg[55814]: egl-wayland2-1.0.1 installed
Aug  5 19:27:08 kg-core2 pkg[55814]: egl-x11-1.0.5 installed
Aug  5 19:27:09 kg-core2 pkg[55814]: nvidia-kmod-595.84.1404000 installed
Aug  5 19:27:10 kg-core2 pkg[55814]: nvidia-driver-595.84 installed
Aug  5 19:27:10 kg-core2 pkg[55814]: nvidia-drm-61-kmod-595.84.1404000_1 installed
and configured kld_list like this
Code:
root@kg-core2:~ # sysrc kld_list
kld_list: nvidia-modeset nvidia-drm
and added this to /boot/loader.conf:
Code:
root@kg-core2:~ # cat /boot/loader.conf
hw.nvidiadrm.modeset=1
Upon boot, the console is garbled / unreadable, so I have to login blind, and type startxfce4 --with-ck-launch blind. I can live with that.
Once Xorg has started, glxinfo reports
Code:
tingo@kg-core2:~ $ glxinfo -B
name of display: :0.0
display: :0  screen: 0
direct rendering: Yes
Memory info (GL_NVX_gpu_memory_info):
    Dedicated video memory: 12288 MB
    Total available memory: 12288 MB
    Currently available dedicated video memory: 464 MB
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: NVIDIA GeForce RTX 3060/PCIe/SSE2
OpenGL core profile version string: 4.6.0 NVIDIA 595.84
OpenGL core profile shading language version string: 4.60 NVIDIA
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 4.6.0 NVIDIA 595.84
OpenGL shading language version string: 4.60 NVIDIA
OpenGL context flags: (none)
OpenGL profile mask: (none)

OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 595.84
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

and most operations (switching windows using Alt-Tab, switching workspaces, etc) are fast enough.
However, when switching between firefox windows I experience a horrible lag. For a simple Alt-Tab it is two seconds or more, in some cases it is in the order of minutes before the new window becomes usable.

There most be something I've done wrong, it is not supposed to be like this for a relatively modern graphics card with 12G memory?
 
oh, nvidia-smi reports like this
Code:
tingo@kg-core2:~ $ nvidia-smi
Thu Aug  6 22:31:08 2026      
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 595.84                 Driver Version: 595.84         CUDA Version: N/A      |
+-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 3060        Off |   00000000:07:00.0  On |                  N/A |
| 35%   53C    P5             20W /  170W |   11492MiB /  12288MiB |     31%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI              PID   Type   Process name                        GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|  No running processes found                                                             |
+-----------------------------------------------------------------------------------------+
 
Is your monitor directly connected to your MSI GeForce RTX 3060 Ventus 2X 12G OC?
If not, possibly your iGPU could doing something harm.

And mis-match between what loader / kernel think and actual BIOS / UEFI firmware configuration could cause garbled screen. In this case, specifying different resolution that your monitor supports in /boot/loader.conf could help.

And for firefox, possibly setting both
  • browser.tabs.hoverPreview.enabled
  • browser.tabs.hoverPreview.showThumbnails
to false via about:config could help. I have these to avoid crashes / freezes caused by firefox, but if I recall correctly, switching tabs were slow before I've flipped these. Related post of mine here.
 
Monitor directly connect yes
Code:
tingo@kg-core2:~ $ xrandr
Screen 0: minimum 8 x 8, current 1920 x 1200, maximum 32767 x 32767
HDMI-0 disconnected (normal left inverted right x axis y axis)
DP-0 connected 1920x1200+0+0 (normal left inverted right x axis y axis) 518mm x 324mm
   1920x1200     59.95*+
   1920x1080     60.00    59.94    50.00  
   1680x1050     59.95  
   1600x1200     60.00  
   1440x900      59.89  
   1280x1024     75.02    60.02  
   1280x960      60.00  
   1280x800      59.81  
   1280x720      60.00    59.94    50.00  
   1152x864      75.00  
   1024x768      75.03    70.07    60.00  
   800x600       75.00    72.19    60.32    56.25  
   720x576       50.00  
   720x480       59.94  
   640x480       75.00    72.81    59.94  
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 disconnected (normal left inverted right x axis y axis)
DP-4 disconnected (normal left inverted right x axis y axis)
DP-5 disconnected (normal left inverted right x axis y axis)
IGPU - the machine doesn't have one, there is only the one graphics card.
Code:
root@kg-core2:~ # pciconf -lv | grep -A 4 vga
vgapci0@pci0:7:0:0:    class=0x030000 rev=0xa1 hdr=0x00 vendor=0x10de device=0x2504 subvendor=0x1462 subdevice=0x397d
    vendor     = 'NVIDIA Corporation'
    device     = 'GA106 [GeForce RTX 3060 Lite Hash Rate]'
    class      = display
    subclass   = VGA
firefox - nothing changed, this exact configuration (windows, tabs and all) worked before I swapped graphics cards.
 
I upgraded firefox to latest from packages (I'm on quarterly)
Code:
Aug  8 14:27:31 kg-core2 pkg[52590]: firefox upgraded: 153.0.1,2 -> 153.0.3,2
and it started like normal, all windows usable after a few minutes (I have a serious amount of windows)
Code:
root@kg-core2:~ # pgrep -lf firefox | wc -l
     158
(not sure that processes corresponds 1 - 1 to number of windows).
So maybe this "first time problem" was a fluke. We shall see.
 
As you've noted Xfce4 is working, NVIDIA drivers (nvidia-drm.ko, nvidia-modeset.ko, nvidia.ko and libraries for X11) should be working fine.
What mis-behaving should be in-base vt or sc driver.

How do you boot? UEFI? Or legacy BIOS?
And if you're booting via legacy BIOS, what sysctl -n kern.vty shows?

If you're booting from UEFI, sc driver is unrelated (UEFI without CSM doesn't have emulated text VRAMs that sc mandatorily require). And as none of NVIDIA driver kmods provide drmfb, vt should defaulted to efifb.
In this case, in near the top of dmesg, something like
Code:
VT(efifb): resolution 1920x1080
should be seen.
If your monitor dislikes the auto-detected resolution, overriding it with efi_max_resolution variable with any of the resolution lower than it and included in xrandr reported as available (in your post #5) could help.
In my case, as I have 4k screen but 4k is too high for 16x16 fonts, I have
Code:
efi_max_resolution="1920x1080"
in my /boot/loader.conf. But no worries. Once I start Mate DE on xorg, NVIDIA drivers automatically set 4k and back to 1920x1080 when switching to vty (including exiting from Mate DE), and go back to 4k on switching to vty8 with Alt+F9.

In case you're booting via legacy BIOS and using vt, try vbe_max_resolution variable instead.

If neither works, try kern.vt.fb.default_mode variable instead. This alone may need framebuffer depth, so the value to be set would be something like "1920*1080x32".

In case you're using sc, sorry, I've almost forgotton about it. Maybe somehow configure with characters per line and number of lines instead of pixel resolution.
 
Back
Top