# [SOLVED] how to install the NVIDIA proprietary driver



## chris35 (Aug 21, 2021)

Hello FreeBSD community !
I just start to use FreeBSD and really love it, but, working on a 27' monitor, (webdesigner) i'd prefer to use my 1660ti nvidia card instead of internal intel card...
I tried a lot of tutos and tested it, whole the last night, always awake  ... tried more than 10 times with xorg and xfce4 and slim, without success... I followed this https://docs.freebsd.org/doc/7.3-RELEASE/usr/share/doc/en/articles/compiz-fusion/nvidia-setup.html
and few others founded on the web but nothing worked, i probably did'nt saw the good one 
I used the nvidia-driver pkg but it stuck on the bootloader as explain on the docs.freebsd.org... is there a good full tuto to correctly do this please ?

thanks in advance for your help !
(and sorry for my bad english, its not my native language)


----------



## drhowarddrfine (Aug 21, 2021)

Chapter 5. The X Window System
					

This chapter describes how to install and configure Xorg on FreeBSD, which provides the open source X Window System used to provide a graphical environment




					docs.freebsd.org


----------



## chris35 (Aug 21, 2021)

Thanks doc, are you sure there is a xorg problem ?
I already instaled it, i followd thé Riba linux freebsd installation on YouTube, Step by step... and it works fine, except when try to install this nvidia driver


----------



## mer (Aug 21, 2021)

What version of FreeBSD?  Are you using a "RELEASE" channel? (Like FreeBSD-13 RELEASE)?  Reason for asking is the link you have talks about 7.3 which has been end of life, put out to pasture for a long time.
I'm assuming that everything worked fine with the internal Intel device?  If so that gives us a baseline (like your user is already part of the video group)

If so should be something like this (as root):

If you have anything in /boot/loader.conf relating to nvidia remove the lines.  You may need to do some stuff at the loader prompt to unload modules and boot to single user mode.

pkg install nvidia-driver
sysrc -f /etc/rc.conf kld_list+=" nvidia-modeset.ko nvidia.ko"  NOTE the space after the opening quote
Create /usr/local/etc/X11/xorg.conf.d/driver-nvidia.conf with the following contents:
`Section "Device"
    Identifier "NVIDIA Card"
    VendorName "NVIDIA Corporation"
    Driver "nvidia"
EndSection`

That should be enough to get it going.  To test, I would boot to a console instead of a graphical login, verify the modules are loaded with 
`kldstat | grep nvidia`

then type in "startx".


----------



## chris35 (Aug 21, 2021)

Yes Mer its à fresh install of v13 release, gona try it now many thanks !


----------



## mer (Aug 21, 2021)

chris35 said:


> Yes Mer its à fresh install of v13 release, gona try it now many thanks !


Good, that's what I was hoping.  The steps I listed above is all that I needed to do.  The keys are getting kld_list in /etc/rc.conf correct and the added file over in /usr/local/etc/X11/xorg.conf.d.  The first part says to actually load the modules on boot, the second tells X to load the nvidia driver.

You may also want to add the following to /boot/loader.conf:
hw.vga.textmode="1"

The nvidia drivers have (had?) issues if you switched from X to a different virtual console, they would just have different colored blocks on the screen.  That line prevents that and lets you actually use the virtual console.


----------



## chris35 (Aug 21, 2021)

i just installed the whole xorg xfce4 slim etc pkg's, sets the sysrc...enable=YES etc, and always on root, after all, installed the nvidia-driver, but got stuck after this part  I'm reinstalling all now


----------



## chris35 (Aug 21, 2021)

Just reinstall the whole system, log in on root user, install and set xorg xfce4 slim nvidia-driver etc pkg's, sets the sysrc...enable=YES etc,
kg install nvidia-driver
sysrc -f /etc/rc.conf kld_list+=" nvidia-modeset.ko nvidia.ko" NOTE the space after the opening quote
Create /usr/local/etc/X11/xorg.conf.d/driver-nvidia.conf with the following contents:

