# Nvidia drivers



## gomster (Mar 27, 2021)

I have installed nvidia drivers and have followed this tutorial:



_View: https://youtu.be/Q6KxMUY2aTU_

I have an rtx2060. I have a full hd screen but the resolution that i get on my tty and my x server with awesome wm is from what i can tell 800x600. The nvidia settings are not even found on the system. I have installed the nvidia drivers with pkg and have made the appropriate changes to loader.conf and rc.conf as shown in the video...


----------



## gomster (Mar 27, 2021)

gomster said:


> I have installed nvidia drivers and have followed this tutorial:
> 
> 
> 
> ...


Xrandr says that the max res is 800x600 and i have a full hd screen.


----------



## gomster (Mar 27, 2021)

My situation is a bit similar to this:
https://forums.freebsd.org/threads/cant-configure-display-resolution.76878/ but the machine that i’m on is a laptop with hybrid graphics- nvidia and intel integrated...


----------



## Deleted member 30996 (Mar 27, 2021)

I'm not going to watch that video to find out what you did if you can't tell us what driver you used or anything else you've done besides install the driver.

I do have a part that shows how I do it in my Tutorial, if you can be troubled to read it. 









						Beginners Guide - How To Set Up A FreeBSD Desktop From Scratch
					

I'm going to guide you though the process of getting a fully functional FreeBSD 13.0-RELEASE desktop up and running, complete with system files and security settings, step-by-step as if you've never used UNIX or the command line. Now let's get started:  Insert your boot media and at the Welcome...




					forums.freebsd.org


----------



## gomster (Mar 27, 2021)

Trihexagonal said:


> I'm not going to watch that video to find out what you did if you can't tell us what driver you used or anything else you've done besides install the driver.
> 
> I do have a part that shows how I do it in my Tutorial, if you can be troubled to read it.
> 
> http://[URL]https://forums.freebsd....-set-up-a-freebsd-desktop-from-scratch.61659/[/URL


I read your tutorial and i like it. But the thing is. From the momment i started installing to when the system was installed and operational, the resolution was always 800x600, even in an x server. Even though i have an nvidia card and a full hd screen... I’m really not sure what to do since i have tried setting resolutions but it does not do 1920x1080.....


----------



## Deleted member 30996 (Mar 27, 2021)

Why don't you start by telling us which driver you installed?


----------



## gomster (Mar 27, 2021)

Trihexagonal said:


> Why don't you start by telling us which driver you installed?


This is exactly what i did;
   doas pkg install nvidia-driver
i installed the latest driver as of yesterday.
   doas vim /etc/rc.conf
   kld_list="linux nvidia nvidia-modeset"
and fuse was also there b4
If i try to load them manually it says that they are already loaded.
then i restarted the machine and the res was still 800x600...
I've also edited /boot/loader.conf with the following:

  linux_load="YES"
  nvidia_load="YES"
  nvidia_name="nvidia"
  nvidia_modeset_load="YES"
  nvidia_modeset_name="nvidia-modeset"

The thing is that no matter what i try the resolution is still 800x600 from the momment i plugged in my bootlable usb and even on the installed system. I do however have hybrid graphics. I've already installed freebsd on this very machine last september and had the same issue... I have verified the image with sha512 and pgp as well.
I also tried setting efi_max_resolution in rc.conf with no difference at all.  The refresh rate is fine, its just the resolution that is the problem. At first i thought it was the font, but xrandr convinced me otherwise. 
I have nothing on this system yet and i still have the usb. So I will reinstall the system, because i want to have zfs. and i will follow your tutorial. Even so, the resolution is still 800x600 even on the live image. 
I have a uefi system with secure boot off.


----------



## gomster (Mar 27, 2021)

Trihexagonal said:


> I'm not going to watch that video to find out what you did if you can't tell us what driver you used or anything else you've done besides install the driver.
> 
> I do have a part that shows how I do it in my Tutorial, if you can be troubled to read it.
> 
> ...


A question about the tutorial... Would it be very different if i didnt compile everything from ports like you did but rather install the binaries with pkg?


----------



## Snurg (Mar 27, 2021)

gomster said:


> I have a full hd screen but the resolution that i get on my tty and my x server with awesome wm is from what i can tell 800x600. The nvidia settings are not even found on the system. I have installed the nvidia drivers with pkg and have made the appropriate changes to loader.conf and rc.conf as shown in the video...


