Hardware Model
Command query, terminal execution:
lspci |grep -i ‘VGA‘ #查看默认集成显卡型号lspci |grep -i nvidia #查看NVIDIA类型的显卡型号sudo dmesg | grep -i ‘VGA‘ #通过查看开机信息获取显卡信息
Hardware Temperature
ATI graphics Card
A closed-source graphics driver needs to be installed, and then the terminal executes:
sudo aticonfig --odgt
NVIDIA graphics
A closed-source graphics driver needs to be installed, and then the terminal executes:
sudo nvidia-settings -q GPUCoreTemp -t
installing the closed source drive
Attention:
1, after the installation of Linux system, will be enabled by default, the kernel comes with open source drive, open source drive Although performance is not as close source drive, but compatibility and stability is excellent.
2, if the system is not a problem, it is not recommended to install closed-source driver.
ATI graphics card
Installation
Due to the slow update of the ATI graphics card's closed source driver, it is recommended to install the version in the source, and it is not recommended to install the official ATI version.
Command Automatic Installation
Install the in-source version, terminal execution:
sudo apt-get install fglrx-driver #安装驱动包
Unloading
command is unloaded, the terminal executes (if the boot fails to enter X, it enters the TTY execution command):
sudo apt-get purge fglrx* glx-alternative-fglrx libgl1-fglrx* #删除驱动包
nvidia Graphics
Installation
1) Automatic command installation
Install the in-source version, terminal execution:
sudo apt-get install nvidia-driver #安装驱动包
If the above command does not install the driver properly, the terminal should perform:
ubuntu-drivers list #检测合适的驱动包
Then use the following command to install the corresponding driver package, for example, the test result is nvidia-legacy-340xx-driver
sudo apt-get install nvidia-legacy-340xx-driver #安装驱动包
2) Manual Installation
Note: Install Nvidia official. Run drivers are likely to have problems and it is recommended that you use the in-source version, as appropriate.
The browser accesses the NVIDIA website, downloads the closed-source driver installation files that match your hardware, and places the driver installation files in your home directory (for example, the driver file is "Nvidia-linux-x86_64-352.55.run").
Then press the shortcut key "Ctrl+alt+f2", enter Tty2, and then log in to the system, execute the following command:
Stop LIGHTDM Service First
sudo systemctl stop lightdm #关闭登录管理器服务
If the driver is installed, uninstall the old version driver first
Disable Nouveau If you have previously used Nouveau
Then install NVIDIA official driver
chmod u+x NVIDIA-Linux-x86_64-352.55.run #赋予可执行权限sudo ./NVIDIA-Linux-x86_64-352.55.run #安装驱动文件
There may be suspended animation in the installation process, please wait patiently. Reboot after installation if no graphical interface is present, try
sudo systemctl start lightdm
Unloading
If the command is installed automatically, the terminal performs the following command to uninstall:
sudo apt-get remove nvidia-driver nvidia-kernel-dkms glx-alternative-nvidia
If you are installing manually, the terminal performs the following commands to uninstall:
sudo nvidia-uninstallsudo nvidia-installer --uninstall
Dual Graphics
At present, the graphics card manufacturers on the Linux platform support is poor, dual graphics has been a Linux problem.
But with the latest information, Nvidia is starting to support dual graphics technology for Linux platforms!
Intel & ATI
Turn off single display
Method One:
When power on, according to the screen prompts into the motherboard settings, will be set to not enable the single display.
Method Two:
The module that switches the video card under linux3.06 is still in the debug state, and the modules are loaded first
sudo mount -t debugfs debugfs /sys/kernel/debug
And then
sudo cat /sys/kernel/debug/vgaswitcheroo/switch
To see if you can switch the video card, the normal output is similar to:
0:DIS: : Pwr:0000:01:00.01:IGD:+:Pwr:0000:00:02.0
Here off means the power is off, and the PWR says it is running.
If there is no output, then I'm sorry, this method is useless, may be the Linux kernel over the old switch command
echo DDIS > sudo /sys/kernel/debug/vgaswitcheroo/switch #用来切换到独立显卡echo DIGD > sudo /sys/kernel/debug/vgaswitcheroo/switch #用来切换到集成显卡echo OFF > sudo /sys/kernel/debug/vgaswitcheroo/switch #这个命令是用来关闭不用的显卡电源echo ON > sudo /sys/kernel/debug/vgaswitcheroo/switch #这个是用来重新开启关闭的显卡电源
In general, if you want to disable discrete graphics, we execute the third command
echo OFF > sudo /sys/kernel/debug/vgaswitcheroo/switch
You can look at the status of the/sys/kernel/debug/vgaswitcheroo/switch file again.
sudo cat /sys/kernel/debug/vgaswitcheroo/switch
If the output is
0:DIS: :Off:0000:01:00.01:IGD:+:Pwr:0000:00:02.0
That's a sign of success. (Here off means the power is off and the PWR says it is running.) )
At this point, you can add the rc.local (sudo gedit/etc/rc.local #编辑rc. local file)
sudo mount -t debugfs debugfs /sys/kernel/debugecho OFF > /sys/kernel/debug/vgaswitcheroo/switch
Note: Exit 0 in the Rc.local file must be at the end of the file.
Every time after the power off automatically turn off the unused video card and off without a video card.
Method Three
get permission; Terminal execution:
sudo -s
(1) switch to integrated graphics;
echo IGD > /sys/kernel/debug/vgaswitcheroo/switch
(2) Close the non-connected video card;
echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
Verify
cat /sys/kernel/debug/vgaswitcheroo/switch
Output:
1:IGD:+:Pwr:0000:00:02.00:DIS: :Off:0000:01:00.0
Off indicates that the standalone graphics card is off
You can add (1) (2) Two lines of code into the/etc/rc.local in the exit 0 before saving. The standalone video card can be disabled automatically at boot time.
Intel & NVIDIA
Turn off single display
When power on, according to the screen prompts into the motherboard settings, will be set to not enable the single display.
Single Display switch
Install a third-party bumblebee program that implements the Nvidia Optimus, which executes in the terminal:
sudo apt-get install bumblebee-nvidia primus #安装Bumblebee-nvidia(适用于闭源驱动),其中primus可选,用于提升性能sudo apt-get install bumblebee primus #安装Bumblebee(适用于开源驱动)
sudo update-glx --config glx #切换显卡的工作模式 选择的配置
注意 16年以后的新笔记本可能存在重新启用独显以后,造成系统冻结。
You can view bumblebee discussions and Linux bug discussions.
The workaround is to add parameters to the kernel in grub to prevent the system from freezing.
acpi_osi=! acpi_osi="Windows 2009"
Restarting the computer after installation has enabled the bumblebee to take effect, but Bumblebee is not able to automatically switch between a set (Intel graphics card) and a single display (Nvidia graphics card). The system runs with integrated graphics (Intel graphics) by default, and when you need to run a program or game with a single display (Nvidia graphics card), the terminal performs the following commands:
optirun command #使用独显运行command程序optirun -b primus command #使用独显运行command程序,提升性能
How Linux uses grub to add kernel parameters
If you are using the Grub boot loader and want to modify or add kernel parameters, you can edit the grub configuration file. The following is a method for adding kernel boot parameters to a specific release version of the grub configuration file.
Add kernel boot parameters to Debian or Ubuntu on a Debian-based system, if you want to add kernel parameters at system startup, you can edit the Grub configuration template under the/etc/default/grub directory. In the Grub_cmdline_linux_default variable,
“acpi_osi=! acpi_osi="Windows 2009"
"Format to add kernel parameters.
$ sudo-e/etc/default/grub grub_cmdline_linux_default= ' ... acpi_osi=! acpi_osi="Windows 2009
"'
Press CTRL + C to exit Y Save
Note: Sometimes the text needs to be added manually,
Then run the following command to generate a grub configuration file.
$ sudo update-grub If you cannot find the Update-grub command, you can install it by following the command.
$ sudo apt-get install grub2-common add kernel boot parameters to fedora on Fedora, to add kernel parameters at startup, you can edit the GRUB configuration template in the/etc/default/grub directory. Add kernel parameters in the Grub_cmdline_linux variable in the format "Name=value".
$ sudo-e/etc/default/grub grub_cmdline_linux= ' ...acpi_osi=! acpi_osi="Windows 2009“ ’
Then run the following command to generate the GRUB2 configuration file.
$ sudo grub2-mkconfig-o/boot/grub2/grub.cfg add kernel boot parameters on CentOS on CentOS, to add kernel parameters at startup, you can edit the grub configuration file directly/boot/grub/ Grub.conf. In the configuration file, locate the entry that describes the Linux image that is used by default. The string "Default=n" in the topmost line of the file indicates which entry is the default image.
Problems
If the installation of closed-source drivers, similar to the start-up animation disappears, the resolution is abnormal, the computer temperature greatly increased, mostly for the side effect of closed source drive, it is recommended to uninstall the closed source drive.
Download the official website of the closed source driver, update the new closed-source version of the driver, will randomly occur serious Vlinuz boot kernel compilation failed, resulting in the system can not boot to the graphical interface, and even if the compilation is successful, it does not guarantee that the closed source driver version number exactly corresponding, the same will cause the system can not boot to the graphical interface. It is relatively safe to use the closed-source drivers provided in the "additional driver", and the risk is low.
Solutions
In the event of a driver compatibility failure, other drivers in the "additional Driver" replacement list can be used in the case of a graphical interface, and the installation takes effect after rebooting. To enter recovery mode only, use the command:
sudo apt-get autoremove --purge nvidia-*
Press the "Enter" key to execute, wait a minute or so, the configuration is different, wait for a different length of time, the system will remove the driver installation files and related configuration files, restart after the restoration of the default graphics drivers and configuration.
Last use command:
sudo reboot
Ubuntu Debian Deepin Graphics installation and black screen card dead solution