Enable 3D acceleration in FreeBSD

Source: Internet
Author: User
Tags exit in
In the Windows world, 3D is a hot topic. Most games are based on 3D. However, in the * nix world, 3d seems to be not that important, and even some "Heroes" experts do not even know the existence of 3D functions. I tried my best to start my notebook's 3D function (the operating system uses FreeBSD), wandering around SourceForge and Google all day, and finally opened the 3D function after nearly a month's efforts, list the main problems:

(Statement: The content in this article is my personal understanding. Many of them may be incorrect. please correct me)

I. How to Implement 3D in FreeBSD.
In fact, this is not only the principle of FreeBSD, but also the principle of the entire * nix family.

The implementation of 3D functions is actually hierarchical, similar to the hierarchical model of OSI.

(1) At the top is the application layer, that is, applications apply for 3D rendering. This application uses a function call to call the 3D acceleration calling interface at the following layer.

(2) 3D acceleration function interface (API ). It converts applications at the application layer into system calls, so that the X system can deal with hardware. The most popular APIs include DirectX and OpenGL. In the * nix field, we have to mention a strange term in the Windows Field: Mesa. The most primitive Mesa is the implementation of OpenGL, And now mesa has made breakthroughs in many places. For details, see:
Http://www.mesa3d.org/
The interfaces between these functions and the X system are Glx. Glx is a protocol running on X. function calls can deal with X systems only after it is passed.

(3), dri. This is the most important part of 3D functionality.
DRI is direct rendering infrastructure, which can be understood as an interface between x and hardware. However, it contains many independent modules, responsible for all aspects from X to hardware, including the kernel.
Its main task is to convert the function calls of Mesa or OpenGL into hardware commands, so as to direct the hardware for rendering and other work.

(4). dri driver. This is a program directly related to hardware. It supports hardware.

Ii. Conditions for implementation

We can see from the previous introduction that the most important thing is to allow your dri to support your video card. Currently, in FreeBSD, dri supports the following system graphics cards (in/usr/src/sys/i386/CONF/Notes ):

Device DRM # DRM core module required by DRM drivers
Device i915drm # intel i830 through i915
Device mach64drm # ATI rage pro, rage mobility P/M, rage XL
Device mgadrm # AGP matrox G200, g400, g450, g550
Device r128drm # ATI rage 128
Device radeondrm # ATI radeon
Device savagedrm # S3 savage3d, savage4
Device sisdrm # SIS 300/305, 540,630
Device tdfxdrm # 3dfx voodoo 3/4/5 and banshee
If your video card is not listed on it, you must be prepared to open 3D!
If your video card is NVIDIA, Do not be sad. Then, you will find that you choose NVIDIA!
If your video card is listed above, you should not be too happy, because there are exceptions in these cases, such as my laptop video card: ati igp 340 m, it is difficult to implement a 3D model.

To test whether your video card can implement 3D functions, you can use the following methods:

(1): dmesg | grep AGP. If

Quote: agp0: <via 82c691 (Apollo Pro) host to PCI bridge> mem 0xe0000000-0xe3ffffff at device 0.0 on pci0

Your video card may implement 3D functions. If you have nothing, congratulations. You no longer have to worry about 3D functions. You should close this article without hesitation, you do not need to enable the new video card.
  
(2): kldload DRM. If no error is reported, your video card can basically implement 3D functions.
If you are sorry to report an error, your chances of success will be halved, or your hopes may not be high.
  
(3): the first two levels have passed, so you can experiment.

3. 3D functions.

1. General video card production:
(1): Install Xorg and KDE (GNOM is also supported ).

(2): Xorg-configure. In this way, there is an Xorg. conf. New file in my home, copy this file to/etc/X11/Xorg. conf.

(3): startx. At this time, three windows and a clock will appear. Some people may think that something went wrong. In fact, this is correct, because at this time, you have not yet entered KDE.

(4): Exit X. Enter exit in the leftmost window. Or press CTRL + ALT + backspace.

(5): CAT/var/log/xorg.0.log | grep "direct rendering enabled". If the following words appear,

Quote :( II) radeon (0): Direct rendering Enabled

Then your 3D is enabled.
If not, read/var/log/xorg.0.log carefully. It will tell you why it is not enabled in a row.

2. NVIDIA graphics card:
If you use a NVIDIA graphics card.
After the installation is complete, use kldstat to check whether the LINUX module is added. NVIDIA's manual says this is intended for compatibility. The FreeBSD driver is a pure FreeBSD driver and is not compatible with Linux. You can remove it. (/Boot/load. conf ).
After the installation is complete, start X again. At this time, a NVIDIA icon will appear before Kde, and it will soon flash over. (But I have no testing environment, or I can use a camera to take a picture .) This icon appears. The installation is successful.

Iv. Validation of 3D Functions

That is to say, how can we determine that 3D acceleration is enabled?

(1) the most formal one is to open a terminal and run glxinfo. In the second or third line, if the word "direct rendering: yes" appears, 3D acceleration is enabled.

(2) In practice, one of the best practices is to run the screen saver, select the ones with GL, and then test. If no card is displayed, it is enabled. The most obvious is fantasy.
If it can be smoothly displayed, it is enabled.

5. Possible Problems

(1) Your video card is not loaded.
Solution: search by Google or Baidu.

(2) If you use a shared memory video card, the problem persists.
Solution: If you can adjust the size of the shared memory in the bios, set it to> 16 Mb. If it cannot be adjusted, set "ramsize" to> 4096 in/etc/X11/Xorg. conf.

(3) The laptop video card of the IBM r40e system cannot be used. The old prompt is "not supported by AGP ".
Solution: upgrade to 6.1-release. This is a major improvement of 6.1-release, and solved the problem of my laptop graphics card. (Thanks to FreeBSD's Development Team !)

(4) My video card should be okay, but I still cannot enable 3D acceleration.
Solution: This question is hard to answer. Many video cards do not support the 24-or 32-Bit mode. Set it to 16-bit in/etc/X11/Xorg. conf. Many people are stuck in this place.

(5) What should I do if I want to enable the dual-display mode?
Solution: Go to man.

(6) What are the benefits of enabling 3D acceleration?
A: First, you can play quake. Second, all your graphics-related software is significantly accelerated. Third, you can watch a brilliant Screen Saver. Fourth, because a lot of work is done by the video card, it can significantly prolong your CPU life! Finally, you have your own reasons.

[This post was last edited by lsstarboy at, September 14]

Image Attachment: [Screen Saver]Pingbao.jpg(, 53.94 K)

Image Attachment: [3D feature enabled flag. (In xorg.0.log)]Dri_enable.jpg(, 4.17 K)


Image Attachment: [glxinfo display.]Glxinfo.jpg(, 84.76 K)

Image Attachment: [FB display.]Drm1.jpg(, 32.96 K

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.