# X configuration for Intel HD 3000 and Nvidia GT 540M



## Adam82 (Sep 10, 2013)

Dear Forum members!

While I have searched for these issues, and found many answers, I just can't put the pieces together as to how to configure X for dual video card configuration (I know, being a newbie is not an excuse). I just want to pick the one that works, I don't need Nvidia, Intel is more than sufficient. I have built the Intel drivers (I can't build the Nvidia ones, because of some issues with the Linux emulator), but X.Org configuration fails. It loads the Intel drivers, but can't seem to make heads or tails of it. It also tries to use Nvidia as default, but it is of course unsupported. I try to surmize the log:

```
(!!) More than one possible primary device found
List of video drivers:
intel
nv
fbdev
vesa
(II) Primary device is NVidia - NV: Ignoring unsupported device (GT 540M)
(II) Loading sub module "fbdevhw"
(EE) LoadModule: Module fbdevhw does not have a fbdevhwModuleData data object
(II) UnloadModule
(WW) Falling back to old probe method for fbdev
Number of created screens does not match number of detected devices. Configuration failed.
```
Can you please help me with this issue in a way that a newbie can understand?

Thank you,
Adam


----------



## vermaden (Sep 10, 2013)

Adam82 said:
			
		

> \I just want to pick the one that works, I don't need Nvidia, Intel is more than sufficient.



Get the latest FreeBSD 10.x snapshot, then disable Nvidia Optimus and Nvidia card in BIOS, then install Xorg and then as Xorg is installed create new Xorg configuration by typing `Xorg -configure` and move xorg.conf.new into the /etc/X11/xorg.conf.


----------



## Adam82 (Sep 10, 2013)

Dear @vermaden,

Thank you for your answer. Are there additional steps to make, when I can't disable the card in BIOS?

Thank you very much,
Adam


----------



## pacija (Sep 10, 2013)

Two years ago I bought an Asus laptop with Nvidia Optimus for my wife. There was no way to make video work under FreeBSD. Also there was no related section in the BIOS. Fortunately, it was constantly dumping core even under Windows 7. After a bluescreen, the Nvidia adapter would disappear from the device manager as well. Resetting the BIOS to default would make it reappear. As this was obviously a hardware problem I managed to return the laptop and get my money back. Since then I avoid Nvidia Optimus in 100kms [size=-1][What is 100kms? -- Mod.][/size] circles.


----------



## Adam82 (Sep 10, 2013)

Dear @pacija,

Thank you for the answer. I have heard about the Optimus issues, but thought the problem was ironed out. And yes, your guess/knowledge is right, the notebook in question is an ASUS, but mine is working fine with Windows. My only sadness is FreeBSD. I just can't live with Linux. I tried, I can't. FreeBSD however, is something I really loved on my old (4 years) laptop... I guess I have to wait another four years for the hardware to get old enough to be supported, but by then it will be obsolete. A vicious cycle, it seems like FreeBSD isn't ready for widespread desktop use because of driver issues. I'm really sad, but let this be my biggest problem.

Thank you,
Adam


----------



## pacija (Sep 10, 2013)

I would not go as far as to say FreeBSD is not ready for desktop use, even on fresh hardware, as I am happily using it on my work desktop HP Z220 which comes with fairly new Intel HD P4000 graphics.

However, I did have to set the following in /etc/make.conf:

```
WITH_NEW_XORG=yes
```

...and recompile all the ports.

I have to add that I had video working even before that, but it was picking the VESA driver only. After adding the line to make.conf and recompiling all ports, I got the Intel driver working.

Perhaps you could give it a try?


----------



## Adam82 (Sep 10, 2013)

Dear @pacija,

Thank you for the answer again. I thought I figured correctly that this option should be default - I couldn't be sure of course, as I couldn't find a good affirmation that this option is turned on by default on 9.1. It seems it isn't. I can give it a try, I hope it works. Thank you!

Best Regards,
Adam


----------



## mzperx (Oct 11, 2013)

pacija said:
			
		

> However, I did have to set the following in /etc/make.conf:
> 
> ```
> WITH_NEW_XORG=yes
> ...



I have compiled Xorg with /etc/make.conf

```
WITH_NEW_XORG=true
WITH_KMS=true
```

but I get a black screen if I set AccelMethod to sna. I simply issued

```
make install clean
```
in /usr/ports/x11/xorg/ directory.

Without the sna option Xorg starts fine. Is there anything to do in order to get sna support? Thanks.

EDIT: it seems that with "yes" instead of "true" works (but I am sure I saw =true many times as well).


----------



## zspider (Oct 11, 2013)

Adam82 said:
			
		

> Dear @vermaden,
> 
> Thank you for your answer. Are there additional steps to make, when I can't disable the card in BIOS?
> 
> ...



Generate an Xorg config (`Xorg -configure`), remove all the lines referring to the nVidia adapter and other screens. Usually you're looking for Screen 1 and Card 1. Also make sure your Intel adapter bus ID is properly defined.

If you just want a desktop, check out PC-BSD or Desktop-BSD.


----------



## TommyC7 (Oct 12, 2013)

As an owner (and currently typing to you from) of an nVidia optimus laptop, I thought I should intervene here for some clarity.

First off, you do need the aforementioned lines in /etc/make.conf:


```
WITH_NEW_XORG=YES
WITH_KMS=YES
```

Then, simply rebuild Xorg.

Install x11/xf86-video-intel and then do the whole


```
Xorg -configure
```

thing (moving the .conf file to the appropriate directory and making sure all the drivers are set to "intel").

Then everything should startup. One notable problem that people have said they've gotten (myself included) was a black screen when they execute startx.

This means that X11 started, but it may not be properly configured, so if you need any more help feel free to drop by again (but expect to be asked for your xorg.conf at this point.



> *vermaden*:
> Get the latest FreeBSD 10.x snapshot, then disable Nvidia Optimus and Nvidia card in BIOS, then install Xorg and then as Xorg is installed create new Xorg configuration by typing Xorg -configure and move xorg.conf.new into the /etc/X11/xorg.conf.



That's a bit overkill considering the Intel GPU's for nVidia Optimus laptops were supported since FreeBSD 9.1 (although oddly not for 9.0).



> *pacija*:
> ...and recompile all the ports.



That is also overkill. Not all ports rely on X11. You only need to recompile the ones that do rely on the new X11 that has been rebuilt which some of the port-mgmt tools can do for you very easily.


----------

