# Console stay blank after terminated the startx



## Soky (Apr 1, 2017)

The handbook at 5.4.3. Kernel Mode Setting (KMS) did not help:
/boot/loader.conf

```
kern.vty=vt
```
Because unable to starting xfce4 so no chance to see the error message.


----------



## aragats (Apr 1, 2017)

You didn't tell what version of FreeBSD you run and what graphics card you have.



Soky said:


> kern.vty=vt


It won't turn the KMS on, it just tells the kernel to use new consoles which is on by default in FreeBSD 11.

For KMS you have to add (e.g. for Intel graphics) to /boot/loader.conf:
	
	



```
i915kms_load="YES"
```


----------



## Soky (Apr 1, 2017)

aragats said:


> You didn't tell what version of FreeBSD you run and what graphics card you have.
> 
> 
> It won't turn the KMS on, it just tells the kernel to use new consoles which is on by default in FreeBSD 11.
> ...


Sorry I did'nt think this is so card depend like X server.
I have a nvidia geforce gt 220 card. Is there similair config for that?
freebsd-version: 11.0-RELEASE-p8


----------



## aragats (Apr 2, 2017)

For my NVidia Quadro K2200 I have the following in /boot/loader.conf:
	
	



```
nvidia_modeset_load="YES"
nvidia_modeset_name="nvidia-modeset"
```
(Of course, you should have NVidia driver installed)


----------



## Soky (Apr 2, 2017)

aragats said:


> For my NVidia Quadro K2200 I have the following in /boot/loader.conf:
> 
> 
> 
> ...


But I have an old GT 220 card so I have been istalled nvidia-driver-340 for it. Therefore not exist _nvidia-modeset _module. I can not figure out how configure the loader (or KMS or what?) that get back console after X.
Possibly how can I inspect the loading process to see where is the error?


----------



## aragats (Apr 3, 2017)

Just checked another computer with Quadro FX 580 (it was released before GT 220), I have the following packages installed:
	
	



```
$ pkg info | grep nv
. . . .
nvidia-driver-340-340.96_4
xf86-video-nv-2.1.20_7
. . . .
```
In /boot/loader.conf I have only:
	
	



```
nvidia_load="YES"
```
Everything works properly.


----------



## Soky (Apr 3, 2017)

aragats said:


> Just checked another computer with Quadro FX 580 (it was released before GT 220), I have the following packages installed:
> 
> 
> 
> ...


Thank you, the drivers and /boot/loader.conf are exatly same as yours but I dont get back my console 
`kldstat`

```
Id Refs Address            Size     Name
 1   15 0xffffffff80200000 1fa8888  kernel
 2    1 0xffffffff821aa000 e137c0   nvidia.ko
 3    2 0xffffffff82fbe000 9b748    linux.ko
 4    2 0xffffffff8305a000 de28     linux_common.ko
 5    1 0xffffffff83221000 3710     ums.ko
```
Module has been loaded so X able to start.
I try it by `startx`. The very old scool window manager starting with 3 terminal and a clock. I terminate it by Ctrl+D key.
`tail Xorg.0.log`

```
[    95.098] (**) sysmouse: (accel) acceleration factor: 2.000
[    95.098] (**) sysmouse: (accel) acceleration threshold: 4
[    95.098] (II) sysmouse: SetupAuto: hw.iftype is 4, hw.model is 0
[    95.098] (II) sysmouse: SetupAuto: protocol is SysMouse
[    95.098] (II) config/devd: device /dev/ums0 already opened
[   245.044] (II) config/devd: terminating backend...
[   245.044] (II) UnloadModule: "mouse"
[   245.044] (II) UnloadModule: "kbd"
[   245.272] (II) NVIDIA(GPU-0): Deleting GPU-0
[   245.284] (II) Server terminated successfully (0). Closing log file.
```
Should not be any info in any log about switch back?


----------



## Soky (Apr 4, 2017)

aragats said:


> Just checked another computer with Quadro FX 580 (it was released before GT 220), I have the following packages installed:
> 
> 
> 
> ...


Could you list the loadaed modules please? I can not figures out what missing for properly working.


----------



## SirDice (Apr 4, 2017)

As far as I know the NVidia driver has support for KMS from version 364.12 onwards. With the legacy 340 version you shouldn't have an issue with KMS because it doesn't use it.


----------



## Soky (Apr 4, 2017)

SirDice said:


> As far as I know the NVidia driver has support for KMS from version 364.12 onwards. With the legacy 340 version you shouldn't have an issue with KMS because it doesn't use it.