Section "Device"
    Identifier "NVIDIA Card"
    VendorName "NVIDIA Corporation"
    Driver "nvidia"
EndSection

done and before reboot, just tested "startx" and got
"fatal server error :
(EE) no screens found (EE)"

i dont still reboot cause i set a exec startxfce4 on my .xinitrc


----------



## Alexander88207 (Aug 21, 2021)

I never have used NVIDIA but these seems to be a good guide: https://forums.freebsd.org/threads/howto-setup-xorg-with-nvidias-driver.52311/


----------



## chris35 (Aug 21, 2021)

thanks Alex,already saw that, but this guide aged from 2015


----------



## chris35 (Aug 21, 2021)

then i reboot, and get stuck another way, dump loop and auto reboot


----------



## kpedersen (Aug 21, 2021)

Chapter 5. The X Window System
					

This chapter describes how to install and configure Xorg on FreeBSD, which provides the open source X Window System used to provide a graphical environment




					docs.freebsd.org
				






> If more than one video card is present, the BusID identifier can be uncommented and set to select the desired card. A list of video card bus IDs can be displayed with pciconf -lv | grep -B3 display.




```
Section "Device"
    Identifier "Card0"
    Driver     "nvidia"
    BusID    "PCI:1:0:0"  <--- may need to be set to what the previous command reports
EndSection
```

Perhaps this will hopefully help? I have never used a multi-card setup before admittedly.


----------



## mer (Aug 21, 2021)

The no screens.  Hmm.
Did you go into the BIOS and actually disable the Intel device and set it to use the Nvidia as default?  That may help.
Just for grins, rename your .xinitrc so you have a little more control.
startx should then give you the good old TWM.

You may need to add a "BusID" line to the file you created.  You should be able to get the value from pciconf command.
I see I was too slow, thanks kpedersen


----------



## chris35 (Aug 21, 2021)

is there a way to break the reboot loop or i again need to reinstall all ?


----------



## kpedersen (Aug 21, 2021)

chris35 said:


> is there a way to break the reboot loop or i again need to reinstall all ?


Are you rebooting the machine?

You should be able to use ctrl-alt-f1 to go back to the terminal (and change some things). I would also recommend avoiding desktop environments and display managers until Xorg is working correctly first. Just use startx to test.


----------



## chris35 (Aug 21, 2021)

kpedersen said:


> Are you rebooting the machine?


due to a fatal error it reboot alone on booting phase, CTRL+ALT+F1 dont stop it


----------



## mer (Aug 21, 2021)

kpedersen I think you are missing an "display" on the grep portion or
pciconf -lv | grep -B3 -i display


----------



## chris35 (Aug 21, 2021)

will reinstall again, without sets xinitrc... i just disable the internal CPU graphic card on my bios, only have this nvidia card and i5 internal graphic chipset


----------



## mer (Aug 21, 2021)

chris35 said:


> will reinstall again, without sets xinitrc... i just disable the internal CPU graphic card on my bios, only have this nvidia card and i5 internal graphic chipset


That should give you a good starting point.


----------



## chris35 (Aug 21, 2021)

just redo and the xorg log file tell me : no device specified for screen "Screen0"
i really start thinking coming back to archlinux...


----------



## kpedersen (Aug 21, 2021)

mer said:


> kpedersen I think you are missing an "display" on the grep portion or
> pciconf -lv | grep -B3 -i display


Ah I was quoting the handbook. Is there a typo in there? I think the only difference between your command is you are using *-i* for a case insensitive search.


----------



## shkhln (Aug 21, 2021)

chris35 said:


> i really start thinking coming back to archlinux...


That's really helpful. Post your _logs_, don't waste everyone's time with that kind of "threats".


----------



## mer (Aug 21, 2021)

kpedersen said:


