NVIDIA/nvidia-drivers/ko

x11-drivers/nvidia-drivers는 nVidia 그래픽 카드용 상용 그래픽 드라이버입니다. 대신 사용하는 오픈 소스는 nouveau가 있습니다.

트리에 있는 엔비디아 드라이버는 nVidia가 출시하며 리눅스 커널에 대응하여 빌드합니다. 카드와의 엄청난 양의 데이터를 주고받는 바이너리 블롭이 포함되어 있습니다. 드라이버는 두 부분으로 나뉘는데 하나는 커널 모듈이고 다른 하나는 X11 드라이버 입니다. 두 부분은 단일 패키지에 포함되어 있습니다. nVidia가 자체적으로 드라이버를 꾸러미에 담아두므로 드라이버를 설치하기 전에 어떤걸 사용할지 선택해야 합니다.

nvidia-drivers 패키지에는 엔비디아의 모든 카드를 지원하는 최신 드라이버와 카드가 얼마나 오래됐는지의 여부에 따라 다양한 버전이 들어있습니다. 어떤 카드를 사용하는지 감지하는 eclass를 사용하므로 적당한 버전을 설치합니다.

하드웨어 호환성
꾸러미에서는 다양한 엔비디아 카드를 지원합니다. 가지고 있는 카드에 따라 설치할 여러가지 버전이 존재합니다. 어떤 nvidia-drivers 버전을 사용해야 하는지에 대해서는 구형 드라이버란 무엇인가? 라는 공식 엔비디아 문서를 보십시오. 여기 에서 제공하는 대화형 양식을 통해 꽤 괜찮은 방법으로 이 문서를 찾아 볼 수도 있습니다. 가지고 있는 그래픽 카드를 입력('제품 형식' 필드에 Legacy 옵션이 있습니다) 하면 양식 하단에서 지원하는 가장 최상의 버전을 찾을 수 있습니다.

가지고 있는 카드가 구형 카드임을 확인했다면 의 최근 릴리즈를 가려야 합니다. 예를 들자면:

젠투에서는 71.86.xx 버전을 제공하지 않음을 참고하십시오. 이 드라이버가 필요하다면 nouveau 드라이버를 사용하시는것이 낫습니다.

Kernel
As mentioned above, the nVidia kernel driver installs and runs against your current kernel. It builds as a module, so your kernel must support the loading of kernel modules (see below).

The kernel module (nvidia.ko) consists of a proprietary part (commonly known as the "binary blob") which drives your graphics chip(s), and an open source part (the "glue") which at runtime acts as intermediary between the proprietary part and the kernel. These all need to work nicely together or you could be faced with data loss (through kernel panics, X servers crashing with unsaved data in X applications) and even hardware failure (overheating and other power management related issues should spring to mind).

Kernel compatibility
From time to time, a new kernel release changes the internal ABI for drivers, which means all drivers that use those ABIs must be changed accordingly. For open source drivers, especially those distributed with the kernel, these changes are nearly trivial to fix since the entire chain of calls between drivers and other parts of the kernel can be reviewed quite easily. For proprietary drivers like nvidia.ko, it doesn't work quite the same. When the internal ABIs change, you cannot merely fix the "glue", because you cannot know how the glue is used by the proprietary part. If you do manage to patch things up and things seem to work nicely, you still risk that running nvidia.ko in your new, unsupported kernel will lead to data loss and hardware failure.