I didn't watch the video, but you might want to know that x11/nvidia-settings has been put into a separate port, for reasons I am unable to understand.

It is version 460 only, and I have no idea whether it is backward-compatible with older versions' ports.

But I have the feeling there is something other wrong. Mind to post Xorg.0.log and the output of `pciconf -lv | grep -A4 vgapci` ?


----------



## gomster (Mar 27, 2021)

Snurg said:


> I didn't watch the video, but you might want to know that x11/nvidia-settings has been put into a separate port, for reasons I am unable to understand.
> 
> It is version 460 only, and I have no idea whether it is backward-compatible with older versions' ports.
> 
> But I have the feeling there is something other wrong. Mind to post Xorg.0.log and the output of `pciconf -lv | grep -A4 vgapci` ?


Cant do it because i screwed something up and the machine wont boot, so because this is a fresh install anyways with nothing on it, i’ll just install it again. I tried switching from vt to sc, i dont really know why but i kinda feel out of options so i gave it a try. When i boot the usb from the boot menu the resolution is 800x600 again and it just does not change even on an installed os for me...


----------



## shkhln (Mar 27, 2021)

gomster said:


> I do however have hybrid graphics.


You what? What do you want from Nvidia then?


----------



## gomster (Mar 27, 2021)

shkhln said:


> You what? What do you want from Nvidia then?


well its a laptop with an nvidia gpu and intel integrated graphics. Back on arch i did not use hybrid graphics although i could have. I rather only used my nvidia card. I planned to do the same thing when i came to freebsd. What do i want from nvidia? Drivers for my gpu... i have installed them but my screen res keeps being a problem so because i’m new to the os i’m not sure what the problem is and i thought that i perhaps did something wrong with installing the drivers. How i installed the drivers is also described on this thread...


----------



## shkhln (Mar 27, 2021)

gomster said:


> Back on arch i did not use hybrid graphics although i could have. I rather only used my nvidia card.


I see. The proper driver for your "Nvidia" card is /boot/modules/i915kms.ko from the drm-kmod package.


----------



## Snurg (Mar 27, 2021)

gomster said:


> I tried switching from vt to sc


sc() is said to be UEFI-incompatible. So this won't work.


shkhln said:


> You what? What do you want from Nvidia then?


Are you saying he should just take out the Nvidia card and use the onboard one? Edit: I see its a laptop...
So he enjoys the KMS nightmare instead?  

gomster
When people ask for output of particular commands or log files, you should not ignore this.
The pciconf output, for example, would tell which card(s) is/are active.


----------



## gomster (Mar 27, 2021)

shkhln said:


> I see. The proper driver for your "Nvidia" card is /boot/modules/i915kms.ko from the drm-kmod package.


Thank you for answering


----------



## gomster (Mar 27, 2021)

Snurg said:


> Snurg said:
> 
> 
> > sc() is said to be UEFI-incompatible. So this won't work.
> ...


Thanks for info about sc. i will stick to vt since i uefi. Kms nightmare? I didnt ignore any request for specifying the output of commands, the thing is that as i have mentioned b4, I’m reinstalling my system so i cant enter any commands to provide the output at this point but I’ll be happy to do it tommorow when i reinstall the os, since currently my disk is wiped.


----------



## Snurg (Mar 27, 2021)

Good, then post the `pciconf` output after you got the install done.
This will show which hardware is active, so we know which drivers are the ones to be used.


----------



## Deleted member 30996 (Mar 28, 2021)

gomster said:


> A question about the tutorial... Would it be very different if i didnt compile everything from ports like you did but rather install the binaries with pkg?


Yes,  you can use pkg instead of ports and I say that you can.

I still haven't heard you say you've done everything it says to do though.

Have you installed emulators/linux_base-c7?

x11/nvidia-settings?

x11/nvidia-xconfig?

Ran the `nvidia-xconfig` command?

Been in the BIOS to set Graphics to Discreet?

These are the questions I should not have to be asking you by now.

And if you're getting a fresh start, do try not to do any unnecessary tweaking of things. Right now that means anything it doesn't mention in that Tutorial. That's where a lot of people mess up. Worry about your resolution after you get to the desktop.


----------



## gomster (Mar 28, 2021)

Trihexagonal said:


