无法在 tty 上运行 startx

无法在 tty 上运行 startx

我最近从win10切换到Ubuntu,因为我不再用它玩游戏了。当我安装它时,我只能访问我的桌面(gdm3),但分辨率为 800x600,看起来很糟糕。

现在我安装了所有必要的驱动程序,我获得了完整的 1920x1080 分辨率,但无法访问 GUI。 (我无法退出 tty1。)

解决了:使用集成显卡 (intel) 作为主显卡:sudo prime-select intel

它是这么说的:

>sudo startx

X.Org X Server 1.19.6
Release Date: 2017-12-20
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.4.0-119-generic x86_64 Ubuntu
Current Operating System: Linux <machine name> 4.15.0-30-generic #32-Ubuntu SMP Thu Jul 26 17:42:43 UTC 2018 x86_64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.15.0-30-generic root=UUID=<uuid> ro  quiet splash pci=noaer 3
Build Date: 13 April 2018 08:07:36PM
xorg-server 2:1.19.6-1ubuntu4 (For technical support please see http://www.ubuntu.com/support)
Current version of pixman: 0.34.0
    Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (II) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: /var/log/Xorg.2.log", Time: Sat Aug 11 20:56:06 2018
(==) Using config file: "/etc/X11/xorg.conf"
(==) Using config directory: /etc/X11/xorg.conf.d"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"

这就是它冻结并且不再生成任何输出的地方。我就这样放了两个小时,没有任何变化。

我使用的是配备 gtx960M 和 Ubuntu 18.04 的 MSI 笔记本电脑。根据要求提供更多信息。

有人可以告诉我如何解决这个问题吗?因为我的工作真的需要这个笔记本......

驱动器输出:

>ubuntu-drivers devices

== sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==
modalias : pci:v000010DEd0000139Bsv00001462sd00001150BbcO3sc02i00
vendor   : NVIDIA Corporation
model    : GM107M [GeForce GTX 960M]
driver   : nvidia-driver-390 - third-party free
driver   : nvidia-driver-396 - third-party free recommended
driver   : xserver-xorg-video-nouveau - distro free builtin 

冻结#2

[ OK ] Started Daily apt download activities.
[ OK ] Listening on UUID daemon activation socket.
[ OK ] Started Discard unused blocks once a week.
       Starting Socket activation for snappy daemon.
[ OK ] Started CUPS Scheduler.
[ OK ] Listening on ACPID Listen Socket.
[ OK ] Started Message of the Day.
[ OK ] Started Daily apt upgrade and clean activities
[ OK ] Started ACPI Events Check.
[ OK ] Reached target Paths.
[ OK ] Started Trigger anacron every hour.
[ OK ] Listening on CUPS Scheduler.
[ OK ] Reached target Timers.
[ OK ] Listening on D-Bus System Message Bus Socket.
[ OK ] Listening on Socket activation for snappy daemon.
[ OK ] Reached target Sockets.
[ OK ] Reached target Basic System.
       Starting System Logging Service...
       Starting LSB: Record successful boot for GRUB...
       Starting Thermal Daemon Service...
       Starting LSB: Speech Dispatcher...
[ OK ] Started D-Bus System Message Bus.
[ OK ] Reached target Login Prompts.
       Starting Accounts Service...
       Starting Login Service...
       Starting Avahi mDNS/DNS-SD Stack...
[ OK ] Started Run anacron Jobs.
[ OK ] Started CUPS Scheduler.
       Starting rng-tools.service...
       Starting WPA supplicant...
       Starting LSB: automatic crash report generation...
       Starting Network Manager...
       Starting Restore /etc/resolv.conf if the system crashed before the ppp link was shut down...
[ OK ] Started irqbalance daemon.
       Starting Dispatcher daemon for systemd-networkd...
       Starting Detect the available GPUs and deal with any system changes...
[ OK ] Started Set the CPU Frequency Scaling governor.
       Starting Bluetooth service...
[ OK ] Started Regular background program processing daemon.
       Starting Disk Manager...
[ OK ] Started ACPI event daemon.
       Starting Save/Restore Sound Card State...
       Starting Modem Manager...
       Starting Snappy daemon...
[ OK ] Started System Logging Service.
[ OK ] Started Restore /etc/resolv.conf if the system crashed before the ppp link was shut down.
[ OK ] Started Save/Restore Sound Card State.
[ OK ] Started Thermal Daemon Service.
[ OK ] Started Login Service.
[ OK ] Started LSB: Speech Dispatcher.
[ OK ] Started LSB: automatic crash report generation.
[ OK ] Started rng-tools.service.
       Starting Authorization Manager...
[ OK ] Started Detect the available GPUs and deal with any system changes.
[ OK ] Started Bluetooth service.
[ OK ] Reached target Bluetooth.
[ OK ] Started Avahi mDNS/DNS-SD Stack.
[ OK ] Started Make remote CUPS printers available locally.
       Starting Hostname service...
[ OK ] Started LSB: Record successful boot for GRUB.
[ OK ] Started Authorization Manager.
[ OK ] Started Raise network interfaces.
[ OK ] Started Accounts service.
[ OK ] Started Modem Manager.
[ OK ] Started Hostname Service.
[ OK ] Started Disk Manager. 

nvidia-smi / uname -r

>nvidia-smi

Sat Aug 11 23:01:59 2018
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 396.51                 Driver Version: 396.51                    |
|-----------------------------------------------------------------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 960M    Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   49C    P8    N/A /  N/A |     13MiB /  2004MiB |      0%      Default |
+-----------------------------------------------------------------------------+


+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      1164      G   /usr/lib/xorg/Xorg                             7MiB |
|    0      2023      G   /usr/bin/gnome-shell                           5MiB |
+-----------------------------------------------------------------------------+

>uname -r

4.15.0-30-generic

lspci

>lspci -knn | grep VGA -A3

00:02.0 VGA compatible controller [0300]: Intel Corporation HD Graphics 530 [8086:191b] (rev 06)
    Subsystem: Micro-Star International Co., Ltd. [MSI] HD Graphics 530 [1462:115b]
    Kernel modules: i915
00:14.0 USB controller [0c03]: Intel Corporation Sunrise Point-H USB 3.0 xHCI Controller [8086:a12f] (rev 31)

提前致谢,

莉迪亚

答案1

首先删除 nvidia 驱动程序:

sudo apt purge nvidia-*

接下来让Ubuntu安装推荐的396驱动程序:

sudo ubuntu-drivers autoinstall

重新启动您的笔记本电脑:

sudo reboot

由于已经使用Ubuntu 18.04,所以默认启用图形环境:

sudo systemctl set-default graphical.target

如果您想在没有 GUI(多用户环境)的情况下从当前会话启动 Gnome 桌面,只需执行:

sudo systemctl start gdm3.service

更新

由于使用的是混合显卡,因此需要安装在和显卡nvidia-prime之间切换(已经可以安装):intelnvidia

sudo apt install nvidia-prime

检查正在使用哪个显卡:

prime-select query

您可以看到intelnvidia作为命令的输出。如果您看到intel,请切换到nvidia

sudo prime-select nvidia

重新启动并检查图形是否正常。如果prime-select query返回nvidia,请尝试切换到intel

sudo prime-select intel

重新启动并查看是否一切正常。如果没有帮助,请在命令的问题输出文本中发布:

sudo lshw -c display

答案2

注意:最好将其添加为鲍勃答案的评论,但我对此没有足够的声誉。

我遇到了同样的问题(虽然没有遵循更新)@Bob 的回答和评论也帮助了我(我认为......我遵循了步骤)。但此外,我想说以下命令没有启动 GUI:

$ sudo systemctl start gdm3.service 

所以我尝试了以下命令,它启动了我的 gdm3.service GUI :

$ sudo service gdm3 start

相关内容