Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem of abnormal resolution display after installing video card driver in Linux

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to solve the problem of abnormal resolution display after installing the graphics card driver in Linux". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "how to solve the problem of abnormal resolution display after installing the graphics card driver in Linux".

Driver installation:

It has to be explained here that there are imperfections in installing the new graphics card driver, that is, there is no visual pattern of the progress circle when you boot into the system, and it is very likely that you have to modify the resolution in order to display normally, but after installing the video card driver, you can use the desktop special effects that come with the system (very cool), while using the default noveau has a visual progress circle, and the resolution is not normal. You can also force changes, but you cannot use the desktop effects that come with the system. All the methods are introduced later, and you can choose by yourself.

1. Download the driver of the corresponding video card model (format: xxxxx.run) from the official website of NIVIDIA.

The command to find your video card information under Linux is: lspci | grep VGA

two。 Turn off the video card driver nouveau that is installed by default on the system:

1) vim/etc/modprobe.d/blacklist.conf, add blacklist nouveau at the end of the file

2) rebuild image:

Mv / boot/initramfs-$ (uname-r). Img / boot/initramfs-$ (uname-r). Img.bak

Dracut-v / boot/initramfs-$ (uname-r). Img $(uname-r)

3. Install gcc kernel-devel (driver compilation tool):

Yum-y install gcckernel-devel

(this requires you to match the yum source. This blog also has an article that briefly introduces the configuration of the yum source.)

4. Enter the graphical interface:

Init 3

5. Log in to root, enter the path where the xxx.run driver is located, and execute: sh xxx.run

(after the driver is installed, there will be a very awkward situation, that is, 3D acceleration can be used for rendering, that is, desktop effects can be used, but the resolution is super small and abnormal, so you have to modify the resolution.)

Resolution settings:

First of all, we have to make it clear that the resolution modification here is not perfect, because, after all, it is a compulsory modification, but I am an obsessive-compulsive disorder, so I made some late remedies after the compulsory modification, so generally speaking, this imperfect modification is acceptable compared to the resolution that is as flat as a mound.

There are two ways to force resolution changes:

First, use the default graphics card to drive nouveau

If you use the default video driver, you do not need to close nouveau, just execute the following command to force the resolution change:

1) cvt 19201080 60 / / 19201080 is the resolution you want 60 is the refresh rate

Execution result:

# 1920x1080 59.96 Hz (CVT 2.07M9) hsync: 67.16kHz; pclk: 173.00 MHz

Modeline "1920x1080_60.00" 173.00 1920 2048 2248 2576 10801083 1088 1120-hsync + vsync

Note: 173.00 1920 2048 2248 2576 1080 1083 1088 1120-hsync+vsync this data is very important and needs to be used later.

2) xrandr-newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 10801083 1088 1120-hsync + vsync

Note that the data used here "173.00 1920 20482248 2576 1080 1083 1088 1088 1120-hsync+vsync" is the data obtained in the first step above, and "1920x1080_60.00" is the name of the new schema defined by yourself. If you want the resolution to be 800x600, of course you can change it to "800x600" or "800x600_60.00".

3) xrandr-addmode VGA-0 "1920x1080_60.00"

Note that the VGA-0 here is not fixed, but is determined according to the specific device. It may be either VGA-0,VGA-1 or DIV1,DIV0. You can check which device is currently connected through the xrandr instruction. Generally, you can see a * * connected xxxx in the first few lines of the output information of the xrandr instruction. This is the device you want to use. The "1920x1080_60.00" parameter of the above instruction is the resolution mode added in the second step.

4) xrandr-output VGA-0-mode "1920x1080_60.00"

VGA-0 and "1920x1080_60.00" parameters have the same meaning as above, guess what.

After this step is done, you will find that the resolution has been modified, but after a restart, you will find that it has returned to the original low resolution, so you can make a script here to automatically execute this script every time you log in, then as long as you log in, you will automatically change the resolution, and the system will report an "abnormal xxx" error, but this will not affect your use.

Scripting:

1.vim xrandr-config.sh

two。 Enter in the xrandr-config.sh file:

#! / bin/bash

Xrandr-newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 10801083 1088 1120-hsync + vsync

Xrandr-addmode VGA-0 "1920x1080_60.00"

Xrandr-output VGA-0-mode "1920x1080_60.00"

(note that all the above operations are moved to a script, but the first step, cvt xxxx, is omitted. Because the results obtained by cvt xxx are fixed, we can record the data of the first step and put it directly into the second part.)

3. Save vim / etc/profile after launch, and add the path and name of xrandr-config.sh at the end of the file. If I put it in / root/Documents, add / root/Documents/xrand-config.sh at the end of / etc/profile.

4. Restart, after the user logs in, the script will be automatically executed to force the resolution change.

Second, force the resolution to be modified after installing the video card driver

The steps are the same as above, and there is the same problem after restart. The script written here has no effect after restart.

But there is a good solution, after installing the Nvidia driver, the system will have a Nvidia x serversettings program. After executing the script to modify the resolution, click to open the Nvidia x serversettings program, and then select x server display configuration in the left directory. At this time, there is a saveto x configuration file button on the lower right exit and help button. Click Save, and the next time you open it, you can automatically modify the resolution!

Finally, there is another problem, that is, after modifying the resolution, you may encounter a very strange font display, just because the font is small, just right-click to change the desktop background, and then select the font. Choose all the fonts to be larger than one or two sizes, and you can display them perfectly.

At this point, I believe you have a deeper understanding of "how to solve the problem of abnormal resolution display after installing the graphics card driver in Linux". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report