# How to set-up Nvidia graphics card on FreeBSD 11.1?



## usernamekiran (Nov 27, 2017)

Hello.<br />I am aware this has been asked numerous times before, but the two methods that I tried failed. I had to clean-up after both methods.

I have an Alienware 13 R-2 laptop, with 16GB RAM, and "NVIDIA GeForce GTX 960M". I have been using the OS for a while now (without the drivers), with XFCE.

First of all, after a going through many posts/discussions I went with the method as explained in "HOWTO: Setup Xorg with NVIDIA's driver". After installation, on rebooting I was getting an error regarding X system (unfortunately I cant recall it exactly now). After logging in, I couldnt start XFCE by startx, or by startxfce4. I deleted `/usr/local/etc/X11/xorg.conf.d` directory along with its content (`/usr/local/etc/X11/xorg.conf.d/driver-nvidia.conf`
I deleted everything that I had installed, (`pkg delete`, then `pkg autoremove`, and then `pkg clean -a`.​Then I went with the handbook method, and removed everything again. (unfortunately I cant recall the error this time).

How should I set-up the graphics card? I am willing to try both these methods again if you need to know the exact errors.

Thanks a lot in advance,
usernamekiran.


----------



## SirDice (Nov 27, 2017)

Setting up the NVidia card has nothing to do with XFCE not starting. Use the HOWTO you used initially. Make sure X works with it (default stuff). Then look at why XFCE isn't working for you. Treat this as two separate issues and fix Xorg first. It's no use trying XFCE if Xorg isn't working.


----------



## Snurg (Nov 27, 2017)

As I am setting up a new system, too, I did the install steps described here.
xorg does not supply a xorg.conf file anymore.
As I am a obvious jerk, xorg refuses to work without xorg.conf on my computers.
So I copied the one from the old system and adapted it slightly:

```
Section "ServerFlags"
Option "DontZap" "false"
EndSection

Section "InputClass"
Identifier "Keyboard Defaults"
MatchIsKeyboard "yes"
Option "XKbOptions" "terminate:ctrl_alt_bksp"
EndSection

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

Section "Files"
# FontPath "/usr/local/share/fonts/Droid/"
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"
HorizSync 28.0 - 33.0
VertRefresh 43.0 - 72.0
# 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
Modes "1920x1200"
EndSubSection
EndSection
```
Make sure that the resolution given modeline at the end of the screen section is correct for your computer's display.
If that works, try out if DPMS works by enabling that option. (needed for screen blanking)
If necessary, add your extra font paths.

If this makes xorg start up using `startx`, you are fine and only need to set your preferable WM respective DM (i.e. `startxfce`). 
HTH.


----------



## usernamekiran (Nov 27, 2017)

SirDice said:


> Setting up the NVidia card has nothing to do with XFCE not starting. Use the HOWTO you used initially. Make sure X works with it (default stuff). Then look at why XFCE isn't working for you. Treat this as two separate issues and fix Xorg first. It's no use trying XFCE if Xorg isn't working.



I did what handbook said. There was no /etc/X11/xorg.conf so i created it with using `vi`, and added `Driver      "nvidia"` (with two tabs in between). Upon rebooting, everything went as usual ("firewalls rules laoded" etc), logged in as normal user (i do not use login manager).

Upon entring startx, and startxfce4; I got the same error:

```
Markers: (--) probed, (**) from config file, (==) default setting,
[INDENT](++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[/INDENT]
(==) Log file: "/var/log/Xorg/0/log", Time: Tue Nov 28 00:26:27 2017
(==) Using config file: "/etc/X11/xorg.conf"
Parse error on line 1 of section (null) in file /etc/X11/xorg.conf
[INDENT]Driver is not a valid keyword in this section.[/INDENT]
(EE)
Fatal server error:
(EE) no screens found(EE)
(EE) Please also chack the log file at "/var/log/Xorg.0.log" for additional information
(EE)
(EE) Server terminated with error (1). Closing log file.
xinit: giving up
xinit: unable to connect X server: Connection refused
xinit: server error
usernamekiran@<hostname>:~ %
```


----------



## Snurg (Nov 27, 2017)

The Driver line alone is no complete Device section, and you need also the Screens section, as DPMS often does seem not to retrieve the screen data correctly (this why I deactivate for testing), and so xorg server cannot self-configure the screen. Just try copypaste the sample xorg.conf I posted, possibly changing the modeline to your lappy's resolution.


----------



## usernamekiran (Nov 27, 2017)

I copy-pasted content from snurg's xorg.conf to my file (exluding files/font section), still the same error.


----------



## usernamekiran (Nov 27, 2017)

Snurg said:


> The Driver line alone is no complete Device section, and you need also the Screens section, as DPMS often does seem not to retrieve the screen data correctly (this why I deactivate for testing), and so xorg server cannot self-configure the screen. Just try copypaste the sample xorg.conf I posted, possibly changing the modeline to your lappy's resolution.



Also, my /boot/loader.conf contains only one line: `nvidia_load="YES"`.


----------



## Snurg (Nov 27, 2017)

Ah yes I forgot /boot/loader.conf again although I had it in my hands a few hours ago myself...

```
linux_enable="YES"

# nvidia_load="YES"
# use if above fails:
nvidia-modeset_load="YES"
```
Didn't check whether I need actually `linux_enable`, as I have to look into the driver Makefile for that.
`nvidia_load` alone didn't work for me, produced the same results like you experience.
As the nvidia driver built, it posted some message about that problem, suggesting to use `nvidia-modeset_load` in that case instead of `nvidia_load`. Which worked fine for me.

And then, if startx fires up the old twm, then you'll need to change .xinitrc to xfwhatever 
HTH.


----------



## usernamekiran (Nov 27, 2017)

Snurg said:


> Ah yes I forgot /boot/loader.conf again although I had it in my hands a few hours ago myself...
> 
> ```
> linux_enable="YES"
> ...



Hi. That gave me error "no screens found". Do you think my screen designation could be different? How do I check that?


----------



## Snurg (Nov 27, 2017)

Did you change the xorg.conf line `Modes "1920x1200"` (for my WUXGA monitor) to `Modes "1920x1080"` (FHD, if this is your display's native resolution)?


----------



## usernamekiran (Nov 27, 2017)

Snurg said:


> Did you change the xorg.conf line `Modes "1920x1200"` (for my WUXGA monitor) to `Modes "1920x1080"` (FHD, if this is your display's native resolution)?


in the first go, yes.


----------



## Snurg (Nov 27, 2017)

The built-in monitor maybe is somewhat different than common standalone monitors. DPMS might help then.
In the monitor section, commenting the sync options and uncommenting DPMS might help.

```
# HorizSync 28.0 - 33.0
# VertRefresh 43.0 - 72.0
Option "DPMS"
```

And, are you sure your laptop has actually FHD?  Many laptops are sold in a number of different resolutions, with only top models having FHD.


----------



## usernamekiran (Nov 27, 2017)

Snurg said:


> The built-in monitor maybe is somewhat different than common standalone monitors. DPMS might help then.
> In the monitor section, commenting the sync options and uncommenting DPMS might help.
> 
> ```
> ...


The updated section should look like this, right?

```
Section "Monitor"
Identifier "Monitor0"
VendorName "Unknown"
ModelName "Unknown"
HorizSync 28.0 - 33.0
VertRefresh 43.0 - 72.0
# Option "DPMS"
# HorizSync 28.0 - 33.0
# VertRefresh 43.0 - 72.0
Option "DPMS"
EndSection
```


----------



## Deleted member 30996 (Nov 27, 2017)

I have a Nvidia box and in the beginning stages of setting up one just like it now.

In /boot/loader.conf on mine I have:

```
linux_load="YES"
nvidia_load="YES"
nvidia-modeset_load="YES"
```
It's my /etc/rc.conf file where I use:

```
linux_enable="YES"
```


----------



## usernamekiran (Nov 27, 2017)

I was getting bored, and already annoyed. so I ran `# pkg install x11/nvidia-driver` out of curiosity. It gave me following output:

```
Updating FreeBSD repository catalogue...
Fetching meta.txz: 100%    944 B   0.9kB/s    00:01   
Fetching packagesite.txz: 100%    6 MiB 608.4kB/s    00:10   
Processing entries: 100%
FreeBSD repository update completed. 26865 packages processed.
All repositories are up to date.
Updating database digests format: 100%
pkg: gstreamer1-plugins-lame has a missing dependency: lame
The following 1 package(s) will be affected (of 0 checked):

Installed packages to be UPGRADED:
   nvidia-driver: 375.66 -> 384.59

Number of packages to be upgraded: 1

The process will require 11 MiB more space.
37 MiB to be downloaded.

Proceed with this action? [y/N]: y
[1/1] Fetching nvidia-driver-384.59.txz: 100%   37 MiB 666.0kB/s    00:59   
Checking integrity... done (0 conflicting)
[1/1] Upgrading nvidia-driver from 375.66 to 384.59...
Extracting nvidia-driver-384.59: 100%
ELF binary type "3" not known.
/bin/sh: /compat/linux/sbin/ldconfig: Exec format error
Message from nvidia-driver-384.59:
To use these drivers, make sure that you have loaded the NVidia kernel
module, by doing

   # kldload nvidia   (or nvidia-modeset, see below)

or adding

   nvidia_load="YES"   (or nvidia-modeset_load="YES", see below)

to /boot/loader.conf, or putting ``nvidia'' (or ``nvidia-modeset'', see
below again) on ``kld_list'' variable in /etc/rc.conf.

If you build this port with FreeBSD AGP GART driver, make sure you have
agp.ko kernel module installed and loaded, since nvidia.ko will depend
on it, or have your kernel compiled with "device agp".  Otherwise, the
NVidia kernel module will not load.  Also, please set correct value for
``Option "NvAGP"'' in ``Device'' section of your X11 configuration file.

When building with Linux compatibility support, make sure that linux.ko
module is available as well (or have it compiled in kernel).  It can be
loaded via /boot/loader.conf, or later in the boot process if you add

   linux_enable="YES"

to your /etc/rc.conf.

If X.org cannot start and reports

   (EE) NVIDIA(0): Failed to obtain a shared memory identifier.

in /var/log/Xorg.0.log while actually you have ``options SYSVSHM''
enabled in kernel, the sysctl ``kern.ipc.shmall'' should be increased.

Starting with version 358.09, some important functionality of the driver
has been broken out into a separate kernel module, nvidia-modeset.ko.
Users that experience hangs when starting X11 server, or observe

   (II) NVIDIA(0): Validated MetaModes:
   (II) NVIDIA(0):     "NULL"

in /var/log/Xorg.0.log should replace ``nvidia'' with ``nvidia-modeset''
in their /boot/loader.conf or /etc/rc.conf configuration files, depending
on how they prefer to load NVidia driver kernel module.

See /usr/local/share/doc/NVIDIA_GLX-1.0/README for more information.
```

Whats interesting is, /var/log/Xorg.0.log doesnt exist on my system.


----------



## usernamekiran (Nov 27, 2017)

Trihexagonal said:


> I have a Nvidia box and in the beginning stages of setting up one just like it now.
> 
> In /boot/loader.conf on mine I have:
> 
> ...


Tried your way, still the same problem.


----------



## Snurg (Nov 27, 2017)

I meant disabling the Horiz and Vert options, and instead use DPMS.

For more detailed troubleshooting info, can you please add this
`Option "ModeDebug" "True"`
to xorg.conf and post the output you get when trying to start X?


----------



## Deleted member 30996 (Nov 27, 2017)

Did you install and run x11/nvidia-xconfig and x11/nvidia-settings?


----------



## usernamekiran (Nov 27, 2017)

Snurg said:


> I meant disabling the Horiz and Vert options, and instead use DPMS.
> 
> For more detailed troubleshooting info, can you please add this
> `Option "ModeDebug" "True"`
> to xorg.conf and post the output you get when trying to start X?


It says "option" is not valid keyword in this section. 
(I had inserted the line at the bottom of the file).


----------



## usernamekiran (Nov 27, 2017)

Trihexagonal said:


> Did you install and run x11/nvidia-xconfig and x11/nvidia-settings?



I did, after seeing your comment. When I ran nvidia-xconfig, it created the xorg.conf file. When I ran nvidia-settings, it told me to reboot the X server. I rebooted it, same error; rebooted entire system, same frigging error.


----------



## SirDice (Nov 28, 2017)

Remove every trace of xorg.conf. You really don't need it and you don't need to create it. Then create /usr/local/etc/X11/xorg.conf.d/driver-nvidia.conf

```
Section "Device"
        Identifier  "Card0"
        Driver      "nvidia"
        #BusID       "PCI:2:0:0"
EndSection
```

And in /boot/loader.conf:

```
nvidia-modeset_load="YES"
```

The Linux module is NOT required for the driver to work. It's only needed if you need to have accelerated graphics on Linux applications.


----------



## usernamekiran (Nov 28, 2017)

SirDice said:


> Remove every trace of xorg.conf. You really don't need it and you don't need to create it. Then create /usr/local/etc/X11/xorg.conf.d/driver-nvidia.conf
> 
> ```
> Section "Device"
> ...



Still the same error.


----------



## SirDice (Nov 28, 2017)

What's the error? Post your /var/log/Xorg.0.log to Pastebin, or a similar service, and provide the link here.


----------



## usernamekiran (Nov 28, 2017)

SirDice said:


> What's the error? Post your /var/log/Xorg.0.log to Pastebin, or a similar service, and provide the link here.



Here it is:
https://pastebin.com/xaHrMfqP
I am not sure about it though. I mean, I deleted the xorg.conf.d directory, and the driver-nvidia.conf file. Do you think this might have changed the entries in the log?


----------



## tobik@ (Nov 28, 2017)

usernamekiran said:


> Here it is:
> https://pastebin.com/xaHrMfqP
> I am not sure about it though. I mean, I deleted the xorg.conf.d directory, and the driver-nvidia.conf file. Do you think this might have changed the entries in the log?


Yes, of course.  You got an error with SirDice's configuration and if we want to determine why then the configuration needs to stay unchanged.


----------



## Snurg (Nov 28, 2017)

The log shows you can use the vesa driver. The nvidia driver fails to load the glx part for some reason, so I'd just make a line Driver "Vesa" in the appropriate device section to have X running and then look what's wrong with nvidia.
But as I already said, I seem apparently incompetent to get X running without xorg.conf on many hardware combinations, so I am looking forward to SirDice's suggestions, too.


----------



## usernamekiran (Nov 28, 2017)

tobik@ said:


> Yes, of course.  You got an error with SirDice's configuration and if we want to determine why then the configuration needs to stay unchanged.


erm... what am I supposed to now?


----------



## tobik@ (Nov 28, 2017)

usernamekiran said:


> erm... what am I supposed to now?


Restore the configuration from comment #21 and try to `startx` again. Then post the new /var/log/Xorg.0.log.


----------



## usernamekiran (Nov 28, 2017)

tobik@ said:


> Restore the configuration from comment #21 and try to `startx` again. Then post the new /var/log/Xorg.0.log.


but how would I be able to post it, if I cant run startx?


----------



## tobik@ (Nov 28, 2017)

usernamekiran said:


> but how would I be able to post it, if I cant run startx?


There are many ways. The easiest is to install misc/pastebinit and then `pastebinit /var/log/Xorg.0.log`. It'll upload the log file and then print a URL that you can post here.


----------



## SirDice (Nov 29, 2017)

usernamekiran said:


> I mean, I deleted the xorg.conf.d directory, and the driver-nvidia.conf file.


That's not what I said, remove /usr/local/etc/X11/xorg.conf or /etc/X11/xorg.conf and _create_ the /usr/local/etc/X11/xorg.conf.d/driver-nvidia.conf file as I showed above. Then run `startx` and if that fails post the Xorg.0.log. The last log shows X starts properly but is using the vesa(4) driver.


----------



## usernamekiran (Nov 29, 2017)

SirDice said:


> That's not what I said, remove /usr/local/etc/X11/xorg.conf or /etc/X11/xorg.conf and _create_ the /usr/local/etc/X11/xorg.conf.d/driver-nvidia.conf file as I showed above. Then run `startx` and if that fails post the Xorg.0.log. The last log shows X starts properly but is using the vesa(4) driver.



This is the log per your request: https://pastebin.com/2y1nc8hX
I hope you guys can identify the problem now.


----------



## SirDice (Nov 29, 2017)

Ok, good. Now it's loading the correct driver:

```
[   280.983] (II) Loading /usr/local/lib/xorg/modules/drivers/nvidia_drv.so
[   281.045] (II) Module nvidia: vendor="NVIDIA Corporation"
[   281.045] 	compiled for 4.0.2, module version = 1.0.0
[   281.045] 	Module class: X.Org Video Driver
```
But....

```
[   281.077] (EE) No devices detected.
[   281.077] (EE) Fatal server error:
[   281.077] (EE) no screens found(EE)
```
Are you sure this machine actually has an NVidia card? Because the logs are telling me there's no NVidia card to be found. Can you post the output of `pciconf -lf`?


----------



## usernamekiran (Nov 29, 2017)

SirDice said:


> Are you sure this machine actually has an NVidia card? Because the logs are telling me there's no NVidia card to be found. Can you post the output of `pciconf -lf`?



`pciconf -l` gave me following output:

```
hostb0@pci0:0:0:0:   class=0x060000 card=0x07071028 chip=0x19048086 rev=0x08 hdr=0x00
vgapci0@pci0:0:2:0:   class=0x030000 card=0x07071028 chip=0x19168086 rev=0x07 hdr=0x00
none0@pci0:0:4:0:   class=0x118000 card=0x07071028 chip=0x19038086 rev=0x08 hdr=0x00
xhci0@pci0:0:20:0:   class=0x0c0330 card=0x07071028 chip=0x9d2f8086 rev=0x21 hdr=0x00
none1@pci0:0:20:2:   class=0x118000 card=0x07071028 chip=0x9d318086 rev=0x21 hdr=0x00
none2@pci0:0:21:0:   class=0x118000 card=0x07071028 chip=0x9d608086 rev=0x21 hdr=0x00
none3@pci0:0:21:1:   class=0x118000 card=0x07071028 chip=0x9d618086 rev=0x21 hdr=0x00
none4@pci0:0:22:0:   class=0x078000 card=0x07071028 chip=0x9d3a8086 rev=0x21 hdr=0x00
ahci0@pci0:0:23:0:   class=0x010400 card=0x07071028 chip=0x282a8086 rev=0x21 hdr=0x00
pcib1@pci0:0:28:0:   class=0x060400 card=0x07071028 chip=0x9d108086 rev=0xf1 hdr=0x01
pcib2@pci0:0:28:6:   class=0x060400 card=0x07071028 chip=0x9d168086 rev=0xf1 hdr=0x01
pcib3@pci0:0:28:7:   class=0x060400 card=0x07071028 chip=0x9d178086 rev=0xf1 hdr=0x01
pcib4@pci0:0:29:0:   class=0x060400 card=0x07071028 chip=0x9d1a8086 rev=0xf1 hdr=0x01
isab0@pci0:0:31:0:   class=0x060100 card=0x07071028 chip=0x9d488086 rev=0x21 hdr=0x00
none5@pci0:0:31:2:   class=0x058000 card=0x07071028 chip=0x9d218086 rev=0x21 hdr=0x00
hdac0@pci0:0:31:3:   class=0x040300 card=0x07071028 chip=0x9d708086 rev=0x21 hdr=0x00
none6@pci0:0:31:4:   class=0x0c0500 card=0x07071028 chip=0x9d238086 rev=0x21 hdr=0x00
vgapci1@pci0:1:0:0:   class=0x030200 card=0x07071028 chip=0x139b10de rev=0xa2 hdr=0x00
alc0@pci0:2:0:0:   class=0x020000 card=0x10280707 chip=0xe0a11969 rev=0x10 hdr=0x00
none7@pci0:3:0:0:   class=0x028000 card=0x15351a56 chip=0x003e168c rev=0x32 hdr=0x00
```


----------



## SirDice (Nov 29, 2017)

Oops, I meant to say `pciconf -l[b]v[/b]`


----------



## usernamekiran (Nov 29, 2017)

SirDice said:


> Oops, I meant to say `pciconf -l[B]v[/B]`




```
hostb0@pci0:0:0:0:   class=0x060000 card=0x07071028 chip=0x19048086 rev=0x08 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers'
    class      = bridge
    subclass   = HOST-PCI
vgapci0@pci0:0:2:0:   class=0x030000 card=0x07071028 chip=0x19168086 rev=0x07 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'HD Graphics 520'
    class      = display
    subclass   = VGA
none0@pci0:0:4:0:   class=0x118000 card=0x07071028 chip=0x19038086 rev=0x08 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem'
    class      = dasp
xhci0@pci0:0:20:0:   class=0x0c0330 card=0x07071028 chip=0x9d2f8086 rev=0x21 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Sunrise Point-LP USB 3.0 xHCI Controller'
    class      = serial bus
    subclass   = USB
none1@pci0:0:20:2:   class=0x118000 card=0x07071028 chip=0x9d318086 rev=0x21 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Sunrise Point-LP Thermal subsystem'
    class      = dasp
none2@pci0:0:21:0:   class=0x118000 card=0x07071028 chip=0x9d608086 rev=0x21 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Sunrise Point-LP Serial IO I2C Controller'
    class      = dasp
none3@pci0:0:21:1:   class=0x118000 card=0x07071028 chip=0x9d618086 rev=0x21 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Sunrise Point-LP Serial IO I2C Controller'
    class      = dasp
none4@pci0:0:22:0:   class=0x078000 card=0x07071028 chip=0x9d3a8086 rev=0x21 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Sunrise Point-LP CSME HECI'
    class      = simple comms
ahci0@pci0:0:23:0:   class=0x010400 card=0x07071028 chip=0x282a8086 rev=0x21 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '82801 Mobile SATA Controller [RAID mode]'
    class      = mass storage
    subclass   = RAID
pcib1@pci0:0:28:0:   class=0x060400 card=0x07071028 chip=0x9d108086 rev=0xf1 hdr=0x01
    vendor     = 'Intel Corporation'
    device     = 'Sunrise Point-LP PCI Express Root Port'
    class      = bridge
    subclass   = PCI-PCI
pcib2@pci0:0:28:6:   class=0x060400 card=0x07071028 chip=0x9d168086 rev=0xf1 hdr=0x01
    vendor     = 'Intel Corporation'
    device     = 'Sunrise Point-LP PCI Express Root Port'
    class      = bridge
    subclass   = PCI-PCI
pcib3@pci0:0:28:7:   class=0x060400 card=0x07071028 chip=0x9d178086 rev=0xf1 hdr=0x01
    vendor     = 'Intel Corporation'
    device     = 'Sunrise Point-LP PCI Express Root Port'
    class      = bridge
    subclass   = PCI-PCI
pcib4@pci0:0:29:0:   class=0x060400 card=0x07071028 chip=0x9d1a8086 rev=0xf1 hdr=0x01
    vendor     = 'Intel Corporation'
    class      = bridge
    subclass   = PCI-PCI
isab0@pci0:0:31:0:   class=0x060100 card=0x07071028 chip=0x9d488086 rev=0x21 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Sunrise Point-LP LPC Controller'
    class      = bridge
    subclass   = PCI-ISA
none5@pci0:0:31:2:   class=0x058000 card=0x07071028 chip=0x9d218086 rev=0x21 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Sunrise Point-LP PMC'
    class      = memory
hdac0@pci0:0:31:3:   class=0x040300 card=0x07071028 chip=0x9d708086 rev=0x21 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Sunrise Point-LP HD Audio'
    class      = multimedia
    subclass   = HDA
none6@pci0:0:31:4:   class=0x0c0500 card=0x07071028 chip=0x9d238086 rev=0x21 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Sunrise Point-LP SMBus'
    class      = serial bus
    subclass   = SMBus
vgapci1@pci0:1:0:0:   class=0x030200 card=0x07071028 chip=0x139b10de rev=0xa2 hdr=0x00
    vendor     = 'NVIDIA Corporation'
    device     = 'GM107M [GeForce GTX 960M]'
    class      = display
    subclass   = 3D
alc0@pci0:2:0:0:   class=0x020000 card=0x10280707 chip=0xe0a11969 rev=0x10 hdr=0x00
    vendor     = 'Qualcomm Atheros'
    device     = 'Killer E2400 Gigabit Ethernet Controller'
    class      = network
    subclass   = ethernet
none7@pci0:3:0:0:   class=0x028000 card=0x15351a56 chip=0x003e168c rev=0x32 hdr=0x00
    vendor     = 'Qualcomm Atheros'
    device     = 'QCA6174 802.11ac Wireless Network Adapter'
    class      = network
```
I have the card


----------



## SirDice (Nov 29, 2017)

Yep, but you also have an Intel video card. You appear to have one of those laptops that uses Optimus where the system automatically switches between the Intel and the NVidia card. This used to be impossible to get working, not sure what the current status is, I do believe there are some tricks to enable/disable one of the cards. You may also have that option in the BIOS.


----------



## usernamekiran (Nov 29, 2017)

SirDice said:


> Yep, but you also have an Intel video card. You appear to have one of those laptops that uses Optimus where the system automatically switches between the Intel and the NVidia card. This used to be impossible to get working, not sure what the current status is, I do believe there are some tricks to enable/disable one of the cards. You may also have that option in the BIOS.



I looked up, there is not an option to disable one card in BIOS. What should be my next move now?


----------



## Snurg (Nov 29, 2017)

When you have problems with esoteric hardware, it often pays off to visit the ArchLinux community-supported wiki.
They show what causes problems why and sometimes there are ways to do similar tricks in FreeBSD to make things work.


----------



## SirDice (Nov 29, 2017)

That's a good Wiki indeed, I find myself on it quite frequently. Not sure if the same Optimus trick can be applied to FreeBSD though. But hang around, I'm quite sure we have some other users on the board that may know the exact answer.


----------



## usernamekiran (Nov 29, 2017)

Snurg said:


> When you have problems with esoteric hardware, it often pays off to visit the ArchLinux community-supported wiki.





SirDice said:


> That's a good Wiki indeed, I find myself on it quite frequently. Not sure if the same Optimus trick can be applied to FreeBSD though. But hang around, I'm quite sure we have some other users on the board that may know the exact answer.



Hi again. I am not into modern gaming (but I still love wolf3d; and I have asteroid [singular] on FreeBSD. But how should I get the "optimum performance" out of my current machine?


----------



## SirDice (Nov 29, 2017)

Well, hopefully you'll be able to disable one of the cards and configure Xorg to use the other one. Combining both the Intel and NVidia drivers is going to be tricky in any case because the NVidia driver also replaces a few Xorg libraries, those changes would interfere with the Intel driver because it expects the original Xorg libraries.


----------



## Snurg (Nov 29, 2017)

I guess you want first get X running again, and then afterwards look how you can optimize.
Your log showed that vesa seems to work. Lets use that for now. If that works, it might be easier to mix with Nvidia.
If I were you, I'd try out this xorg.conf:


```
Section "ServerFlags"
Option "DontZap" "false"
EndSection

Section "InputClass"
Identifier "Keyboard Defaults"
MatchIsKeyboard "yes"
Option "XKbOptions" "terminate:ctrl_alt_bksp"
EndSection

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

Section "Files"
# FontPath "/usr/local/share/fonts/Droid/"
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 "vesa"
VendorName "MyMonitor"
EndSection

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

If it fails to start X, uninstall Nvidia drivers and try again (to make sure it didn't fail due to interferences SirDice mentioned in his last post).
Please tell the outcome and post log in case of fail. Then we can see what we can try next.


----------



## usernamekiran (Dec 1, 2017)

SirDice said:


> Well, hopefully you'll be able to disable one of the cards and configure Xorg to use the other one. Combining both the Intel and NVidia drivers is going to be tricky in any case because the NVidia driver also replaces a few Xorg libraries, those changes would interfere with the Intel driver because it expects the original Xorg libraries.





Snurg said:


> I guess you want first get X running again, and then afterwards look how you can optimize.
> Your log showed that vesa seems to work. Lets use that for now. If that works, it might be easier to mix with Nvidia.
> <some content removed>
> If it fails to start X, uninstall Nvidia drivers and try again (to make sure it didn't fail due to interferences SirDice mentioned in his last post).
> Please tell the outcome and post log in case of fail. Then we can see what we can try next.



Well, one log (post #24) is of the configuration in which I had deleted the xorg.conf.d directory, and the driver-nvidia.conf file. That is my current configuration as well.
The second log is with the xorg.conf.d directory, and the driver-nvidia.conf file. Currently, if I try to open "Nvidia X server settings" I get a pop-up stating "You do not appear to be using the NVIDIA X driver.  Please edit your X configuration file (just run `nvidia-xconfig` as root), and restart the X server."


----------



## antolap (Dec 1, 2017)

I have a problem with nvidia driver on FreeBSD 11.1
graphical environment is ok, but If I switch to console (while a graphical environment is running) with control alt f1 f2 f3 monitor is black, the computer is responsive, for example if I run beep program, it works, but I can't see nothing at video

Is there a way to resolve the problem?


----------



## Snurg (Dec 1, 2017)

kiran 
It won' t do any good using Nvidia utilities. Such special cases usually need be configured by hand. Sigh.

antolap 
This is one of the problems I experienced with the vt console (which is still under development). 
However I found out that many times it was helpful to switch forth and back graphics<>console a few times.
Most times changing 2 to 5 times were sufficient. Other times it didn't want to do, so I gave up and tried again later, often with success.

If such a system behavior annoys you, you might want to give the older, alternative sc console a try.
I use the sc console myself, which is mature and does not cause problems with the display like you experience, and supports suspend/resume with Nvidia.
However I read that the sc console is not recommended on UEFI computers. I have no UEFI computer and thus cannot say anything about that potential problem.


----------



## free-and-bsd (Dec 1, 2017)

antolap said:


> I have a problem with nvidia driver on FreeBSD 11.1
> graphical environment is ok, but If I switch to console (while a graphical environment is running) with control alt f1 f2 f3 monitor is black, the computer is responsive, for example if I run beep program, it works, but I can't see nothing at video
> 
> Is there a way to resolve the problem?


Don't do that. When I switch from graphical to console via Ctrl-Alt-F2-3-4 it gets me to console all right, but can't get back to graphical. Have to kill it and restart then.


----------



## T-Daemon (Dec 2, 2017)

I was wondering why nobody from the board mentioned the Nvidia Optimus wiki for FreeBSD:
https://wiki.freebsd.org/OptimusVideoSupport
Would’n that be a good starting point to begin with ( for  xmj's turn_off_nvidia.sh mentioned
in the wiki: https://gist.github.com/dch/992f445b9673aa49325d ).

Here is somebody claiming to make Optimus work recently, however not in a very user friendly way:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192617#c19 .
If this is a way to go, the steps could be put together in a shell script.

Besides, there is the option to try an BIOS update first, possibly obtaining the ability
to disable the INTEL graphics. Dell has an recent BIOS update available, dated 16 Aug 2017,
offering: Fixes & Enhancements - 3. Update Intel GOP and VBIOS.
https://www.dell.com/support/home/us/en/19/drivers/driversdetails?driverId=V8VVT


----------



## Handsome Jack (Dec 2, 2017)

antolap said:


> I have a problem with nvidia driver on FreeBSD 11.1
> graphical environment is ok, but If I switch to console (while a graphical environment is running) with control alt f1 f2 f3 monitor is black, the computer is responsive, for example if I run beep program, it works, but I can't see nothing at video
> 
> Is there a way to resolve the problem?



I had similar problem on PC with nvidia - when I switched from graphical to console via Ctrl-Alt-F2-3-4 I got some big colored tetris-like figures, with no readable fonts.

Installation was: FreeBSD 11.1 +nVidia +BIOS (not UEFI) +UFS +entire disk ;
After hours of unsuccessfully trying many options, somewhere on this forum I read that in UEFI mode there is no such problem, and since that was fresh installation, I had nothing to lose, so I reinstalled system on UEFI mode. (as entire disk, ZFS), now nVidia-switch-to-console-and-back works fine.

[edit] typo


----------



## Snurg (Dec 2, 2017)

Handsome Jack said:


> I had similar problem on PC with nvidia - when I switched from graphical to console via Ctrl-Alt-F2-3-4 I got some big colored tetris-like figures, with no readable fonts.


I always had exactly that phenomena after suspend/resume when I was using the vt console driver (with the defective vesa.ko module being pulled in automatically). (Sidenote: My PCs, older Z-series HP workstations, do not have UEFI)
Removing the vesa.ko module and switching to sc console _always completely fixed_ that problem on the computers I used.

(Edit: Please also see my followup post, as I forgot to mention an essential step)


Handsome Jack said:


> Installation was: FreeBSD 11.1 +nVidia +BIOS (not UEFI) +UFS +entire disk ;
> After hours of unsuccessfully trying many options, somewhere on this forum I read that in UEFI mode there is no such problem, and since that was fresh installation, I had nothing to lose, so I reinstalled system on UEFI mode. (as entire disk, ZFS), now nVidia-switch-to-console-and-back works fine.


That is a highly interesting finding. Thank you very much!
Because, If it turns out that the problems with the vt console _only_ happen on PCs without activated UEFI, that fact would show like a laser pointer what needs to be fixed in the code, presumably in the vesa.ko module.


----------



## antolap (Dec 2, 2017)

I have tried to switch to sc via loader.conf but switching to ctrl+alt+f1 doesn't work
monitor says: no signal


----------



## Snurg (Dec 2, 2017)

antolap 
the ugly problem is that vesa.ko is part of the GENERIC kernel.
Thus, to get rid of the problems mentioned it is prerequisite to build and run a kernel without `option VESA`, and without `option VT`, and any of the `option VT_` entries which follow the `option VT` entry, because the latter pull in vesa.ko by loading that module it at boot time.

Sorry I forgot to mention! I apologize.


----------



## free-and-bsd (Dec 3, 2017)

Can't you simply use sc(4) instead of vt by putting this in /boot/loader.conf:

```
kern.vty=sc
```


----------



## free-and-bsd (Dec 3, 2017)

Handsome Jack said:


> I had similar problem on PC with nvidia - when I switched from graphical to console via Ctrl-Alt-F2-3-4 I got some big colored tetris-like figures, with no readable fonts.
> 
> Installation was: FreeBSD 11.1 +nVidia +BIOS (not UEFI) +UFS +entire disk ;
> After hours of unsuccessfully trying many options, somewhere on this forum I read that in UEFI mode there is no such problem, and since that was fresh installation, I had nothing to lose, so I reinstalled system on UEFI mode. (as entire disk, ZFS), now nVidia-switch-to-console-and-back works fine.
> ...


On the second thought, though, HOW could you install and boot your system in UEFI mode give that you're using 





> entire disk, ZFS


UEFI specification requires that you have (1) GPT partition scheme and (2) first partition to be EFI type...
"ENTIRE disk ZFS", on the other hand, is a configuration with unpartitioned disk entirely used by ZFS. These two seem to be mutually exclusive, do they not?

EDIT: OK, I suppose you actually mean you agreed to the installer suggestion to use "entire disk" for the installation and the installer then did the rest of the job.


----------



## Handsome Jack (Dec 3, 2017)

Correct; I used default, installer suggestions.


----------



## Snurg (Dec 3, 2017)

Handsome Jack said:


> ... when I switched from graphical to console via Ctrl-Alt-F2-3-4 I got some big colored tetris-like figures, with no readable fonts...





Snurg said:


> ... would show like a laser pointer what needs to be fixed in the code, presumably in the vesa.ko module.


I now took a look.
At that bright red spot I immediately saw an uninitialized register value being used.
I corrected this and now have to wait for the kernel to compile, so I can test whether that does the fix.
Will post the outcome after testing some time today.

Edit: More info here: https://forums.freebsd.org/threads/63535/


----------



## Yandri Loor (Dec 12, 2017)

Hello, I am new to FreeBSD, and I have a problem, the Xorg image is extremely small, and I have no idea how to solve it, I have read the base of questions and answers, and I have not found any solution , I think my problem comes from my nvidia card, here is my xorg.conf.d / nvidia.conf


```
Section "Device"

    Identifier    "Device0"
    Driver        "nvidia"
    VendorName    "NVIDIA Corporation"
    BoardName    "GeForce GT 630"
    BusID        "PCI:1:0:0"
    Screen        0

EndSection

Section "Device"

    Identifier    "Device1"
    Driver        "nvidia"
    VendorName    "NVIDIA Corporation"
    BoardName    "GeForce GT 630"
    BusID        "PCI:1:0:0"
    Screen        1

EndSection
```


----------



## Yandri Loor (Dec 12, 2017)

[Quote = "Yandri Loor, mensaje: 368.694, miembro de: 53592"] Hola, Soy nuevo en FreeBSD, y tengo un problema, la imagen Xorg es extremadamente pequeño, y no tengo ni idea de cómo resolverlo, he leído la base de preguntas y respuestas, y no he encontrado ninguna solución, creo que mi problema viene de mi tarjeta nvidia, aquí está mi xorg.conf.d / nvidia.conf

[CÓDIGO]
Section "Device"

    Identificador "Device0"
    Driver "nvidia"
    VendorName "NVIDIA Corporation"
    BoardName    "GeForce GT 630"
    BusID        "PCI:1:0:0"
    pantalla 0

EndSection

Section "Device"

    Identificador "Device1"
    Driver "nvidia"
    VendorName "NVIDIA Corporation"
    BoardName    "GeForce GT 630"
    BusID        "PCI:1:0:0"
    pantalla 1

EndSection
[/CÓDIGO]

Aquí está mi configuración de xorg.conf.d / monitor.conf

[CÓDIGO]
Sección "Monitor"

    Identificador "Monitor0"
    VendorName "Desconocido"
    ModelName    "DOPPIO"
    HorizSync 30,0-81,0
    VertRefresh 56,0-85,0
    Opción "DPMS"

EndSection

Sección "Monitor"

    Identificador "Monitor1"
    VendorName "Desconocido"
    ModelName "LG"
    HorizSync 30,0-81,0
    VertRefresh 56,0-85,0
    Opción "DPMS"

EndSection
[/CÓDIGO]

este es mi xorg.conf.d / servidor / layout.conf

[CÓDIGO]
Sección "ServerLayout"

    Identificador "Layout0"
    Pantalla 0 "Screen0" 0 1280
    Pantalla 1 "Screen1" 480 0
    InputDevice "Keyboard0" "CoreKeyboard"
    InputDevice "Mouse0" "CorePointer"
    Opción "Xinerama" "0"

EndSection
[/CÓDIGO]

este es mi /etc/rc.conf

[CÓDIGO] hostname = "lrc572lrc.com"
    keymap="es"
    ifconfig_re0 = "DHCP"
    ifconfig_re0_ipv6 = "accept_rtadv inet6"
    local_unbound_enable = "YES"
    sshd_enable = "YES"
    moused_enable = "YES"
    ntpd_enable = "YES"
# Conjunto dumpdev en "AUTO" para permitir volcados, "NO" para desactivar
    dumpdev="AUTO"
    hald_enable = "YES"
    dbus_enable = "YES"
    tcsd_enable = "YES"
# Tcsd_mode = "emulador"
# Tpmd_enable = "SÍ"
    jackd_enable = "YES"
    jackd_user = "LRC"
    jackd_rtprio = "YES"
    jackd_args = "- R -doss -r48000 -p1024 -n3 -w16 --capture / dev / dsp0 --playback / dev / dsp0"
    vboxnet_enable = "YES"
    devfs_system_ruleset = "sistema"
[/CÓDIGO]

este es mi /boot/loader.conf

[CÓDIGO]
   kern.vt = vt
   nvidia_load = "YES"
   nvidia-modeset_load = "YES"
   linux_load = "YES
   vboxdrv_load = "YES"
[/ CODE] [/ QUOTE]


----------



## free-and-bsd (Dec 15, 2017)

Yandri Loor said:


> Hello, I am new to FreeBSD, and I have a problem, the Xorg image is extremely small, and I have no idea how to solve it, I have read the base of questions and answers, and I have not found any solution , I think my problem comes from my nvidia card, here is my xorg.conf.d / nvidia.conf
> 
> 
> ```
> ...


WHy should you need 2 Device sections? If you have 2 monitors, Xorg will handle that automatically -- or you can use NVIDIA driver options to handle that. You either remove the second Device section or you add other sections to show how you use your "Screen 0" and "Screen 1".


----------



## Yandri Loor (Dec 15, 2017)

hello, then, if I remove the second device section, xorg should recognize it without nvidia-xsettings
I'm going to do it, but first uninstall nvidia-xsettings?
if they are less programs it is better.
Thanks for your help,


----------



## free-and-bsd (Dec 15, 2017)

Yandri Loor said:


> hello, then, if I remove the second device section, xorg should recognize it without nvidia-xsettings
> I'm going to do it, but first uninstall nvidia-xsettings?
> if they are less programs it is better.
> Thanks for your help,


Well, nvidia-xsettings will do no harm by itself. It's only a configuration utility and doesn't interfere in Xorg functionality. But what really works for your hardware can be found in /var/log/Xorg.0.log. That is how I figured out what I needed for my dual monitor configuration.
One more thing to check is your hardware. It's been reported more than once in this thread and other places that laptops with 2 graphics devices (usually Intel + Nvidia) may have software-independent problems. Read in this thread.


----------



## free-and-bsd (Dec 15, 2017)

Yandri Loor said:


> ...
> hald_enable = "YES"
> ...


So you said you read the manual? Where does it say you need that?


----------



## puretone (Dec 21, 2017)

May I ask why you lot are making your lives so incredibly hard?

I use a NVidia GT 1030, and a number of cards below the 1xxx generation of GeForce cards. I prefer cards with no fans, that's just the sort of no-unnecessary hardware nazi that I am.

You can go the vanilla-route and use the ports/pkgs with x11/nvidia-driver followed by x11/nvidia-xconfig (which will build you a very good xorg.conf) and x11/nvidia-settings for some GUI-porn of your video-card. If you feel like more wild-side (or is that darkside...) shenanigans, head off to http://www.nvidia.com/object/freebsd-x64-archive.html for more recent drivers. I use those more recent ones and have yet to come across any crashes at all.

The auto-install will add a bunch of rubbish to your /etc/rc.conf and /boot/loader.conf files, which are both unnecessary. All you really need in your /etc/rc.conf file is 
	
	



```
kld_list="linux linux64 nvidia nvidia-modeset"
```
 to get your NVidia card all fired up and happy. I have 
	
	



```
coretemp aesni fuse
```
 added to my kld_list as well. The auto-install will add "linux_enable="YES" " to your /etc/rc.conf and "nvidia", "nvidia-modeset" and some other nvidia-related silliness to your /boot/loader.conf which I find not very elegant, so they can be safely removed...so long as you keep the "kld_list" in your /etc/rc.conf file.


----------



## free-and-bsd (Dec 25, 2017)

puretone: yes, for _single monitor_ configuration you won't need even that. So, no need to make life even this much complicated. And for _dual monitor,_ in most cases, automatic configuration won't work the way YOU want it. That's when you may want to... make your life more complicated.


----------



## Zagzigger (Jan 28, 2019)

SirDice said:


> Remove every trace of xorg.conf. You really don't need it and you don't need to create it. Then create /usr/local/etc/X11/xorg.conf.d/driver-nvidia.conf
> 
> ```
> Section "Device"
> ...


This really needs to be known more widely.
I am a newbie to this forum, and it seems that as set-ups change for nvidia and other common tasks, then they should be easier to find by version. 
The older posts for older versions of FreeBSD may be vital for some - but it does make looking for gems like this more difficult.
But thanks - worked like a dream.


----------



## free-and-bsd (Jan 28, 2019)

Zagzigger said:


> This really needs to be known more widely.


I think this has more to do with Xorg configuration than with nvidia in particular. And actually this can be found in xorg.conf(5) man page. It mentions there the possibility of using xorg.conf OR separate files in xorg.conf.d directory. The latter approach is more minimalistic because it only requires explicit declaration of what is "different" -- like driver name or specific monitor configuration. The rest of it Xorg does by default, a good deal of it. And that seems logical, too.


----------



## scottro (Jan 28, 2019)

The something.d directory, where you put things that need special treatement has become fairly common. That doesn't mean you know it, but sometimes it is assumed that you do. 
Remember many of these posts are fairly old, and, in my experience at least, are no longer accurate. Just putting a second in for the nvidia driver may not work. In my recent experience, I've found the nvidia-xconfig port to be a time saver.  It creates an xorg.conf file for the nvidia card, sometimes putting in thi
ngs that I wouldn't have noticed, such as a bus ID.  
Yes, it takes up more space than 3 lines in /usr/local/etc/X11/xorg.conf.d but the 4k that it takes is worth the time it would take me to figure out exactly 
what is and isn't necessary. At any rate, at least on my hardware, just 
putting the driver and bus ID in the file isn't sufficient.


----------



## free-and-bsd (Jan 28, 2019)

Yes, those obscure nvidia-specific options you put into xorg.conf. Every time I used nvidia-xconfig I had to hand-edit it afterwards. So I had to watch /var/log/Xorg.0.log for how those would be handled. So it turned out that some of them were NOT handled at all while others were handled not the way it was intended... 
Still, I like the xorg.conf.d approach more because you only put there the sections you need. You then put them in separate files and name the files accordingly, like intel-driver.conf or nvidia-dualmon.conf etc.


----------



## SirDice (Jan 28, 2019)

scottro said:


> It creates an xorg.conf file for the nvidia card, sometimes putting in things that I wouldn't have noticed, such as a bus ID.


The BusID is only needed if you have more than one graphics card. If you only have one card there's no need or requirement to add the BusID in the config.


----------



## OldSubSailor (Jan 28, 2019)

Howdy all,
I am trying to work through the instruction for installing the Nvidia driver.  I did a pkg install last night, but evidently there is much more to be done. the Nvidia instructions
http://us.download.nvidia.com/XFree86/FreeBSD-x86_64/410.78/README/installationandconfiguration.html
say that "... the kernel source tree must be installed (ssys installed). I searched online and found that used to be done using the sysinstall utility  which evidently took one to an installer much like what I saw using the freeBSD installer dvd that I burned.
Now, I see that freebsd replaced sysinstall with pc-sysinstall, but to me the man page is rather confusing, and I did not see any command that would do that.

Am I going to have to reinstall freebsd from my dvd and work my way through the post-install options?


----------



## scottro (Jan 28, 2019)

Hrrm, you need that for pkg install?  I didn't know that. I keep thinking of putting up a little page, but they keep fixing various small things, so that it seems by the time I get a page up, it will be wasted.

To install the source, they are talking about the source code for the system.

If there isn't a /usr/src directory, create it. (You'll need root privilege). Then you check out the source code with svnlite.

```
sudo mkdir /usr src 
sudo svnlite co https://svn.freebsd.org/base/releng/12.0 /usr/src
```

If you have a /usr/src directory you don't need the mkdir command. Depending where you live, you might want to specify an svn server. For example, I'm in NY, so I use svn0.us-east.freebsd.org.  I use 12.0 here, if you're using 11.2 then you would change the 12.0 to 11.2


----------



## drhowarddrfine (Jan 28, 2019)

As said here, I have to use those tools to get nvidia running, initially. I tweak them if I have to but just installing the drivers doesn't work with my old card. Otherwise, I have never had an issue with nvidia installing.


----------



## OldSubSailor (Jan 29, 2019)

scottro said:


> Hrrm, you need that for pkg install?  I didn't know that. I keep thinking of putting up a little page, but they keep fixing various small things, so that it seems by the time I get a page up, it will be wasted.
> 
> To install the source, they are talking about the source code for the system.
> 
> ...


I still need to install the ssys kernel thing.


----------



## T-Daemon (Jan 29, 2019)

OldSubSailor said:


> I am trying to work through the instruction for installing the Nvidia driver. I did a pkg install last night, but evidently there is much more to be done. the Nvidia instructions
> http://us.download.nvidia.com/XFree86/FreeBSD-x86_64/410.78/README/installationandconfiguration.html
> say that "... the kernel source tree must be installed (ssys installed)


The Nvidia instruction assumes you are downloading the source file, building and installing the driver independent of the supported software installation methods on FreeBSD, which are ports and packages. Stay with the supported methods. Package installing the nvidia driver requires only the Linux kernel module to be loaded. The kernel sources are needed if you are using the port. It is strongly recommended not to mix ports and packages. 

You apparently have installed the nvidia driver already, skip to the configuration, set in in /etc/rc.conf the line kld_list=“nvidia-modeset” and, if haven't done it previously, add the users to the wheel group e.g.  `pw groupmod wheel -m oldsubsailor`, reboot the system. Log in as user, execute `startx`. If all went well the twm window manager comes up. To exit left click and choose exit from the menu.

You might find the x11/nvidia-settings tool useful to manipulate brightness, temperature, gamma, OpenGL settings.


----------



## OldSubSailor (Jan 29, 2019)

T-Daemon said:


> The Nvidia instruction assumes you are downloading the source file, building and installing the driver independent of the supported software installation methods on FreeBSD, which are ports and packages. Stay with the supported methods. Package installing the nvidia driver requires only the Linux kernel module to be loaded. The kernel sources are needed if you are using the port. It is strongly recommended not to mix ports and packages.
> 
> You apparently have installed the nvidia driver already, skip to the configuration, set in in /etc/rc.conf the line kld_list=“nvidia-modeset” and, if haven't done it previously, add the users to the wheel group e.g.  `pw groupmod wheel -m oldsubsailor`, reboot the system. Log in as user, execute `startx`. If all went well the twm window manager comes up. To exit left click and choose exit from the menu.
> 
> You might find the x11/nvidia-settings tool useful to manipulate brightness, temperature, gamma, OpenGL settings.



Howdy,
Let me restart, Sub Sailor brief history:  I have been an Apple guy since the Apple II days. I am currently converting a late 2013 iMac into a freeBSD machine; I have a new iMac for all this netting etc. stuff. The old iMac works fine in the command line mode, but I do not like that huge block cursor.  It was suggested that I try installing the i3 window management system because one could modify the terminal settings (I am making a full attack on learning UNIX).  So as I understood things, I also needed to install xorg and evidently the NVIDIA Driver. Why I need the driver seeing as how the iMac screen works fine, I do not know. How do I even know if it is having any effect on things, seeing as how things look just like they did before I installed it?   One bad thing is that I have to keep running to and from the two iMacs, along with running a 50 foot Ethernet cable to the old one.

I am trying to configure both xorg and Nvidia (the Nvidia instructions are somewhat of a help, even though, they are assuming that one is installing a download from their driver site). Just to verify, I did perform a freeBSD pkg install of both xorg and the NVIDIA Driver etc.
The xorg installation did include the TWM window thing, however, when I call twm, I get an error message that reads 'unable to open display', so that is why I opted to install the Nvidia driver in the first place. However, after the install, calling twm continues to return that error message.
ALSO I am having issues with xorg. When I call it <startx>, I get a screen load of error messages about fatal errors: server, no screen found, giving up, x server connection refused and more.

At this time I can't but help wonder if this is worth it. At 71, I don't know if I will live long enough to get this done; however; also, at 71, I do have enough time to reinstall freeBSD and forget about the window management stuff. I shall try to make the above changes that you have so kindly suggested, and hope for the best.
UPDATE: I made the change to the rc.conf as you said, but no joy.


----------



## SirDice (Jan 29, 2019)

`pkg install nvidia-driver`
Remove any /etc/X11/xorg.conf or /usr/local/etc/X11/xorg.conf if they exist. 
Create /usr/local/etc/X11/xorg.conf.d/driver-nvidia.conf with the following content:

```
Section "Device"
        Identifier "Card0"
        Driver     "nvidia"
EndSection
```
Nothing else is required. Remove any other files that happen to be in /etc/X11/xorg.conf.d/ and /usr/local/etc/X11/xorg.conf.d/ from previous attempts. 

Then run `startx` and see if things work. If they don't work install misc/pastebinit and run `cat /var/log/Xorg.0.log | pastebinit`. Post the URL here (so we can have a look at your logs).

Don't worry about window managers or desktops at this point. We need to make sure the foundation (Xorg) is in order before we can build a house (window manager/desktop) on top of it.


----------



## helmet1080 (Sep 18, 2020)

Zagzigger said:


> This really needs to be known more widely.
> I am a newbie to this forum, and it seems that as set-ups change for nvidia and other common tasks, then they should be easier to find by version.
> The older posts for older versions of FreeBSD may be vital for some - but it does make looking for gems like this more difficult.
> But thanks - worked like a dream.


It works just nice!


----------

