# Gnome does not start



## txerrenak (Apr 8, 2022)

Hello
FreeBSD does not start the graphical interface (Gnome). It stays in "login:". If I login as user or superuser and run "startx", I get:

Fatal server error:
no screens found
...
Server terminated with error (1). Closing log file
xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: server error

My /etc/rc.conf is as follows:

sendmail_enable="NONE"
hostname="freebsd"
keymap="en.kbd"
ifconfig_em0="DHCP"
sshd_enable="YES"
moused_enable="YES"
ntpd_enable="YES"
dumpdev="AUTO"
kld_list="nvidia nvidia-modeset linux linux64"
dbus_enable="YES"
hald_enable="YES"
gdm_enable="YES"
gnome_enable="YES"
vmware_guest_enable="YES" vmware_guest_enable="YES"
linux_enable="YES"

My /etc/fstab is as follows:

/dev/ada0p2 / ufs rw 1 1
/dev/ada0p1 /boot/efi msdosfs rw 2 2
/dev/ada0p3 none swap sw 0 0
proc /proc procfs rw rw rw 0 0 0

In /etc/X11/xorg.conf I have the following:

Section "ServerLayout"
Identifier "X.org configured"
Screen 0 "Screen0" 0 0
Screen 1 "Screen1" RightOf "Screen0" 0 0 0 0
InputDevice "Mouse0" "CorePointer" InputDevice "Mouse0" "CorePointer" "CorePointer" "CorePointer
InputDevice "Keyboard0" "CoreKeyboard" "CoreKeyboard" "CorePointer
Option "AutoAddDevices" "Off"
EndSection
...
Section "Device"
Identifier "Card0"
Driver "nvidia"
BusID "PCI:1:0.0" BusID "PCI:1:0.0" BusID "PCI:1:0.0
EndSection
...

And in ~/.xinitrc I have

exec gnome-session

I'm driving myself crazy looking at texts and videos, and I can't seem to get the problem unstuck.


----------



## grahamperrin@ (Apr 8, 2022)

txerrenak said:


> … I'm driving myself crazy looking at texts and videos, …



Start afresh, beware of outdated texts and videos.

Anything that suggests HAL or hald is outdated, and so on.



txerrenak said:


> `kld_list="nvidia nvidia-modeset linux linux64"`



You don't need both `nvidia` _and_ `nvidia-modeset`. List just one. 

Be aware of x11/nvidia-xconfig.

What's your graphics card, exactly?


----------



## txerrenak (Apr 8, 2022)

I'm not a computer scientist -- I'm just a long-time Linux user. So your first few paragraphs are beyond me. I also don't know how to figure out what my graphics card is. I've searched the web for instructions and haven't found them.


Maybe it's one of these two: TU104GL (Quadro RTX 4000) or Cannon Lake PCH (it's a March 2020 ASUS D940MX computer).

With dmesg I don't see any message from HAL.


----------



## grahamperrin@ (Apr 8, 2022)

2001 is a distant memory. HAL is retired. : freebsd

More simply: your `hald_enable="YES"` line is non-effective because, from a FreeBSD perspective, the related software died more than a year ago. 

Rest in peace (RIP):






(My point was, to *beware of outdated documentation* etc.)

If you're new-ish to FreeBSD, FreshPorts is our friend. 

<https://www.freshports.org/faq.php#deleted>


----------



## grahamperrin@ (Apr 8, 2022)

txerrenak said:


> … Maybe it's one of these two: TU104GL (Quadro RTX 4000) …



<https://bsd-hardware.info/?probe=4e798f3ef0&d=hellosystem> a few months ago (2021-10-10) showed `TU104GL [Quadro RTX 4000]`_ working_ <https://bsd-hardware.info/?probe=4e798f3ef0&d=hellosystem#pci:10de-1eb1-10de-12a0> on a version of helloSystem that's now outdated; helloSystem was (then) based on FreeBSD 12.2-RELEASE. So I'm hopeful that graphics in your ASUS D940MX will work with more recent 13.0-RELEASE or (coming soon) 13.1-RELEASE.

At the bsd-hardware.info page there's the word `nvidia` for the driver, however (as far as I can tell) this does *not* imply that you should specify `nvidia` instead of `nvidia-modeset` in your `kld_list` line. 

Unfortunately, the FreeBSD Handbook can be a source of confusion, with regard to NVIDIA, and re: <https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=258264#c12> I don't foresee an improvement in the near future. 

If it's possible for you to start afresh (with a new installation of FreeBSD), it may be simpler for you than attempting to manually configure X.Org. 

(If a configuration produced by `/usr/local/bin/nvidia-xconfig` is not enough, then maybe think about manual configuration ….)


----------



## mendenlama (Apr 8, 2022)

txerrenak said:


> ...
> kld_list="nvidia nvidia-modeset linux linux64"
> dbus_enable="YES"
> hald_enable="YES"
> ...