> Yes,  you can use pkg instead of ports and I say that you can.
> 
> I still haven't heard you say you've done everything it says to do though.
> 
> ...


No need to ask again but thanks for reminding. I will install them on my fresh install as I have mentioned before. Shkhln mentioned this driver- /boot/modules/i915kms.ko from the drm-kmod package... , so should i get that as well? As for unnecessary tweaking; I dont and did not plan on doing anything unnecessary before getting the basic stuff on the system straight.


----------



## Deleted member 30996 (Mar 28, 2021)

That Tutorial has a target audience of someone just coming from Windows who has never used the commandline.

However, I believe you would benefit from skipping that part and follow the steps from instillation of 3rd party programs to the end, using pkg, to set up your Nvidia drivers and see if that doesn't get you to the desktop. Then we will know exactly what you've done and how to address any problems you might encounter.

I want you to succeed but you need to do things in an orderly fashion and let FreeBSD take care of the tuning for now. It should only take 1-2 hours to get everything installed by pkg and you should be ready to boot to the desktop for the first time. If you follow those steps you've got a good chance of it happening.

If it doesn't find screens then we know where to start from and you won't become needlessly frustrated.
Me either.


----------



## T-Daemon (Mar 28, 2021)

Trihexagonal said:


> I still haven't heard you say you've done everything it says to do though.
> 
> Have you installed emulators/linux_base-c7?
> 
> x11/nvidia-settings?


Why do you recommend to install those? None of them are necessary for the  x11/nvidia-driver driver to work.



Trihexagonal said:


> x11/nvidia-xconfig?
> 
> Ran the `nvidia-xconfig` command?


It's explicitly recommended NOT to run any X configuration utilities, only in case it's not working without the in the Xorg integrated default configuration.



Trihexagonal said:


> Been in the BIOS to set Graphics to Discreet?





Trihexagonal said:


> I want you to succeed but you ned to do things in an orderly fashion


A very good advice, and the first action in the order here is to check if it's possible to disable the integrated INTEL graphics of the laptop from UEFI (UEFI according to OP in #7).

If this is not possible, then all recommendations regarding NVIDIA are useless. What then remains is what shkhln recommends in #13: Install graphics/drm-kmod for  INTEL graphics.


----------



## T-Daemon (Mar 28, 2021)

gomster said:


> the machine that i’m on is a laptop with hybrid graphics- nvidia and intel integrated...


Which brand and model is the laptop? Can the integrated graphics processor be disabled from UEFI?


gomster said:


> have installed the nvidia drivers with pkg and have made the appropriate changes to loader.conf and rc.conf as shown in the video...


If the video recommends to enable in /boot/loader.conf and in /etc/rc.conf the NVIDIA kernel module then it's incorrect. The proper way to do this is from /etc/rc.conf.

After installing the port/package x11/nvidia-driver a message is displayed. It gives instructions how to enable the kernel module. The message can be shown again executing `pkg info -D nvidia-driver`



gomster said:


> doas vim /etc/rc.conf
> kld_list="linux nvidia nvidia-modeset"


Set only "nvidia" or "nvidia-modeset", not both. See `pkg info -D nvidia-driver` which one to use.



gomster said:


> I've also edited /boot/loader.conf with the following:
> 
> linux_load="YES"
> nvidia_load="YES"
> ...


Remove those, all of them.

But none of the recommendations will work if the integrated INTEL graphics can't be disabled.

Please check your UEFI if there is an option to disable the INTEL graphics. If you are unsure give the brand and model of the laptop. There might be an hint to this topic in online manuals.


----------



## Deleted member 30996 (Mar 28, 2021)

T-Daemon said:


> Why do you recommend to install those? None of them are necessary for the  x11/nvidia-driver driver to work.


It's the way I do it.



T-Daemon said:


> It's explicitly recommended NOT to run any X configuration utilities, only in case it's not working without the in the Xorg integrated default configuration.


It's the way I do it.



T-Daemon said:


> A very good advice, and the first action in the order here is to check if it's possible to disable the integrated INTEL graphics of the laptop from UEFI (UEFI according to OP in #7).


That's done by switching to Discreet in the BIOS.



T-Daemon said:


> If this is not possible, then all recommendations regarding NVIDIA are useless. What then remains is what shkhln recommends in #13: Install graphics/drm-kmod for  INTEL graphics.