When a new, incompatible kernel version is released, it is probably best to stick with the newest supported kernel for a while. Nvidia usually takes a few weeks to prepare a new proprietary release they think is fit for general use. Just be patient. If you want to throw all caution to the wind, the nvidia-drivers ebuilds do support the epatch_user command from eutils.eclass: this allows you to patch nvidia-drivers to somehow fit in with the latest, unsupported kernel release you want to run. Do note that neither the nvidia-drivers maintainers nor Nvidia will support you when you run into trouble. Your hardware warranty will most likely be void, Gentoo's maintainers cannot begin to fix your issues since it's a proprietary driver that only Nvidia can properly debug, and the kernel maintainers (both Gentoo's and its upstream) will certainly not support proprietary drivers, or indeed any "tainted" system that happens to run into trouble.

Required kernel options
If you used genkernel all to configure the kernel for you, then you're all set. If not, double check your kernel configuration so that this support is enabled:

You also need to enable Memory Type Range Register in your kernel:

Also, if you have an AGP graphics card, you can optionally enable agpgart support to your kernel, either compiled in or as a module. If you do not use the in-kernel agpgart, then the drivers will use their own agpgart implementation, called NvAGP. On certain systems, this performs better than the in-kernel agpgart, and on others, it performs worse. You will need to evaluate this on your own system to get the best performance. If you are unsure what to do, use the in-kernel agpgart:

A framebuffer alternative is uvesafb, which can be installed parallel to nvidia-drivers.

The nvidia-drivers ebuild automatically discovers your kernel version based on the symlink. Please ensure that you have this symlink pointing to the correct sources and that your kernel is correctly configured. Please refer to the "Configuring the Kernel" section of the Gentoo Handbook for details on configuring your kernel.

First, you'll need to choose the right kernel source using eselect. If you are using gentoo-sources-3.7.10, your kernel listing might look something like this:

In the above output, you'll notice that the linux-3.7.10-gentoo kernel is marked with an asterisk (*) to show that it is the symlinked kernel.

If the symlink is not pointing to the correct sources, you must update the link by selecting the number of your desired kernel sources, as in the example above.

Drivers
Now it's time to install the drivers. You can do this by first following the X Server Configuration HOWTO and setting VIDEO_CARDS="nvidia" in. When you install the X server, it will then install the right version of nvidia-drivers for you.

Once the installation has finished, run modprobe nvidia to load the kernel module into memory. If this is an upgrade, you should remove the previous module first.

To prevent you having to manually load the module on every bootup, you probably want to have this done automatically each time you boot your system, so edit and add nvidia to it.

The X Server
Once the appropriate drivers are installed you need to configure your X Server to use the nvidia driver instead of the default nv driver.

Run eselect so that the X Server uses the nVidia GLX libraries:

Testing your Card
To test your nVidia card, fire up X and run glxinfo, which is part of the mesa-progs package. It should say that direct rendering is activated:

To monitor your FPS, run glxgears.

Enabling nvidia Support
Some tools, such as mplayer and xine-lib, use a local USE flag called xvmc which enables XvMCNVIDIA support, useful when watching high resolution movies. Add in xvmc in your USE variable in or add it as USE flag to media-video/mplayer and/or media-libs/xine-lib in.

GeForce 8 series and later GPUs do come with VDPAU support which superseded XvMCNVIDIA support. See the VDPAU article for enabling VDPAU support.

There are also some applications that use the nvidia USE flag, so you may want to add it to.

Then, run emerge -uD --newuse @world to rebuild the applications that benefit from the USE flag change.

Using NVidia Settings Tool
nVidia also provides you with a settings tool. This tool allows you to monitor and change graphical settings without restarting the X server and is available through Portage as media-video/nvidia-settings. As mentioned earlier, it will be pulled in automatically if you install the drivers with the gtk USE flag set in or in.

Enable OpenGL/OpenCL
To enable OpenGL and OpenCL.

You should make sure that the Xorg server is not running during these changes.

Getting 2D acceleration to work on machines with 4GB memory or more
If you are having trouble with the nVidia 2D acceleration it is likely that you are unable to set up a write-combining range with MTRR. To verify, check the contents of :

Every line should contain "write-back" or "write-combining". If you see a line with "uncachable" in it you will need to change a BIOS setting to fix this.

Reboot and enter the BIOS, then find the MTRR settings (probably under "CPU Settings"). Change the setting from "continuous" to "discrete" and boot back into Linux. You will now find out that there is no "uncachable" entry anymore and 2D acceleration now works without any glitches.

When I attempt to load the kernel module, I receive a "no such device"
This is usually caused by one of the following issues:

1. You don't have an nVidia card at all. Check lspci output to confirm that you have an nVidia graphics card installed and detected.

2. The currently installed version of x11-drivers/nvidia-drivers does not support your graphics card model. Check the README file in /usr/share/nvidia-drivers-*/ for a list of supported devices, or use the driver search at http://www.geforce.com/drivers. See the Which Version section above.

3. Another kernel driver has control of the hardware. Check lspci -k to see if another driver like "nouveau" is bound to the graphics card. If so, you will need to disable or blacklist this driver.

Xorg says it can't find any screens
When you boot up your computer and end up with a black screen or a console prompt instead of your GUI; you can press Ctrl+Alt+F2 to bring up a console prompt if you don't already have one. Then you can run:

to see the output of Xorg. If one of the first errors is that Xorg can't find any screens, then follow these steps to resolve your issue.

It should be enough to run the following command before rebooting:

But if that doesn't work, run lspci and you'll find your video card starts off like this: 01:00.0 VGA compatible controller: make and model of videocard

Take the first bit, 01.00.0 and put it in your /etc/X11/xorg.conf with the BusID option:

Direct rendering is not enabled
If Direct rendering does not work, it may be because you have Direct Rendering Manager enabled in the kernel, which conflicts with the driver. You can see Direct rendering Status by following instructions in the section "Testing you card".

First, disable Direct Rendering Manager (CONFIG_DRM) in the kernel :

And rebuild x11-drivers/nvidia-drivers since the driver may have built against the kernel DRM symbols. It should fix your problem.

Documentation
The nVidia driver package also comes with comprehensive documentation. This is installed into /usr/share/doc and can be viewed with the following command:

Kernel module parameters
The nvidia kernel module accepts a number of parameters (options) which you can use to tweak the behaviour of the driver. Most of these are mentioned in the documentation. To add or change the values of these parameters, edit the file /etc/modprobe.d/nvidia.conf. Remember to run update-modules after modifying this file, and bear in mind that you will need to reload the nvidia module before the new settings take effect.

Edit /etc/modprobe.d/nvidia.conf in your favourite editor:

Update module information:

Unload the nvidia module...

...and load it once again:

Advanced X configuration
The GLX layer also has a plethora of options which can be configured. These control the configuration of TV out, dual displays, monitor frequency detection, etc. Again, all of the available options are detailed in the documentation.

If you wish to use any of these options, you need to list them in the relevant Device section of your X config file (usually /etc/X11/xorg.conf). For example, suppose I wanted to disable the splash logo:

Acknowledgements
We would like to thank the following authors and editors for their contributions to this guide: Sven Vermeulen, Joshua Saddler, M Curtis Napier and Chris Gianelloni.