HOWTO: Setup Xorg with NVIDIA's driver

Lucky

New Member


Messages: 5

#26
Why won't you just tell which laptop model (looks like METABOX, but which one?) you are using? In your previous log NVIDIA driver showed a lot, now it says the above...

I suspect you have a laptop with two graphical adapters. If so, their usage must be configurable via BIOS.
I got this one... http://www.metabox.com.au/store/b218/Metabox-Alpha-N850HJ-laptop

btw... Thank you FaB. Seems that you help a lot of people in this area. You're a good man :) It's truly appreciated (I'm sure by all)
 

free-and-bsd

Aspiring Daemon

Thanks: 67
Messages: 644

#27
[ 38.905] (II) NVIDIA(0): NVIDIA GPU GeForce GTX 1050 (GP107-A) at PCI:1:0:0 (GPU-0)
This is from your previous X log. And NOW it doesn't detect devices at PCI:1:0:0? Funny. Can it be the nvidia-modeset.ko module is not loaded this time?
 

ShelLuser

Son of Beastie

Thanks: 1,501
Messages: 3,303

#31
Most of you probably already know this but I figured it still makes a good addition to this awesome guide.

If you're using a port to enhance your kernel then you might be interested in PORTS_MODULES.

If you add PORTS_MODULES to /etc/make.conf then this will instruct your system to grab and build the specified port(s) every time you recompile your kernel, thus ensuring that your system remains fully intact.

So to add to the example in the guide, if you're using the NVidia module then you might want to add:

Code:
PORTS_MODULE=x11/nvidia-driver
... to your /etc/make.conf.
 

Robert Kopp

New Member


Messages: 5

#32
I made a fresh install of 11.1 (AMD) before I read this post. I have a GTX970 display adapter. I downloaded software from Nvidia's Website (384.98, instead of 384.90 that is currently in the ports tree) instead of using the port. But such Linux-based applications as linux-unigine-heaven will not work. When I built that application, I built the required environment to support Linux, but it should have been done before the Nvidia driver was installed. And perhaps the Nvidia driver should have been installed from ports. What should I do now? Will installing the driver from ports fix the problem, or do I need to uninstall something first?
 

coyote_trackz

New Member


Messages: 10

#33
It seems that these instructions don't seem to work with 11.2. I started getting error messages (of which I neglected to write down) in regards to the nvidia driver. Are there any modifications that need to be made to the instructions?
 

scottro

Daemon

Thanks: 428
Messages: 1,272

#34
There are some issues with 11.2 and NVidia. Firstly, it has to be installed from ports for the moment, not packages.
Depending upon your card, you'll either want x11/nvidia-driver or, if it's an older card (you have to hunt around if it's a card that uses the legacy driver--NVidia has a list, but the model numbers sometimes differ, so you may have to look) use the nvidia-driver-340. If it's the 340, then in /boot/loader.conf you put nvidia_load="YES" if it's the newer driver then
nvidia_modeset_load="YES"

If X won't start, at this point, you can try running the nvidia-xconfig program which usually gives you a working xorg.conf that will work with your card. If it still won't start, the only time that this has happened to me was because there was no BusID entry in the xorg.conf created nvidia-xconfig, so look for a BusID line and if not, you'll have to add it.
To get the BusID, you can use nvidia-smi -q |grep Bus and you might get something like

Code:
Bus Id                      : 00000000:01:00.0
So you would put in /etc/X11/xorg.conf
Code:
 BusID          "PCI:1:0:0"
in the Device section.

But sometimes, you don't even need an xorg.conf. I've never really noticed a pattern, and even if you do, you could cut out a lot of what nvidia-xconfig puts in there and get by with a few lines, but I've never cared enough, I fear, to see how much I can leave out.
 

clawhammer

Active Member

Thanks: 6
Messages: 157

#35
There are some issues with 11.2 and NVidia. Firstly, it has to be installed from ports for the moment, not packages.
Depending upon your card, you'll either want x11/nvidia-driver or, if it's an older card (you have to hunt around if it's a card that uses the legacy driver--NVidia has a list, but the model numbers sometimes differ, so you may have to look) use the nvidia-driver-340. If it's the 340, then in /boot/loader.conf you put nvidia_load="YES" if it's the newer driver then
nvidia_modeset_load="YES"

If X won't start, at this point, you can try running the nvidia-xconfig program which usually gives you a working xorg.conf that will work with your card. If it still won't start, the only time that this has happened to me was because there was no BusID entry in the xorg.conf created nvidia-xconfig, so look for a BusID line and if not, you'll have to add it.
To get the BusID, you can use nvidia-smi -q |grep Bus and you might get something like

Code:
Bus Id                      : 00000000:01:00.0
So you would put in /etc/X11/xorg.conf
Code:
BusID          "PCI:1:0:0"
in the Device section.

But sometimes, you don't even need an xorg.conf. I've never really noticed a pattern, and even if you do, you could cut out a lot of what nvidia-xconfig puts in there and get by with a few lines, but I've never cared enough, I fear, to see how much I can leave out.
I get command not found for nvidia-smi. I have the nvidia-driver installed and what ive read is that nvidia-smi should be included with that. Did you download nvidia-smi from some other source?
 

Chris_H

Daemon

Thanks: 186
Messages: 1,076

#36
That probably should have read: pciconf -lv
Generally speaking. I've usually found it easier after loading the nvidia kernel module. To just exec startx.
Which produces a logfile as /usr/log/Xorg.0.log
opening that log file provides the BusID number that you can add as necessary. For example mine was: 0:2:0:0. As I don't need an /etx/X11/xorg.conf file. I simply created a
/usr/local/etc/X11/xorg.conf.d/driver-nvidia.conf file that looke like this:
Code:
# /usr/local/etc/X11/xorg.conf.d/
Section "Device"
        Option  "DRI"   "True"
        Identifier      "Card0"
        Driver          "nvidia"
        BusID           "PCI:0:13:0"
        #BusID  "PCI:0:2:0:0"
EndSection
HTH!

--Chris
 

clawhammer

Active Member

Thanks: 6
Messages: 157

#37
That probably should have read: pciconf -lv
Generally speaking. I've usually found it easier after loading the nvidia kernel module. To just exec startx.
Which produces a logfile as /usr/log/Xorg.0.log
opening that log file provides the BusID number that you can add as necessary. For example mine was: 0:2:0:0. As I don't need an /etx/X11/xorg.conf file. I simply created a
/usr/local/etc/X11/xorg.conf.d/driver-nvidia.conf file that looke like this:
Code:
# /usr/local/etc/X11/xorg.conf.d/
Section "Device"
        Option  "DRI"   "True"
        Identifier      "Card0"
        Driver          "nvidia"
        BusID           "PCI:0:13:0"
        #BusID  "PCI:0:2:0:0"
EndSection
HTH!

--Chris
I'm sorry but ive been modifying rc.conf, nvidia config files for the past couple days. I have an gtx 1060 that I can get to boot in x server. the only way I can get x server to work with kde is with the intel integrated chipset. Ive tried all the way ive seen on the forums to have the config files but it wont boot lol. Am I dumb or just missing something?
 

scottro

Daemon

Thanks: 428
Messages: 1,272

#38
I get command not found for nvidia-smi. I have the nvidia-driver installed and what ive read is that nvidia-smi should be included with that. Did you download nvidia-smi from some other source?
No, perhaps it was included with nvida-xconfig? I had it installed.
As Chris_H points out, pciconf -lv will also give you a busid, but the simplest (as also mentioned in their post) is probably to just run startx and see if Xorg.0.log gives it.

In my case, I've only had to find it on one occasion, and nvidia-smi was my first google hit, and when I ran it, it was on my machine.
 
Top