In the previous article, "fully using Deepin Linux for entertainment, work, and study (1)", I simply shared with you the basic experience about Deepin Linux. For Deepin Linux, which has its good also has its shortcomings, I believe that anyone, anything, anything is not innate, are slowly polished out, as we grew up, need to go through a lot of things to really grow up. Also we need to give it enough time, believe it to tolerate it, slowly it will grow up, after all, it is still young.
??????? Today I just in my personal notebook, and you share about the graphics card driver part of the installation and configuration, I hope to give you a guiding role, which inevitably there will be some mistakes, I hope not to mislead you, welcome to correct, so that we better pass this information to other Deepin system enthusiasts.
??????? Because my notebook is a dual graphics card, that is Intel+nvidia graphics combination. Let's just say a little bit about the Intel+nvidia graphics portfolio, Nvidia's Optimus technology allows notebooks to automatically switch between Intel integrated graphics and Nvidia for performance needs, in order to save energy and balance performance dual needs, But this technology only supports Windows systems. Optimus Technology is not dependent on the hardware complex structure of the Crossfire graphics card to achieve the discrete graphics on-demand rendering and transmission to integrated graphics, integrated video card is responsible for the display function. When the laptop is powered by a power supply, the discrete graphics card is turned off to extend the battery life. Thanks to the Linux author Linus Torvalds has put a finger on nvidia in an activity in Finland, which has enabled Nvidia engineers to implement Optimus functionality on Linux, but so far it has not been able to be truly commercially available.
??????? To address this dilemma, the community has provided another solution that Bumblebee,bumblebee has been working on to implement Nvidia's Optimus technology under Linux, but so far it has not been fully resolved, such as the automatic switching of graphics cards. Here I would like to say Bumblebee on the whole process of tossing.
1, may encounter the pit
??????? I encountered a lot of pits when I installed the video driver, the following pits are limited to the Dell XPS 9560 4 K, the other models of the machine are not specifically clear:
Pit One: after the installation of the system directly update the system CPU consumption 100%, basically no way to operate, about this part of the reason is not only the graphics card driver, the following we will explain.
Pit Two: install the driver through Deepin Linux Drive Manager, restart the notebook black screen, set Windows2009 through grub is also invalid.
Pit III: install bumblebee through the Deepin Linux graphics Driver Manager, or hang it.
2, the right posture of the jump pit
Personal measurements correctly installs the graphics-driven posture:
1) through the command line installation of the closed-source version of the unique driver (try to install the Nvidia official closed-source driver was unsuccessful, according to view the relevant information, said that it is necessary to close the set display, and then perform the installation of a single display driver, this I did not toss).
2) After installing the closed source version of the driver, configure grub and then restart the notebook.
3) Install the large Huang Feng, and then restart the notebook.
4) test set display and single display switch (switching process requires a restart of the notebook, you can use a program alone to call the driver, do not need to restart the notebook.) ), the graphics driver installation is complete.
3. Install the Independent graphics driver
CTRL+ALT+F2 Enter Tty2 mode, and then log in. (as described here in the Deepin wiki knowledge Base, you can do this without entering TTY mode, depending on your personal test.) )
Stop LIGHTDM Service First
sudo systemctl stop LIGHTDM #关闭登录管理器服务
If the driver is installed, uninstall the old version driver first
sudo apt-get remove--purge nvidia*
Installing Console-setup
sudo apt-get install Console-setup
Install in-source version driver (for closed source version)
sudo apt-get install Nvidia-driver
Verify that the driver is installed successfully
sudo apt-get install mesa-utils
Note: Install Mesa-utils This package to display information about the GLX of the system.
Optirun Glxinfo|grep NVIDIA
Server GLX Vendor String:nvidia Corporation
OpenGL Vendor String:nvidia Corporation
OpenGL Core profile version string:4.5.0 NVIDIA 387.34
OpenGL Core Profile Shading language version string:4.50 NVIDIA
OpenGL version string:4.6.0 NVIDIA 387.34
OpenGL Shading language version string:4.60 NVIDIA
4, fixed restart the computer black screen situation
??????? Because of the support of the new notebook, 16 after the notebook may appear after the installation of the single display driver, if you immediately restart the notebook may appear black screen, hangs or freezes, so after the installation of the driver, we need to configure grub, and then let the system boot through the set to start.
Vi/etc/default/grub
Modify:
GRUB_CMDLINE_LINUX_DEFAULT="splash quiet"
For:
GRUB_CMDLINE_LINUX_DEFAULT="splash quiet acpi_osi=! acpi_osi=‘Windows 2009‘"
(Note: Both single and double quotes are English characters)
Rebuilding the Grub configuration file
sudo update-grub
This time the Grub.cfg file will be updated, of course, we can also directly modify the Grub.cfg file, located in/boot/grub/grub.cfg.
Note that the configuration does not acpi_osi=! acpi_osi=‘Windows 2009‘
apply to all laptops, for different PC settings, some need to be set to: acpi_osi="!Windows 2015"
, refer to the following links:
https://github.com/Bumblebee-Project/Bumblebee/issues/764#issuecomment-234494238
5, Installation Bumblebee
??????? First we need to understand the function of Bumblebee, at the beginning we also said that Bumblebee is Optimus Technology in the implementation of Linux. Bumblebee attempts to simulate the behavior of Optimus Technology by using a discrete graphics card for rendering when needed, and shutting down when it is not needed.
#安装Bumblebee (for closed-source drives)
sudo apt-get install bumblebee-nividia primus nvidia-settings
Primus is an option for improving performance, nvidia-settings for graphical interface settings.
#查看对应bumblebee版本
Bumblebeed--version
Bumblebeed (Bumblebee) 3.2.1
Copyright (C) the Bumblebee Project
License gplv3+: GNU GPL version 3 or later This was free software:you was free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
When you see your bumblebeed version is 3.2.1, congratulations, your computer comes with a power management feature out of the box, and it doesn't need to be set up.
After installing the nvidia-settings, we may use the following command to set the display alone or to see the unique temperature.
#调用nvidia显卡设置选项
Optirun Nvidia-settings-c: 8
6. Verify that the bumblebee is working properly
??????? After installation, restart the computer for Bumblebee to take effect, test whether Bumblebee support Optimus function, if you see in the terminal on Nvidia tips and gear rotation of the graphical interface, congratulations Bumblebee Optimus Technology has begun to work.
#验证命令
Optirun Glxgears-info
Gl_renderer?? = GeForce GTX 1050/pcie/sse2
Gl_version??? = 4.6.0 NVIDIA 387.34
Gl_vendor???? = NVIDIA Corporation
7, Deepin Graphics management tool driver switch
??????? In front of the command line to install the closed-source graphics driver, in fact, we can also through the Deep Graphics Driver management tool to drive the switch, where the big Huang Feng solution can be switched to the Nvidia open source driver, here to thank the Forum friend Woodelf doubts.
We can switch the graphics driver through Deepin Graphics management tool, before switching to: Big Huang Feng scheme.
After switching to manually restart the computer, in this process will restart two times the computer, into the desktop prompt switch success.
???????? But after the switch driver found that the working state of the State for the long-term open, according to Woodelf is because the Nouveau driver for my unique support is poor, so that the unique in the normally open state.
Lspci | grep NVIDIA
01:00.0 3D controller:nvidia Corporation gp107m [GeForce GTX 1050 Mobile] (Rev A1)
Rev A1 means on, Rev FF is off.
During the test it was found that when I switched back from the Nvidia open source drive to the big Huang Feng scenario, the switchover failed. (no longer described here, the beginning of the second)
8, interpretation of bumblebee work mode
??????? We can switch the graphics work mode via the sudo update-glx--config GLX command, which is Bumblebee Auto mode by default, but we can switch the mode manually.
So what's the difference between the three things below?
option one: mesa-diverted
The 3D effect can be turned on under Deepin Linux, and on my computer, it will support Intel's set hardware rendering and support OpenGL 3.0.
Glxinfo | grep render
Direct Rendering:yes #开启直接渲染
OpenGL renderer String:mesa DRI Intel (R) kabylake GT2? #使用Intel集显硬件渲染.
Glxinfo | grep OpenGL
OpenGL Vendor String:intel Open Source Technology Center
OpenGL renderer String:mesa DRI Intel (R) Kabylake GT2
OpenGL Core Profile version string:4.5 (core profile) Mesa 13.0.6
OpenGL Core Profile Shading language version string:4.50
OpenGL Core Profile Context Flags: (none)
OpenGL Core profile Profiles Mask:core profile
OpenGL Core Profile Extensions:
OpenGL version string:3.0 Mesa 13.0.6 #支持OpenGL版本
OpenGL Shading Language version string:1.30
OpenGL Context Flags: (none)
OpenGL Extensions:
OpenGL es profile version string:opengl es 3.2 Mesa 13.0.6
OpenGL ES profile Shading language version String:opengl es GLSL es 3.20
OpenGL ES Profile Extensions:
But it also has two other ways of working:
The first is to not turn on direct rendering, which is rendered by indirect hardware.
Direct Rendering:no (Libgl_always_indirect set)
OpenGL renderer String:mesa DRI Intel (R) Kabylake GT2
The second is to turn on direct rendering, but with software rendering.
Direct Rendering:yes
OpenGL renderer String:software Rasterizer
From the performance of these three ways of working, direct hardware rendering speed is the fastest, followed by indirect hardware rendering, the slowest is software rendering.
For a single display we can use the Primusrun to confirm whether the hardware rendering is supported by the single display.
Primusrun Glxinfo | grep render
Direct Rendering:yes
OpenGL renderer String:geforce GTX 1050/pcie/sse2
option two: Nvidia
In Deepin Linux does not support the opening of 3D effects, simply said it does not support 3D display, only support 2D display. Using the glamor mode, glamor is a 2D acceleration method using OpenGL.
option Three: Bumblebee manual mode
Temporarily not clear bumblebee manual and automatic mode What is the difference, want to know the friend in the back message to inform.
9. Test whether the video card supports 2D or 3D
??????? Glxgears is a popular OpenGL test that renders very simple gears with output frame rate. Although Glxgears can test the graphics driver's direct rendering capability, it is obsolete and does not represent the current status of the Gnu/linux graphics display and the full capabilities of OpenGL. Glxgears only tested a small subset of OpenGL features. The performance improvements embodied in the glxgears are not felt in the game. It's not really perfect for testing graphics performance, so "Glxgears is not a benchmark".
1) test set display
Glxgears
Running synchronized to the vertical refresh.? The framerate should be
Approximately the same as the monitor refresh rate.
304 frames in 5.0 seconds = 60.702 FPS
Frames in 5.0 seconds = 59.996 FPS
Frames in 5.0 seconds = 59.997 FPS
Frames in 5.0 seconds = 59.997 FPS
2) test alone display
Primusrun Glxgears
301 Frames in 5.0 seconds = 60.107 FPS
Frames in 5.0 seconds = 59.997 FPS
Frames in 5.0 seconds = 60.000 FPS
Frames in 5.0 seconds = 59.995 FPS
??????? When testing performance, we will find that whether it is a single display or a set is not more than 60FPS, this is because of the cause of the screen. In fact, the bumblebee design at the beginning of the frame rate of more than 60FPS dropped operations to avoid useless calculations, if you need to test all the graphics card fps, you can turn off the vertical synchronization and then test.
3) Turn off vertical sync test set Display
Vblank_mode=0 Glxgears
13583 frames in 5.0 seconds = 2716.592 FPS
20703 frames in 5.0 seconds = 4140.438 FPS
38129 frames in 5.0 seconds = 7625.753 FPS
38583 frames in 5.0 seconds = 7716.458 FPS
35381 frames in 5.0 seconds = 7076.138 FPS
37755 frames in 5.0 seconds = 7550.912 FPS
39684 frames in 5.0 seconds = 7936.765 FPS
38865 frames in 5.0 seconds = 7772.929 FPS
4) Turn off the vertical sync test alone
Vblank_mode=0 Primusrun Glxgears
14129 frames in 5.0 seconds = 2825.743 FPS
15388 frames in 5.0 seconds = 3077.595 FPS
15437 frames in 5.0 seconds = 3087.335 FPS
14720 frames in 5.0 seconds = 2943.999 FPS
13834 frames in 5.0 seconds = 2766.678 FPS
11818 frames in 5.0 seconds = 2363.512 FPS
13979 frames in 5.0 seconds = 2795.728 FPS
15798 frames in 5.0 seconds = 3159.472 FPS
10. Test Graphics Performance
For video card performance testing, you can use the Unigine Heaven 4.0 tool for testing.
: Http://m11-assets.unigine.com/d/Unigine_Heaven-4.0.run
After downloading, authorization executable permission, then unzip, enter the corresponding directory, execute heaven.
Chmod–r 777./unigine_heaven-4.0.run
Sh./unigine_heaven-4.0.run
CD unigine_heaven-4.0
1) Set dominant performance test
./heaven
Click "Run" to go in and press F9, then click "Benchmark" to test. (Note: The individual uses the default benchmark for testing)
Set Test results:
2) Single dominant ability test
Optirun./heaven
Test results alone:
??????? From the test results, the performance is significantly higher than the set display, but because the personal notebook installed only Deepin Linux single system, so there is no way under Windows to test the corresponding graphics performance is better than Linux.
10, the application call alone display method
In bumblebee mode, if we need to run a program or game with a single display, the terminal executes the following command:
#使用独显运行command程序
Optirun command or Primusrun command
#桥接方式
Optirun-b Primus command #使用独显运行command程序 to improve performance.
For example, run VirtualBox:
sudo optirun virtualbox# run with single display (Nvidia graphics card) VirtualBox
When we start and close the VirtualBox with n cards, we can use the command to see if the standalone graphics are running, and when the program with the Optirun command shuts down, the system will automatically turn off the display (Nvidia graphics card).
#当独显开启virtualbox时, video card status
Optirun--status
Bumblebee Status:ready (3.2.1). X is PID 4125, 2 applications using Bumblebeed.
#当独显关闭virtualbox时, video card status
Optirun--status
Bumblebee Status:ready (3.2.1). X Inactive. Discrete video card is off.
Of course, we can also use it to run browsers and other programs, such as: Optirun VMware, Optirun Firefox, etc.
#独显运行特定应用小技巧
???????? If you need to render a lot of programs, you do not want to start from the command line every time, you can modify the/usr/share/applications/<application>.desktop file, after the exec= add Primusrun or Optirun is followed by the program path and name so that when you double-click the corresponding app icon, it will run the corresponding app with a single display.
11, written in the last
??????? Personally, there is no way to perfectly understand bumblebee, after all, I am not a graphics driver developer, but hope that the above narrative can help you, solve the puzzle caused by the graphics card driver.
Full Deepin Linux Entertainment, work, learning (2)--graphics driver