# nvidia configuration issues



## nainsurvolte (Aug 8, 2020)

I know there is a lot of thread regarding this question and I have tried a lot of them but with no positive result. I am totally new to FreeBSD but I usually manage to get my way around with Debian type distros.

I installed FreeBSD 12.1 release version. I followed several tutorials and lead through forum posts but with no results. I would really like to get this working as I hate to use 2 PCs to work my way through (FreeBSD on one and internet on the other to search for ...).

For now, here is what I followed:
https://docs.freebsd.org/doc/7.3-RELEASE/usr/share/doc/en/articles/compiz-fusion/nvidia-setup.html

And got some hint from here:
https://forums.freebsd.org/threads/x-doesnt-start-nvidia-geforce-8600m-gt.72872/

My card is an nVidia Quadro K2000 and after looking at the nVidia web site, I know it is managed through the latest drivers.

I managed to make the nvidia drivers but was unable to do so for the nvidia-xconfig and nvidia-settings as there was a mismatch of python version somewhere. As this was too much to manage, I simplu installed the pkg ones.

I got the conf file from nvidia configure and put that file in the /usr/local/etc/x11/xorg.conf.d under nvidia-driver.conf

Here is the content of the file:

```
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 435.21
Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
    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"
    BusID          "PCI:1:0:0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
EndSection
Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection
```

Here is the content of the rc.conf


```
hostname="vault-master"
linux_enable="YES"
keymap="ca-fr.kbd"
ifconfig_re0="DHCP"
ifconfig_re0_ipv6="inet6 accept_rtadv"
sshd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
dbus_enable="YES"
kld_list="nvidia nvidia-modeset"
nvidia_name="nvidia"
nvidia_modeset_name="nvidia_modeset"
```

From that point on, I get the following error when trying startx:


```
NVRM: failed to copy vbios to system memory
NVRM: RmInitAdapter failed! (0x30:0xffff:663)
nvidia0: NVRM: rm_init_adapter() failed!
```

And finally, here is the log fil;e I get


```
[  3910.968]
X.Org X Server 1.20.8
X Protocol Version 11, Revision 0
[  3910.968] Build Operating System: FreeBSD 12.1-RELEASE-p7 amd64
[  3910.968] Current Operating System: FreeBSD vault-master 12.1-RELEASE FreeBS>
[  3910.968] Build Date: 02 August 2020  02:24:10AM
[  3910.968]
[  3910.968] Current version of pixman: 0.40.0
[  3910.968]    Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
[  3910.968] Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[  3910.968] (==) Log file: "/var/log/Xorg.0.log", Time: Sat Aug  8 14:27:07 20>
[  3910.968] (==) Using config directory: "/usr/local/etc/X11/xorg.conf.d"
[  3910.968] (==) Using system config directory "/usr/local/share/X11/xorg.conf>
[  3910.969] (==) ServerLayout "Layout0"
[  3910.969] (**) |-->Screen "Screen0" (0)
[  3910.969] (**) |   |-->Monitor "Monitor0"
[  3910.969] (**) |   |-->Device "Device0"
[  3910.969] (**) |-->Input Device "Keyboard0"
[  3910.969] (**) |-->Input Device "Mouse0"
[  3910.969] (==) Automatically adding devices
[  3910.969] (==) Automatically enabling devices
[  3910.969] (==) Not automatically adding GPU devices
[  3910.969] (==) Max clients allowed: 256, resource mask: 0x1fffff
[  3910.969] (==) 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
[  3910.969] (==) ModulePath set to "/usr/local/lib/xorg/modules"
[  3910.969] (WW) Hotplugging is on, devices using drivers 'kbd', 'mouse' or 'v>
[  3910.969] (WW) Disabling Keyboard0
[  3910.969] (WW) Disabling Mouse0
[  3910.969] (II) Loader magic: 0x42e020
[  3910.969] (II) Module ABI versions:
[  3910.969]    X.Org ANSI C Emulation: 0.4
[  3910.969]    X.Org Video Driver: 24.1
[  3910.969]    X.Org XInput driver : 24.1
[  3910.969]    X.Org Server Extension : 10.0
[  3910.969] (--) PCI:*(1@0:0:0) 10de:0ffe:103c:094c rev 161, Mem @ 0xfd000000/>
[  3910.969] (II) LoadModule: "glx"
[  3910.969] (II) Loading /usr/local/lib/xorg/modules/extensions/libglx.so
[  3910.976] (II) Module glx: vendor="X.Org Foundation"
[  3910.976]    compiled for 1.20.8, module version = 1.0.0
[  3910.976]    ABI class: X.Org Server Extension, version 10.0
[  3910.976] (II) LoadModule: "nvidia"
[  3910.976] (II) Loading /usr/local/lib/xorg/modules/drivers/nvidia_drv.so
[  3910.976] (II) Module nvidia: vendor="NVIDIA Corporation"
[  3910.976]    compiled for 4.0.2, module version = 1.0.0
[  3910.976]    Module class: X.Org Video Driver
[  3910.977] (II) NVIDIA dlloader X Driver  390.87  Tue Aug 21 15:27:50 PDT 2018
[  3910.977] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
[  3910.977] (--) Using syscons driver with X support (version 2.0)
[  3910.977] (--) using VT number 9
[  3910.977] (II) Loading sub module "fb"
[  3910.977] (II) LoadModule: "fb"
[  3910.977] (II) Loading /usr/local/lib/xorg/modules/libfb.so
[  3910.977] (II) Module fb: vendor="X.Org Foundation"
[  3910.977]    compiled for 1.20.8, module version = 1.0.0
[  3910.977]    ABI class: X.Org ANSI C Emulation, version 0.4
[  3910.977] (II) Loading sub module "wfb"
[  3910.977] (II) LoadModule: "wfb"
[  3910.977] (II) Loading /usr/local/lib/xorg/modules/libwfb.so
[  3910.977] (II) Module wfb: vendor="X.Org Foundation"
[  3910.977]    compiled for 1.20.8, module version = 1.0.0
[  3910.978]    ABI class: X.Org ANSI C Emulation, version 0.4
[  3910.978] (II) Loading sub module "ramdac"
[  3910.978] (II) LoadModule: "ramdac"
[  3910.978] (II) Module "ramdac" already built-in
[  3910.978] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
[  3910.978] (**) NVIDIA(0): Depth 24, (--) framebuffer bpp 32
[  3910.978] (==) NVIDIA(0): RGB weight 888
[  3910.978] (==) NVIDIA(0): Default visual is TrueColor
[  3910.978] (==) NVIDIA(0): Using gamma correction (1.0, 1.0, 1.0)
[  3910.978] (**) NVIDIA(0): Enabling 2D acceleration
[  3910.978] (EE) NVIDIA(0): Failed to initialize the GLX module; please check >
[  3910.978] (EE) NVIDIA(0):     log file that the GLX module has been loaded i>
[  3910.978] (EE) NVIDIA(0):     server, and that the module is the NVIDIA GLX >
[  3910.978] (EE) NVIDIA(0):     you continue to encounter problems, Please try
[  3910.978] (EE) NVIDIA(0):     reinstalling the NVIDIA driver.
[  3911.222] (EE) NVIDIA(GPU-0): Failed to initialize the NVIDIA GPU at PCI:1:0>
[  3911.222] (EE) NVIDIA(GPU-0):     check your system's kernel log for additio>
[  3911.222] (EE) NVIDIA(GPU-0):     messages and refer to Chapter 8: Common Pr>
[  3911.222] (EE) NVIDIA(GPU-0):     README for additional information.
[  3911.222] (EE) NVIDIA(GPU-0): Failed to initialize the NVIDIA graphics devic>
[  3911.222] (EE) NVIDIA(0): Failing initialization of X screen 0
[  3911.222] (II) UnloadModule: "nvidia"
[  3911.222] (II) UnloadSubModule: "wfb"
[  3911.222] (II) UnloadSubModule: "fb"
[  3911.222] (EE) Screen(s) found, but none have a usable configuration.
[  3911.222] (EE)
Fatal server error:
[  3911.222] (EE) no screens found(EE)
[  3911.222] (EE)
Please consult the The X.Org Foundation support
         at http://wiki.x.org
for help.
[  3911.222] (EE) Please also check the log file at "/var/log/Xorg.0.log" for a>
[  3911.222] (EE)
[  3911.222] (EE) Server terminated with error (1). Closing log file.
```