Why vmware_guest_enable doubled? Do you run FreeBSD in a vmware hypervisor? In that case you don't need the nvidia driver.


----------



## lapagalia (Apr 9, 2022)

mendenlama said:


> Why vmware_guest_enable doubled? Do you run FreeBSD in a vmware hypervisor? In that case you don't need the nvidia driver.


No. That was my mistake.


----------



## lapagalia (Apr 9, 2022)

grahamperrin said:


> <https://bsd-hardware.info/?probe=4e798f3ef0&d=hellosystem> a few months ago (2021-10-10) showed `TU104GL [Quadro RTX 4000]`_ working_ <https://bsd-hardware.info/?probe=4e798f3ef0&d=hellosystem#pci:10de-1eb1-10de-12a0> on a version of helloSystem that's now outdated; helloSystem was (then) based on FreeBSD 12.2-RELEASE. So I'm hopeful that graphics in your ASUS D940MX will work with more recent 13.0-RELEASE or (coming soon) 13.1-RELEASE.
> 
> At the bsd-hardware.info page there's the word `nvidia` for the driver, however (as far as I can tell) this does *not* imply that you should specify `nvidia` instead of `nvidia-modeset` in your `kld_list` line.
> 
> ...


I have reinstalled FreeBSD. I have executed the following operations after installing it:

- pkg update
- pkg upgrade
- pkg install xorg
- pkg nvidia-driver-340
- pkg nvidia-xconfig
- kldload nvidia
- sysrc kld_list+=nvidia
- sysrc enable_linux="YES"
- nvidia-xconfig
- startx

... and I have got...

NVIDIA: Failed to initialize the NVIDIA kernel module
...
No devices detected
...
Fatal server error:
no screens found
...
xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: server error

MORE INFO:
I have two graphic cards:
* NVIDIA: TU104GL [Quadro RTX 4000] --> pci0:1:0:0
* Intel: CoffeeLake-S GT2 [UHD Graphics 630] --> pci0:0:2:0


----------



## grahamperrin@ (Apr 9, 2022)

lapagalia said:


> `… nvidia-driver-340
> …`





lapagalia said:


> … two graphic cards:
> * NVIDIA: TU104GL [Quadro RTX 4000] --> pci0:1:0:0
> * Intel: CoffeeLake-S GT2 [UHD Graphics 630] --> pci0:0:2:0



Please, why x11/nvidia-driver-340?

x11/nvidia-driver is currently version 510.60.02, which supports Quadro RTX 4000; <https://www.nvidia.com/Download/driverResults.aspx/187164/en-us>


----------



## Bluey (May 7, 2022)

I believe the best way to get Nvidia running is to use the proprietary installer from Nvidia - does everything it needs to. (have posted elsewhere here what it did but it was so long ago....)

https://www.nvidia.com/en-us/drivers/unix/freebsd-x64-archive/


----------



## Alexander88207 (May 8, 2022)

Its recommended to use the provided version by ports/pkg.


----------



## Bluey (May 8, 2022)

Alexander88207 said:


> Its recommended to use the provided version by ports/pkg.


Except that people posting using that are having problems. Mine is working stably for weeks and I have been watching NetFlix daily.


----------



## kpedersen (May 8, 2022)

Bluey said:


> Except that people posting using that are having problems. Mine is working stably for weeks and I have been watching NetFlix daily.


Even so, you are missing out on all these patches:

https://cgit.freebsd.org/ports/tree/x11/nvidia-driver/files

https://cgit.freebsd.org/ports/tree/x11/nvidia-driver/Makefile

Once you do something outside of a web browser and Netflix, you might run into issues. Particularly with upgrades when a new version comes out and ports/packages expect files in specific places.


----------



## Bluey (May 9, 2022)

The Nvidia supplied version is newer than the current Makefile.






						FreeBSD x64 Graphics Driver Archive | NVIDIA
					

FreeBSD x64 Graphics Driver Archive



					www.nvidia.com
				



FreeBSD Display Driver – x64​Version: 510.68.02
 Operating System: FreeBSD x64
 Release Date: April 26, 2022

https://cgit.freebsd.org/ports/tree/x11/nvidia-driver/Makefile
PORTNAME?=    nvidia-driver
DISTVERSION?=    510.60.02


----------



## kpedersen (May 10, 2022)

Bluey said:


> The Nvidia supplied version is newer than the current Makefile.


Indeed. Which means it is not yet integrated with the ports tree and such "out of tree" packages could cause conflicts with any existing packages. Not to mention it is still missing out on the FreeBSD patches.

What is fairly typical to do however is simply bump the version up in the port Makefile, regenerate the checksums and rebuild it. This does tend to work (and gives you the benefits of the patches if they still apply cleanly).

Think of the upstream NVidia blob just as a code dump. It still needs cleaning and fixing by the FreeBSD developers before it should be considered for production. The ports collection has automated this somewhat.


----------



## grahamperrin@ (May 31, 2022)

txerrenak did you get GNOME to start?


----------