It's how I get my boxen with Nvidia and Optimus running. And as previously state I do a lot of things differently never having read the Handbook once and teaching myself to use FreeBSD. Such as never having used fstab.

Nobody is forcing him to follow that Tutorial. Now that you're here you can guide him through the steps and take over from here as far as I'm concerned. I've got a W520 with Optimus to finish setting up now. Thank you for taking up the slack.

In fact, why don't you write a Beginners Tutorial and tell them how to do it right. That would be of great service to FreeBSD and the Community in general. 


What do you think the chances are I'll post a question asking how to get Optimus running?


----------



## gomster (Mar 28, 2021)

T-Daemon said:


> Which brand and model is the laptop? Can the integrated graphics processor be disabled from UEFI?
> 
> If the video recommends to enable in /boot/loader.conf and in /etc/rc.conf the NVIDIA kernel module then it's incorrect. The proper way to do this is from /etc/rc.conf.
> 
> ...


I have looked at uefi before and now again and there are no options that disable intel integrated graphics. The only things i can tweak with the cpu are virtualization,  turbo mode (on/off) and hyperthreading.

thanks for explaining the thing from the video for the nvidia drivers but i have formatted my disk, since i want a new clean install...


----------



## gomster (Mar 28, 2021)

T-Daemon said:


> Why do you recommend to install those? None of them are necessary for the  x11/nvidia-driver driver to work.
> 
> 
> It's explicitly recommended NOT to run any X configuration utilities, only in case it's not working without the in the Xorg integrated default configuration.
> ...


The intel graphics cant be disabled... So that would mean that my gpu is pretty much useless on this os with this setup?


----------



## shkhln (Mar 28, 2021)

Trihexagonal said:


> That's done by switching to Discreet in the BIOS.
> 
> It's how I get my boxen with Nvidia and Optimus running. And as previously state I do a lot of things differently never having read the Handbook once and teaching myself to use FreeBSD. Such as never having used fstab.


That's how got your laptop to run _without_ Optimus, since you effectively disabled it. However, it's only possible to so on old (< 2012) laptops or (very few) high-end models. Those settings require a hardware multiplexer and modern laptops are _thoroughly_ cost optimized.


----------



## Deleted member 30996 (Mar 28, 2021)

shkhln said:


> That's how got your laptop to run _without_ Optimus, since you effectively disabled it. However, it's only possible to so on old (< 2012) laptops or (very few) high-end models. Those settings require a hardware multiplexer and modern laptops are _thoroughly_ cost optimized.


That's how I get my box that originally shipped with Win7 and comes equipped with Optimus to run using the nvidia driver for best performance, They are all left plugged in to the power source from the time I start using them till I stop and power consumption is not an issue with me.

I want to leave a large carbon footprint so I won't be forgotten.

In the far distant future, happening right now, there is a Tour Guide...



> Here we have the footprint of the Triceratops, one of the great lizards of the late Cretaceous Period.
> 
> And this, Gynoids and Androids, is the Pride of our exhibit. The carbon footprint of Trihexagonal. Who introduced the Terminators into the timeline. Praise be to Skynet...


----------



## monwarez (Mar 28, 2021)

You could try this set of patches https://reviews.freebsd.org/D22521 .
Note that those patches are a little bit out of sync with the current port tree, so you will need to use a diff editor to correct it accordingly.

I use it with a GTX 960M using the following version: 390.141 .

PS: I use the intel integrated graphics with graphics/drm-kmod for my desktop, and launch specific application with `nvrun-vgl` to launch it on the Nvidia card.


----------



## T-Daemon (Mar 29, 2021)

gomster said:


> The intel graphics cant be disabled... So that would mean that my gpu is pretty much useless on this os with this setup?


You can use the INTEL graphics with graphics/drm-kmod, or try monwarez solution in post #28.


----------



## Deleted member 30996 (Mar 30, 2021)

Here's the W520 I was working on with Nvidia Quadro 1000M running...


----------



## alphachi (Jun 16, 2021)

At last, x11/nvidia-hybrid-graphics was committed:





						192617 – [NEW PORT] x11/nvidia-hybrid-graphics:  NVIDIA secondary GPU configuration - Optimus Technology support
					






					bugs.freebsd.org
				



Now we support Nvidia Optimus.


----------