Other than that, I don't know what to do and where to go.

If this can point to anything, I also tried installing furyBSD and GhostBSD.

Although initial loding of the USB tumbdrive works with fury, the moment I restart, I get to a black screen and nothing more. Trying to install the drivers before installation brings the same error message

For Ghost BSD, it barely works through scfb driver if I am not mistaken. But I get minimal resolution and, as a beginner looking for great stability, I would much prefer staying on the path of the OS with much support...

Thanks for any help


----------



## SirDice (Aug 10, 2020)

nainsurvolte said:


> For now, here is what I followed:
> https://docs.freebsd.org/doc/7.3-RELEASE/usr/share/doc/en/articles/compiz-fusion/nvidia-setup.html


As can be seen from the URL that's an old version, it was valid for FreeBSD 7.3, a long time ago. 
This is the right one: https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/x-config.html

`pkg install nvidia-driver`

And note that both FuryBSD and GhostBSD are not supported here.


----------



## nainsurvolte (Aug 10, 2020)

Thanks,

I must have selected the wrong link while writing the post. I did follow the latest documentation at first.

I also do understand for Ghost and Fury BSD. My goal was mearly to show that even with BSD version that are suppose to give graphic capabilities from the start, does not seem to work.

As for the "pkg install nvidia-driver", it must have been one of the first thing hence the reason I explain that I tried the "make" avenue.


----------



## zeising@ (Aug 15, 2020)

Can you post your dmesg?  It looks like the nVidia driver (either the kernel one, or somewhere in X) is not initialized properly.

Also, remove settings from your xorg config relating to mice and keyboards, you don't need them. To be honest, I'm not sure you need any configuration at all.


----------



## scottro (Aug 15, 2020)

Sometimes when it doesn't work, using the pkg nvidia-xconfig creates a working /etc/X11/xorg.conf file.  Just install the pkg and then run, with root privilege
`nvidia-xconfig`

It will back up the existing file and create a new one.


----------



## shkhln (Aug 15, 2020)

zeising@ said:


> To be honest, I'm not sure you need any configuration at all.



The driver part is required because _nvidia_ won't be loaded automatically and the kernel driver doesn't work with _modesetting_ (they are _not_ intended to be used together).


----------