> Ah I was quoting the handbook. Is there a typo in there? I think the only difference between your command is you are using *-i* for a case insensitive search.


Doh.  First day with my new brain.  I didn't read 'all the words' in your post


----------



## chris35 (Aug 21, 2021)

It show me


----------



## chris35 (Aug 21, 2021)

got it now, working on root user, gona try with my user ! Many thanks Mer and KPEdersen for your help !


----------



## mer (Aug 21, 2021)

Sweet!!  If your regular user is part of the video group it should just work.
Enjoy!


----------



## shkhln (Aug 21, 2021)

Nvidia doesn't care about the video group.


----------



## chris35 (Aug 21, 2021)

Working too ! Many thanks dude you are a gentle Man !


----------



## mer (Aug 21, 2021)

shkhln said:


> Nvidia doesn't care about the video group.


That may be true, but it's a trivial thing to do with the DRM stuff.


----------



## kpedersen (Aug 21, 2021)

Ah nice. Glad you made progress!


----------



## chris35 (Aug 21, 2021)

i'm sorry its not a driver problem, but i have 2 problems and don't find solutions that works :

i can't install anything using my user session, with terminal, no permissions
i can't open and use my internal SSD data drive witch is EXT4 fs...
XFCE session...


----------



## Tieks (Aug 21, 2021)

chris35 said:


> i can't install anything using my user session, with terminal, no permissions
> i can't open and use my internal SSD data drive witch is EXT4 fs...


Installing software  is a task for the super user. Use sudo in a terminal. For ext4 take a look at /usr/ports/sysutils/e2fsprogs.


----------



## mer (Aug 21, 2021)

chris35 said:


> i'm sorry its not a driver problem, but i have 2 problems and don't find solutions that works :
> 
> i can't install anything using my user session, with terminal, no permissions
> i can't open and use my internal SSD data drive witch is EXT4 fs...
> XFCE session...


su or sudo to install things
ext4 partitions:  if they are not mounted you may need to explicitly mount them or load the "fusefs" module.


----------



## chris35 (Aug 21, 2021)

installed SUDO while being root on console, relog into my user and got this

Password:
userx is not in the sudoers file.  This incident will be reported.


----------



## mer (Aug 21, 2021)

chris35 said:


> installed SUDO while being root on console, relog into my user and got this
> 
> Password:
> userx is not in the sudoers file.  This incident will be reported.


I think "visudo" to add your user to the sudoers file.


----------



## chris35 (Aug 21, 2021)

i saw a pkg :
fusefs-ext2-0.0.10_2           FUSE module to mount ext2, ext3 and ext4 with read write support
i need to put it in my rc.conf ? fusefs-ext2_load="YES" ?


----------



## kpedersen (Aug 21, 2021)

chris35 said:


> installed SUDO while being root on console, relog into my user and got this
> 
> Password:
> userx is not in the sudoers file.  This incident will be reported.


It is very similar to ArchLinux which you mentioned you were using before.

Your user needs to be allowed to request superuser permission and this is specified in /etc/sudoers. The `visudo`program offers checking of the file so should generally be used.

You can also use `su` (and type your root password.)


----------



## chris35 (Aug 21, 2021)

on arch, when you create your user you can directly use SUDO without doing nothing more (just need to be part of the wheel group, close the same  )


----------



## chris35 (Aug 21, 2021)

i solved with your help the SUDO problem by editing the sudoers files, removed comments before %wheel... and works fine, many thanks, but still cant mount my EXT4 internal SSD where i have all of my jobs in


----------



## Deleted member 30996 (Aug 21, 2021)

My boot/loader.conf  on the W520 I'm using now with Nvidia Quadro M1000:


```
linux_load="YES"
nvidia_load="YES"
nvidia-modset_load="YES"
```

I run:


Trihexagonal said:


> x11/nvidia-settings and x11/nvidia-xconfig.


----------

