# Guide to install and use intel on nvidia optimus machine



## shak (Aug 16, 2019)

Hi everyone

I have installed xorg successfully. Startx works. Coming from arch i noticed that there isnt an xorg.conf file anywhere. Not in etc/x11 and not in the usr local. Is that by design? How do i know what is configured and what isnt?

I havent installed the nvidia drivers yet. I created a custom conf file and just added a simple device section for the intel driver. When i run it it says no screens found. Is there any other step i have to do? I checked the configure xorg freebsd doc but it doesnt say anything else. 

Does anyone have any guide to have both cards installed and use optimus technology? For starters i just want to use intel to boot into i3wm


----------



## SirDice (Aug 16, 2019)

shak said:


> Is that by design?


Yes, it's not required. And most of the time not needed either.



> How do I know what is configured and what isn't?


Look in /var/log/Xorg.0.log

Regarding Optimus, look in this thread: https://forums.freebsd.org/threads/nvidia-optimus-driver-for-freebsd.71504


----------



## shak (Aug 16, 2019)

SirDice said:


> Yes, it's not required. And most of the time not needed either.
> 
> 
> Look in /var/log/Xorg.0.log


Thanks a lot for the reply

Do i have to follow this guide for intel? If i dont install nvidia will i be able to boot by using only intel?


----------



## shkhln (Aug 16, 2019)

shak said:


> Do i have to follow this guide for intel? If i dont install nvidia will i be able to boot by using only intel?



You are already using Intel by doing nothing special.



shak said:


> I have installed xorg successfully. Startx works.



Without explicit config Xorg tries several video drivers, such as vesa, scfb, intel or modesetting.



shak said:


> How do i know what is configured and what isnt?



Actually you don't. You can infer the selected driver from /var/log/Xorg.0.log, but even there isn't a single specific message telling which driver Xorg is using.


----------



## shak (Aug 16, 2019)

shkhln said:


> You are already using Intel by doing nothing special.


So i dont need to add the device intel in xorg custom conf? Either the module in loader?


----------



## shkhln (Aug 16, 2019)

You need i915.ko from drm-kmod and modesetting driver. And maybe disable power for Nvidia card somehow.


----------



## shak (Aug 16, 2019)

Thanks for the help. I still cant manage to boot into i3. Startx opens if i dont create a,conf file.if i run exec i3 i get cant open display
 I tried to create a conf file and just add these

```
Section "Device"
  Identifier "Card0"
  Driver "nvidia"
  BusID "PCI:0:3:0:0" i also tried 3:0:0
  Option "AllowEmptyInitialConfiguration"
EndSection
```
In this case I get no screens found

Does anyone who have managed to configure optimus please share his, xorg.conf file? For now I just want to boot with only one card active. Later on I can figure out how to use Optimus.


----------



## SirDice (Aug 16, 2019)

shak said:


> Does anyone who have managed to comfigure optimus please share his,xorg conf file?


Read the thread I referenced in post #2.


----------



## shak (Aug 16, 2019)

SirDice said:


> Read the thread I referenced in post #2.


Thanks again for the reply

Yes i ve read about the modified driver. It doesnt need any xorg configuration? Neither nvidia modeset in the rc.conf?


----------



## shkhln (Aug 16, 2019)

shak said:


> ```
> Section "Device"
> Identifier "Card0"
> Driver "nvidia"
> ...



No screens are attached to the Nvidia card in the first place. Optimus works by copying (in software) images from Nvidia GPU and displaying them on Intel GPU.


----------



## shak (Aug 16, 2019)

shkhln said:


> No screens are attached to the Nvidia card in the first place. Optimus works by copying (in software) images from Nvidia GPU and displaying them on Intel GPU.


I have also tried to add a screen but still nothing. I also tried the modified driver posted by another user. I can run in this case startx but exec i3 or exec fluxbox results in cant open display(in case of i3) or Couldnt connect to xserver passing null display in fluxbox. This happens when i dont have anything configured for xorg in xorg.conf.d directory

I get the feeling that is something else , that even though without optimus i would still get this message.


----------



## shak (Aug 16, 2019)

Hi everyone!

Decided to make a new thread to make the problem more specific to the error i am receiving.

I am in desperate need to manage to boot into i3 environment or just anywhere. 

I tried without xorg.conf and also with automatic xorg conf file.

I have both intel and nvidia drivers installed. Setting in my xorg the intel driver without nvidia i can run startx. Xrandrd list providers show the intel driver being used. 

However running exec i3 results immediately in Cannot Open Display.

If i set nvidia only in xorg i get message no screens found. I have tried also the modified driver in this github repo 








						GitHub - pouya-eghbali/freebsd-nvidia-optimus: Nvidia optimus drivers for FreeBSD
					

Nvidia optimus drivers for FreeBSD. Contribute to pouya-eghbali/freebsd-nvidia-optimus development by creating an account on GitHub.




					github.com
				




Again the same issue and also the service wouldnt start automatically.

Can someone please help?


----------



## SirDice (Aug 16, 2019)

shak said:


> Decided to make a new thread to make the problem more specific to the error i am receiving.


It's the exact same issue, threads merged.


----------



## shak (Aug 16, 2019)

SirDice said:


> It's the exact same issue, threads merged.


Apologies for that.

I have managed to boot into i3 environment !!! Apparently i forgot to out in xinitrc exec i3. 

It only runs on intel now. I will need to find a way to enable optimus


----------