Then what should be switch back the console? Someting is missing from xorg.conf?
Which is:
/usr/local/etc/X11/xorg.conf.d/driver-nvidia.conf

```
Section "Device"
        Identifier  "Card0"
        Driver      "nvidia"
EndSection
```


----------



## SirDice (Apr 4, 2017)

How does the machine boot? Is it using UEFI or legacy boot? UEFI boot may have enabled KMS but the legacy NVidia driver isn't KMS aware, so it never switches back.

Try switching to the 'old' sc(4) console. 


```
kern.vty=sc
```


----------



## Soky (Apr 4, 2017)

SirDice said:


> How does the machine boot? Is it using UEFI or legacy boot? ...


Legacy, MBR.


----------



## Soky (Apr 4, 2017)

SirDice said:


> ...
> Try switching to the 'old' sc(4) console.
> 
> 
> ...


This is not helped.


----------



## aragats (Apr 4, 2017)

Soky said:


> Could you list the loaded modules please? I can not figures out what missing for properly working.




```
$ kldstat
Id Refs Address            Size     Name
 1   38 0xffffffff80200000 1fa7c38  kernel
 2    1 0xffffffff821a9000 30aec0   zfs.ko
 3    2 0xffffffff824b4000 adc0     opensolaris.ko
 4    2 0xffffffff824bf000 9b748    linux.ko
 5    3 0xffffffff8255b000 de28     linux_common.ko
 6    1 0xffffffff82569000 ad80     vkbd.ko
 7    1 0xffffffff82574000 e137c0   nvidia.ko
 8    1 0xffffffff83421000 adec     tmpfs.ko
 9    1 0xffffffff8342c000 a9f1     linprocfs.ko
10    1 0xffffffff83437000 3710     ums.ko
11    1 0xffffffff8343b000 2a05     uhid.ko
12    1 0xffffffff8343e000 849e     cuse.ko
```
/usr/local/etc/X11/xorg.conf.d/10-nvidia.conf:
	
	



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

Section "Screen"
   Identifier     "Screen0"
   Device         "Device0"
   Monitor        "Monitor0"
   DefaultDepth    24
EndSection
```


----------



## Soky (Apr 4, 2017)

aragats said:


> ```
> $ kldstat
> Id Refs Address...
> ```




```
Thank you, I'm afraid this is not help me. From this I do not see what is missing.
```


----------



## Soky (Apr 5, 2017)

Soky said:


> This is not helped.





SirDice said:


> ...Try switching to the 'old' sc(4) console.
> 
> 
> ```
> ...


How can I check which console running actually? Maybe I mispelled or I have written to wrong file...


----------



## tobik@ (Apr 5, 2017)

Soky said:


> How can I check which console running actually? Maybe I mispelled or I have written to wrong file...


`sysctl kern.vty`


----------



## Soky (Apr 5, 2017)

tobik@ said:


> `sysctl kern.vty`


Thank you, the result is:

```
kern.vty: sc
```
So the config achieved its purpose.
The question is: *what* (and how should) *swicth it back to console?*


----------



## Soky (Apr 6, 2017)

Ok if do not work in software then I going to insert another card.
The first one: NVIDIA NVS 300
Driver is the same: nvidia-driver-340
Lumina desktop able to start but switch back to console do not.


----------



## Soky (Apr 6, 2017)

Second: RV710 Radeon HD 4350
I commented out the sc, nvidia suff from loader.conf and renamed config in xorg.conf.d
Lumina desktop can starting and then *I got back the console!*
Maybe I stay with this.


----------



## SirDice (Apr 6, 2017)

To be honest I'm all out of ideas why it's not working for you. I don't think it's related to KMS or the NVidia driver since the same setup works for others.


----------



## Soky (Apr 6, 2017)

SirDice said:


> To be honest I'm all out of ideas why it's not working for you. I don't think it's related to KMS or the NVidia driver since the same setup works for others.


Now I see the *radeonkms.ko* by `kldstat` command.
In the nvidias case did not seen any kms-like module. You mentioned it has not that function at all.
But this (RV710) card is piteous under TrueOS... (in this machine of course)


----------



## angeryman (Apr 15, 2017)

SirDice said:


> How does the machine boot? Is it using UEFI or legacy boot? UEFI boot may have enabled KMS but the legacy NVidia driver isn't KMS aware, so it never switches back.
> 
> Try switching to the 'old' sc(4) console.
> 
> ...




I use nvidia quadro K620 boot from UEFI, console is blank after terminate X. 

But it is normal if I boot from legacy.

Is there any ideas?


----------

