NVIDIA/nvidia-drivers

From Gentoo Wiki
< NVIDIA(Redirected from NVidia/nvidia-drivers/ko)
Jump to:navigation Jump to:search
This page is a translated version of the page NVIDIA/nvidia-drivers and the translation is 23% complete.
Outdated translations are marked like this.

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

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

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

참고
It's always recommended (and good practice) to check the corresponding documentation provided by NVIDIA for the version of the system's installed driver, as that information may be more up-to-date and prevalent for more use cases. If any issues arise, README documentation may come of a great help. The official README documentation for all NVIDIA's drivers can also be found online.

USE flags for x11-drivers/nvidia-drivers NVIDIA Accelerated Graphics Driver

+X Add support for X11
+modules Build the kernel modules
+static-libs Install the XNVCtrl static library for accessing sensors and other features
+strip Allow symbol stripping to be performed by the ebuild for special files
+tools Install additional tools such as nvidia-settings
dist-kernel Enable subslot rebuilds on Distribution Kernel upgrades
kernel-open Use the open source variant of the drivers (Turing/Ampere+ GPUs only, aka GTX 1650+ -- recommended with >=560.xx drivers if usable)
modules-compress Install compressed kernel modules (if kernel config enables module compression)
modules-sign Cryptographically sign installed kernel modules (requires CONFIG_MODULE_SIG=y in the kernel)
persistenced Install the persistence daemon for keeping devices state when unused (e.g. for headless)
powerd Install the NVIDIA dynamic boost support daemon (only useful with specific laptops, ignore if unsure)
wayland Enable dev-libs/wayland backend

Open source kernel modules

참고
This driver only works on Turing GPUs and newer (i.e. GTX 1650 and newer), as mentioned next to the kernel-open flag above.

In May 2022, Nvidia announced work towards open sourcing their graphics cards' kernel drivers. The driver is hosted on GitHub.

Users can try out the open source driver by enabling the corresponding USE flag:

파일 /etc/portage/package.use
x11-drivers/nvidia-drivers kernel-open

하드웨어 호환성

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

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

If the card has been identified as a legacy card then mask the more recent releases of x11-drivers/nvidia-drivers, e.g.:

파일 /etc/portage/package.maskMasking drivers with version higher than 470
>x11-drivers/nvidia-drivers-471

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

Installation

Distribution Kernel

When using a distribution kernel (sys-kernel/gentoo-kernel or sys-kernel/gentoo-kernel-bin), building driver support is as simple as adding the following to /etc/portage/make.conf:

파일 /etc/portage/make.confNvidia make.conf example
USE="dist-kernel"

This will trigger the Nvidia driver to automatically rebuild on every kernel update. Restarting is recommended after doing a kernel update.

요령
If using GRUB as a bootloader then adding the useflag dbus to /etc/portage/make.conf will also trigger GRUB to update the boot

커널

위에 말한 바와 같이 엔비디아 커널 드라이버는 현재 설치한 커널에 대해 빌드하고 실행합니다. 모듈로 빌드하기 때문에 커널에서 모듈 불러오기를 지원해야 합니다 (하단 참조).

커널 모듈(nvidia.ko)은 그래픽 칩을 다루는 상업용 부분(일반적으로 "바이너리 블롭"이라고 함)과 바이너리 블롭과 커널간을 실행 시간에 중재하는 오픈소스 부분("접착제"역할)이 있습니다. 함께 제대로 동작해야 하는데 그렇지 않으면 데이터 손실(커널 망가짐, X 프로그램에서 데이터를 저장하지 않은 채로 X 서버 깨짐)에 직면하고 심지어는 하드웨어 동작 실패 현상이 일어나기도 합니다(과열되거나 전원 관리 관련 문제가 떠오를 것입니다).

커널 호환성

때때로 새 커널 릴리스에는 드라이버에 대한 내부 ABI가 바뀌는데, 모든 드라이버가 이 ABI를 사용하도록 즉시 바꾸어야 합니다. 오픈소스 드라이버에서는 특히 커널에 배포하는 드라이버의 경우 드라이버간의 호출 매개를 연결하는 전체적인 부분을 수정해야 함은 자명한 사실이며 커널의 다른 부분은 쉽게 검토해볼 수 있습니다. nvidia.ko와 같은 상업용 드라이버는 조금 다르게 동작합니다. 내부 ABI가 바뀌면 "붙어 있는 요소"를 거의 수정할 수 없는데 상업 코드 부분에서 사용하는 고착 부분을 어떻게 활용하는지 알 수 없기 때문입니다. 심지어 그럴싸하게 동작하도록 패치하고 난 후 지원하지 않는 새 커널에서 위험을 감수해가며 nvidia.ko를 실행하면, 데이터를 잃을 수 있고, 하드웨어가 망가질 수 있습니다.

비호환 새 커널버전이 출시되면 당분간은 새로 지원하는 커널에 그대로 의지하는 것이 좋습니다. Nvidia 에서는 보통 사용하는데 적합하다고 간주하는 새 상업 릴리스를 준비하는데 몇 주가 걸립니다. 그냥 기다리십시오. 정말 필요하다면 nvidia-drivers 이빌드의 epatch_user 명령을 활용할 수 있습니다. 지원하지 않는 최신 커널 릴리즈에 맞춰 사용자가 패치할 수 있습니다. 참고로 nvidia-drivers 메인테이너나 nVidia 이 부분을 지원하지 않습니다. 하드웨어 보증이 날라가며, nVidia 만 버그를 제대로 발견할 수 있는 상업용 드라이버이기 때문에 젠투 메인테이너가 문제를 수정할 수 없고, 커널 메인테이너(젠투 및 업스트림)는 분명히 상업용 드라이버 또는 문제 상황으로 치달아 "꼬여버린" 시스템을 지원하지 않습니다.

커널을 설정하는데 genkernel all 옵션을 사용했다면, 모든 항목이 설정되어 있습니다만, 그렇지 않다면 지원 기능을 활성화 했는지 커널 설정을 다시 확인하십시오:

커널 Enable loadable module support
[*] Enable loadable module support --->

커널에서 Memory Type Range Register도 활성화해야 합니다:

커널 MTRR 지원 활성화
Processor type and features --->
    [*] MTRR (Memory Type Range Register) support

With at least some if not all driver versions it may also be required to enable VGA Arbitration and the IPMI message handler:

커널 Enable VGA Arbitration (CONFIG_VGA_ARB)
Device Drivers --->
   PCI support --->
      [*] VGA Arbitration
커널 Enable IPMI message handler (CONFIG_ACPI_IPMI)
Device Drivers --->
   Character devices --->
      [*] IPMI top-level message handler

또한 AGP 그래픽 카드를 보유하고 있다면, 추가적으로 커널에서 커널에 컴파일 하여 포함한 방식 또는 모듈로 agpgart 지원을 활성화 할 수 있습니다. 커널에 포함한 agpgart를 사용하지 않으면 드라이버에서는 NvAGP라는 자체 agpgart 구현체를 활용합니다. 어떤 시스템에서는 커널에 포함한 agpgart보다 더욱 우수한 성능을 보이며, 그렇지 않은 경우 그 반대의 성능을 보입니다. 여러분은 최상의 성능을 취하기 위해 드라이버를 시험해보려 할 것입니다. 무엇이 어떤지 확실하게 판단이 되지 않으면 커널에 있는 agpgart를 사용하십시오:

커널 Enable agpgart support (CONFIG_AGP)
Device Drivers --->
   Graphics support --->
      -*- /dev/agpgart (AGP Support) --->
참고
amd64에서는 IOMMU가 agpgart 설정을 관리합니다.
중요
For x86 and AMD64 processors, the in-kernel framebuffer driver conflicts with the binary driver provided by NVIDIA. When compiling the kernel for these CPUs, completely remove support for the in-kernel driver as shown.
커널 Disable support for the in-kernel driver (CONFIG_FB_NVIDIA, CONFIG_FB_RIVA)
Device Drivers --->
    Graphics support --->
        Frame buffer Devices --->
            <*> Support for frame buffer devices --->
               < > nVidia Framebuffer Support
               < > nVidia Riva support

Now make sure the nouveau driver is disabled:

커널 Disable support for the nouveau driver (CONFIG_DRM_NOUVEAU)
Device Drivers  --->
    Graphics support  --->
        < > Nouveau (nVidia) cards

SimpleDRM must not be built-in (CONFIG_DRM_SIMPLEDRM=y)[1]. Effects of it being enabled might include: no TTY, not working Xorg sessions/Wayland compositors, etc. Nonetheless, it is harmless as a module (CONFIG_DRM_SIMPLEDRM=m).

커널 Disable SimpleDRM support (CONFIG_DRM_SIMPLEDRM)
Device Drivers --->
   Graphics support --->
      < > Simple framebuffer driver

A framebuffer driver is required for rendering the Linux console (TTY) as this functionality is not yet provided by the proprietary NVIDIA driver[2][3], i.e. nvidia-drivers, unlike in-tree DRM drivers, rely on other framebuffer drivers to provide Linux console (TTY) support, instead of providing its own. As shown below, set Mark VGA/VBE/EFI FB as generic system framebuffer (CONFIG_SYSFB_SIMPLEFB=y), and then enable a framebuffer driver. Common options for this are to use either efifb (CONFIG_FB_EFI=y) for UEFI devices or vesafb (CONFIG_FB_VESA=y) for BIOS/CSM devices. simplefb (CONFIG_FB_SIMPLE=y|m) may also be chosen, however there are reports of it not working, as there exist reports of it working as well as others; the decision is up to end user to make.

커널 Enable framebuffer drivers for the kernel 5.15 and later (CONFIG_SYSFB_SIMPLEFB, CONFIG_FB_VESA, CONFIG_FB_EFI, CONFIG_FB_SIMPLE)
Device Drivers --->
   Firmware Drivers  --->
      [*] Mark VGA/VBE/EFI FB as generic system framebuffer
   Graphics support --->
      Frame buffer Devices  --->
         <*> Support for frame buffer devices  --->
            [*] VESA VGA graphics support
            [*] EFI-based Framebuffer Support 
            <*> Simple framebuffer support

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

First, choose the right kernel source using eselect. When using sys-kernel/gentoo-sources version 3.7.10 for instance, the kernel listing might look something like this:

root #eselect kernel list
Available kernel symlink targets:
  [1]   linux-3.7.10-gentoo *
  [2]   linux-3.7.9-gentoo

In the above output, notice that the linux-3.7.10-gentoo kernel is marked with an asterisk (*) to show that it is the kernel that the symbolic link points to.

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

root #eselect kernel set 1

Kernel GCC plugins

If GCC plugins of the Kernel are enabled compilation of nvidia-drivers will use them. If the compiler version that was used to compile the plugins does not match the nvidia-drivers' compiler an error will occur.

커널 Enable GCC plugins (CONFIG_GCC_PLUGINS)
General architecture-dependent options --->
   GCC plugins --->
      ...

This behavior cannot be fixed, see bug #804618 or various forum posts [4] [5] [6]. Using these plugins seems controversial, too [7].

If the problem occurs, re-compile the plugins (in /usr/src/linux):

root #make oldconfig && make prepare

Configuration

드라이버

이제 드라이버를 설치할 차례입니다. 먼저 X서버 설정 안내서를 따른 후, /etc/portage/make.confVIDEO_CARDS="nvidia" 설정을 넣으십시오. 그러면 X 서버를 설치할 때 올바른 버전의 x11-drivers/nvidia-drivers를 알아서 설치합니다.

참고
/etc/portage/make.confgtk USE 플래그를 설정하여 드라이버를 설치할 수 있습니다. 이렇게 설치하면 media-video/nvidia-settings를 함께 설치하는데 이 꾸러미는 nVidia 카드의 전반적인 측면을 보고 설정할 수 있게 하는 간편한 그래픽 도구입니다.
중요
새 커널 컴파일을 하거나 현재 커널을 컴파일 하는 언제든지, nVidia 커널 모듈을 다시 설치해야 합니다. 이빌드로 설치한 (x11-drivers/nvidia-drivers같은)모듈을 쉽게 다시 빌드하려면 emerge @module-rebuild를 실행하십시오.

설치가 끝나면, modprobe nvidia를 실행하여 메모리로 커널 모듈을 불러내십시오. 업그레이드라면 이전 모듈을 먼저 제거해야 합니다.

root #lsmod | grep nvidia
root #rmmod nvidia
root #modprobe nvidia

Kernel module signing (optional)

참고
The information in this section is not necessary for systems that do not implement signed kernel modules. Feel free to skip it.

If secure boot kernel signing is used, then the NVIDIA kernel modules need to be signed before they can be loaded.

This can be accomplished by using the kernel-provided perl script as follows.

root #/usr/src/linux/scripts/sign-file sha512 /usr/src/linux/certs/signing_key.pem /usr/src/linux/certs/signing_key.x509 /lib/modules/Kernel-Version-modules-path/video/nvidia-uvm.ko
root #/usr/src/linux/scripts/sign-file sha512 /usr/src/linux/certs/signing_key.pem /usr/src/linux/certs/signing_key.x509 /lib/modules/Kernel-Version-modules-path/video/nvidia.ko

As of driver version 358.09 a new module has been made to handle monitor mode setting and for this driver version this module must also be signed.

root #/usr/src/linux/scripts/sign-file sha512 /usr/src/linux/certs/signing_key.pem /usr/src/linux/certs/signing_key.x509 /lib/modules/Kernel-Version-modules-path/video/nvidia-modeset.ko

When using a Wayland compositor or need to use PRIME offload, sign the following two modules:

root #/usr/src/linux/scripts/sign-file sha512 /usr/src/linux/certs/signing_key.pem /usr/src/linux/certs/signing_key.x509 /lib/modules/Kernel-Version-modules-path/video/nvidia-drm.ko
root #/usr/src/linux/scripts/sign-file sha512 /usr/src/linux/certs/signing_key.pem /usr/src/linux/certs/signing_key.x509 /lib/modules/Kernel-Version-modules-path/video/nvidia-peermem.ko

Once the modules are signed, the driver will load as expected on boot up. This module signing method can be used to sign other modules too - not only the nvidia-drivers. Just modify the path and corresponding module accordingly.

Dracut configuration (optional)

When using Dracut, it may be worthwhile to ensure that the NVIDIA modules are not bundled in the generated ramdisk (initramfs) image. Otherwise, every update may require regeneration of the image.

파일 /etc/dracut.conf.d/nvidia.confDisabling NVIDIA modules in ramdisk
# Omit the nvidia driver from the ramdisk, to avoid needing to regenerate
# the ramdisk on updates.
omit_drivers+=" nvidia nvidia-drm nvidia-modeset nvidia-uvm "

The X server

Once the appropriate drivers are installed, the X server should work without any extra configuration. An example of /etc/X11/xorg.conf for single-GPU systems is provided below.

파일 /etc/X11/xorg.conf.d/nvidia.confExplicit nvidia driver section
Section "Device"
   Identifier  "nvidia"
   Driver      "nvidia"
EndSection

For laptops with integrated Intel graphics card, try the XOrg config as suggested by the NVIDIA/Optimus page.

nvidia-persistenced

NVIDIA packages a daemon called nvidia-persistenced to assist in situations where the tearing down of the GPU device state isn't desired. Typically, the tearing down of the device state is the intended behavior of the device driver. Still, the latencies incurred by repetitive device initialization can significantly impact performance for some applications.

nvidia-persistenced is intended to be run as a daemon from system initialization and is generally designed as a tool for compute-only platforms where the NVIDIA device is not used to display a graphical user interface. Depending on the user's system and its uses, it may not be necessary to set persistenced USE flag.

Currently, Gentoo does not elect to set the persistenced USE flag as default.

Permissions

The user(s) needing to access the video card will need to be added to the video group:

root #gpasswd -a larry video

Note that users will be able to run X without permission to the DRI subsystem, but hardware acceleration will be disabled. For Wayland sessions not setting this may result in a very low FPS.

PCI-Express Runtime D3 (RTD3) Power Management

NVIDIA GPUs have many power-saving mechanisms. Some of them will reduce clocks and voltages to different parts of the chip. Sometimes, turning off clocks or power to parts of the chip entirely, without affecting functionality or continuing to function, just at a slower speed.

The NVIDIA Linux driver includes initial experimental support for dynamically managing power to the NVIDIA GPU.

Thus, this feature is available only when the following conditions are satisfied:

  • This feature is supported only on notebooks.
  • This feature requires system hardware as well as ACPI support. The necessary hardware and ACPI support was first added in the Intel Coffeelake chipset series. Hence, this feature is supported from Intel Coffeelake chipset series.
  • This feature requires a Turing or newer GPU (i.e. GTX 1650+).
  • This feature is supported with Linux kernel versions 4.18 and newer. With older kernel versions, it may not work as intended.
  • This feature is supported when Linux kernel defines CONFIG_PM=y. Typically, if the system supports S3 (suspend-to-RAM), then CONFIG_PM would be defined.

Setup

If the user wants to enable this feature, then it's recommended to follow the 'Automated Setup' section in Chapter 22 of the official NVIDIA README documentation. It has also been outlined below for convenience.

Create a file named 80-nvidia-pm.rules in /etc/udev/rules.d/ directory with the following contents:

파일 /etc/udev/rules.d/80-nvidia-pm.rules
# Enable runtime PM for NVIDIA VGA/3D controller devices on driver bind
ACTION=="bind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030000", TEST=="power/control", ATTR{power/control}="auto"
ACTION=="bind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030200", TEST=="power/control", ATTR{power/control}="auto"

# Disable runtime PM for NVIDIA VGA/3D controller devices on driver unbind
ACTION=="unbind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030000", TEST=="power/control", ATTR{power/control}="on"
ACTION=="unbind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030200", TEST=="power/control", ATTR{power/control}="on"

The following file needs be added to /etc/modprobe.d/ file to seamlessly enable this feature.

파일 /etc/modprobe.d/nvidia-pm.conf
# Enable RTD3
options nvidia NVreg_DynamicPowerManagement=0x02

More information and other configuration options are documented in Chapter 22 of NVIDIA's README documentation.

Enabling global NVIDIA support

Most NVIDIA GPUs are capable of donig hardware encoding/decoding, the support matrix can be found here. GeForce 8 series and later GPUs do come with VDPAU support which superseded legacy XvMCNVIDIA support. Some ebuilds, like media-video/ffmpeg and media-video/obs-studio, have USE flags vdpau and nvenc to enable support for NVIDIA hardware encoding/decoding.

There are also some applications that use the nvidia USE flag, so it might be a good idea to add it to /etc/portage/make.conf.

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

Using the NVIDIA settings tool

NVIDIA also provides a settings tool. This tool allows the user to monitor and change graphical settings without restarting the X server and is available through Portage as part of x11-drivers/nvidia-drivers with the tools USE flag set.

Usage

카드 시험하기

nVidia 카드를 시험하려면, X를 실행 후 x11-apps/mesa-progs 꾸러미에 있는 glxinfo를 실행하십시오. 이 프로그램에서 DRM을 활성화했는지 나와야 합니다:

user $glxinfo | grep direct
direct rendering:  Yes

FPS를 확인하려면 glxgears를 실행하십시오.

문제 해결

Random freezes

Freezes can occur for various reasons. Check that:

  • All power saving options turned off in the system firmware setup.
  • Only the original (from installation) driver options card defined in the /etc/modprobe.d/nvidia.conf file.

FATAL: modpost: GPL-incompatible module *.ko uses GPL-only symbol

When the ebuild is complaining about the 'mutex_destroy' GPL-only symbol:

root #emerge x11-drivers/nvidia-drivers
FATAL: modpost: GPL-incompatible module nvidia.ko uses GPL-only symbol 'mutex_destroy' 

Be sure to disable CONFIG_DEBUG_MUTEXES in the kernel's .config file, as suggested by this forum thread.

MSI 인터럽트를 활성화 하면 드라이버 초기화에 실패하네요

리눅스 NVIDIA 드라이버는 메시지 신호 인터럽트(MSI)를 기본으로 사용합니다. 이 기능은 호환성과 확장성의 장점을 제공하는데, 주된 이유라면 IRQ 공유를 막기 위해서입니다. 어떤 시스템에서는 가상 연결 인터럽트로 제대로 동작하지만, 일부 시스템에서는 MSI 지원에 문제가 있어보입니다. 이 문제는 NVIDIA 드라이버로 X를 시작하는데 있어서 불가능한 것으로 보이며, 또는 CUDA 초기화 문제로 보이기도 합니다.

MSI 인터럽트는 NVIDIA 커널 모듈 매개변수에 NVreg_EnableMSI=0 값을 부여하여 비활성화 할 수 있습니다. 이 값은 모듈을 불러오는 과정에서, 또는 배포본에서 제공하는 커널 모듈 설정 파일(/etc/modprobe.d/ 같은 디렉터리에 있음)에서 설정할 수 있습니다.

예를 들자면:

파일 /etc/modprobe.d/nvidia.confnVidia NVreg_EnableMSI 설정
# Nvidia drivers support
alias char-major-195 nvidia
alias /dev/nvidiactl char-major-195
  
# To tweak the driver the following options can be used, note that
# you should be careful, as it could cause instability!! For more 
# options see /usr/share/doc/nvidia-drivers-337.19/README 
#
# !!! SECURITY WARNING !!!
# DO NOT MODIFY OR REMOVE THE DEVICE FILE RELATED OPTIONS UNLESS YOU KNOW
# WHAT YOU ARE DOING.
# ONLY ADD TRUSTED USERS TO THE VIDEO GROUP, THESE USERS MAY BE ABLE TO CRASH,
# COMPROMISE, OR IRREPARABLY DAMAGE THE MACHINE.
options nvidia NVreg_DeviceFileMode=432 NVreg_DeviceFileUID=0 NVreg_DeviceFileGID=27 NVreg_ModifyDeviceFiles=1 NVreg_EnableMSI=0

4GB 이상 용량의 메모리를 가진 머신에서 2D 가속 활성화하기

nVidia 2D 가속에 문제가 있다면 MTRR의 write-combining 범위를 설정할 수 없는 경우일지도 모릅니다. 원인을 확인하려면 다음 명령으로 /proc/mtrr의 내용을 확인하십시오:

root #cat /proc/mtrr

모든 줄에 write-back 또는 write-combining이 있어야 합니다. uncachable이 있다면, 이 문제를 고치기 위해 BIOS 설정을 바꾸어야 합니다.

다시 부팅하고 BIOS로 들어가신 다음 MTRR 설정을 찾으십시오(아마 "CPU 설정"에 있을겁니다). continuous에서 discrete로 설정을 바꾸고 리눅스로 돌아가십시오. 더이상 uncachable이 없고, 튐 현상 없이 2D 가속이 잘 동작하는걸 보실 수 있습니다.

Alternatively, it might be necessary to enable MTRR cleanup support (CONFIG_MTRR_SANITIZER=Y) in the Linux kernel:

커널 Enable MTRR cleanup support
Processor type and features  --->
   [*]   MTRR (Memory Type Range Register) support
   [*]   MTRR cleanup support 
   (0)     MTRR cleanup enable value (0-1) 
   (1)     MTRR cleanup spare reg num (0-7)

Failed to initialize DMA on Ryzen

Disable AMD Secure Memory Encryption[8]:

커널 Disable AMD Secure Memory Encryption (SME) support
Processor type and features  --->
   [ ]   AMD Secure Memory Encryption (SME) support

커널 모듈을 불러오려는데 "no such device" 메시지를 받았습니다

보통 다음 문제 중 하나가 원인입니다:

  1. 어쨌거나 nVidia 카드를 가지고 있지 않습니다. lspci 출력을 보고 nVidia 그래픽 카드를 설치했고 감지했는지 확인하십시오.
  2. 현재 설치한 x11-drivers/nvidia-drivers 버전이 설치한 그래픽 카드 모델을 지원하지 않습니다. /usr/share/nvidia-drivers-*/의 README에서 지원 장치 목록을 확인하거나 http://www.geforce.com/drivers에서 드라이버를 검색하십시오.
  3. 다른 커널 드라이버에 하드웨어 제어 기능이 있습니다. "nouveau"와 같은 드라이버가 그래픽 카드를 다루고 있는지 lspci -k 명령으로 확인하십시오. 만약 이 상황이라면 비활성화하거나 이 드라이버를 블랙 리스트에 넣으십시오.

직접 렌더링이 활성화되지 않아요

직접 렌더링이 동작하지 않는다면, 드라이버와 충돌하게끔 커널에서 직접 렌더링 관리자를 활성화했기 때문일 수도 있습니다. 카드 시험하기 장의 절차를 따라 직접 렌더링 상태를 볼 수 있습니다.

먼저 직접 렌더링 관리자(CONFIG_DRM)를 커널에서 비활성화 하십시오:

커널 직접 렌더링 관리자(DRM) 비활성화
Device drivers --->
    Graphics support --->
        < > Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)

그리고 커널 DRM 심볼에 대해 드라이버를 빌드했을터이니 x11-drivers/nvidia-drivers를 다시 빌드하십시오. 이리 하면 문제를 해결할 수 있습니다.

동영상 재생이 버벅거리고 느린데요

최근 NVidia 바이너리 드라이버에서 느린 동영상 재생이라든지 점진적으로 버벅이는 현상을 야기하여 몇가지 형식의 동영상 재생이 멈추는 것 같습니다. 이 문제는 아마도 일부 CPU에서 일반적인 ACPI CPU 대기 정책 대신에 인텔 CPU 전력 대기 정책으로 대신 처리 과정에서 발생하는 것 같습니다.

커널 명령줄 부팅 방식에 intel_idle.max_cstate=0 설정을 사용하여 이전 ACPI CPU 대기 정책을 대신 사용하도록 인텔 CPU 대기 정책을 끄십시오. 또한 NVidia Powermizer 기능을 끄든지 nvidia-settings에서 안내하는 바와 같이 최대 성능으로 설정하십시오. 인텔 CPU 대기 정책을 최근 기본으로 도입했지만, i5 CPU와 i7 CPU용 (ACPI CPU 대기 정책에 대응하여) CPU 대기 정책은 이 시점에서 근본 원인으로 지목됩니다. 이러한 대기 정책은 상당히 눈에 띄도록 문제를 해결하지만, 디인터레이싱을 활성화하면 일부 미새한 버벅임이라든지, 느린 동영상 재생이 나타납니다. 이 현상은, 그러니까, 동영상을 이미 디인터레이싱 했을 경우에 나타나는 것 같습니다(예를 들자면 {{{1}}}와 유사한 mplayer-nodeint 명령으로 회피하시면 됨).

If using GRUB as the bootloader, add this kernel parameter to /etc/default/grub like so:

파일 /etc/default/grubAdding intel_idle.max_cstate kernel parameter in GRUB
GRUB_CMDLINE_LINUX_DEFAULT="intel_idle.max_cstate=0"

Don't forget to run grub-mkconfig -o /boot/grub/grub.cfg after making the change, so that the new configuration is generated (see the GRUB article for further details).

After you have rebooted, you can verify that the change is active:

user $cat /sys/module/intel_idle/parameters/max_cstate
0

No HDMI Output/Video/Sound

This problem tended to occur whenever the HDMI hub device turned-off for a period of time, or the computer was started with an HDMI hub device turned off.

First, find the PCI device ID, using lspci.

When this problem occurs, substitute the PCI ID within the following command for rescanning the PCI bus:

root #echo on > /sys/bus/pci/devices/0000\:06\:00.0/power/control

This avoides disable runtime power management for PCI function 0, placing this PCI bus always on.

No vertical synchronization (no VSync, tearing) in OpenGL applications

Adding the following option to the screen section prevents tearing on GTX 660, 660 Ti, and probably some other GPUs (reference):

파일 /etc/X11/xorg.conf
Section "Screen"
     . . .
    Option         "metamodes" "nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"
     . . .
EndSection

udevd using 100% of the CPU, X server failed to start

Workaround available in bug #670340 comment #8

Distorted white lines during early boot

If nothing but a black screen with distorted white lines appears right after the kernel and initramfs is loaded, try disabling CONFIG_SYSFB_SIMPLEFB and all framebuffer device drivers except CONFIG_FB_EFI.

ERROR: Kernel configuration is invalid.

When building nvidia-drivers, a message could appear like:

root #emerge x11-drivers/nvidia-drivers
...
* Preparing nvidia module
make -j8 HOSTCC=x86_64-pc-linux-gnu-gcc 'LDFLAGS=-m elf_x86_64' NV_VERBOSE=1 IGNORE_CC_MISMATCH=yes SYSSRC=/usr/src/linux SYSOUT=/usr/src/linux modules 
make[1]: Entering directory '/usr/src/linux-5.15.23-gentoo'
test -e include/generated/autoconf.h -a -e include/config/auto.conf || (		\
echo >&2;							\
echo >&2 "  ERROR: Kernel configuration is invalid.";		\
echo >&2 "         include/generated/autoconf.h or include/config/auto.conf are missing.";\
echo >&2 "         Run 'make oldconfig && make prepare' on kernel src to fix it.";	\
echo >&2 ;							\
/bin/false)

This is not an error but the code logic that checks for this error. Therefore, the kernel configuration is in fact not invalid.

Plymouth can't find nvidia-uvm module

When using systemd, it may be worth considering adding the following configuration to /etc/modprobe.d to ensure that nvidia-uvm is loaded as a soft dependency of the nvidia module. This helps prevent an error that happens when the configuration file is added to the initrd but not the nvidia-uvm module; causing an error on Plymouth about not being able to find the nvidia-uvm module.

This may not be required unless specifically using Dracut, systemd, and observe the error produced by Plymouth (not finding nvidia-uvm) in the logs.

파일 /etc/modprobe.d/nvidia-uvm.confMake nvidia-uvm a soft dependency of the nvidia module (on systemd)
# Make a soft dependency for nvidia-uvm as adding the module loading to
# /usr/lib/modules-load.d/nvidia-uvm.conf for systemd consumption, makes the
# configuration file to be added to the initrd but not the module, throwing an
# error on plymouth about not being able to find the module.
# Ref: /usr/lib/dracut/modules.d/00systemd/module-setup.sh

# Even adding the module is not the correct thing, as we don't want it to be
# included in the initrd, so use this configuration file to specify the
# dependency.

softdep nvidia post: nvidia-uvm

Wayland GLAMOR (weird keyboard typing bug)

Symtoms: weird keyboard behavior when trying, it deletes and redraw the characters.

Affected: xwayland apps, i noticed it especially on discord and skype

Workaround:

XWAYLAND_NO_GLAMOR=1

Enable this envvar and it will disable GLAMOR, will take more resources but the issue won't occur anymore. you can just add it to /etc/environment file. more information in the gitlab link.

  • notice: disabling glamor causes wine-proton games to work a lot slower and there are reports of steam for linux not even starting.

API mismatch

Symptoms: API mismatch can cause launching GPU accelerated applications to fail to launch. It can also cause external displays which are connected via a discrete NVIDIA graphics card to be detected, but not be enabled or activated (the screen will show up in xrandr, but will refuse to display output - the display will stay in low power mode.).

Detection: This problem can be detected using a few different methods:

1. Compare the currently loaded kernel module version with the currently available userspace management utilities.

Kernel module check:

user $modinfo nvidia | grep version | head -n 1
version:        515.65.01

Userspace utility version:

user $nvidia-settings --version | grep version
nvidia-settings:  version 520.56.06

Observe in the previous command output there is a difference in the patch versions: 515.65.01 vs 515.65.06.

2. Something like the following message will be written to the dmesg log:

user $dmesg
[  337.995427] NVRM: API mismatch: the client has the version 520.56.06, but
               NVRM: this kernel module has the version 515.65.01.  Please
               NVRM: make sure that this kernel module and all NVIDIA driver
               NVRM: components have the same version.
[  339.048386] [drm:nv_drm_dumb_map_offset [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to lookup gem object for mapping: 0x00000006
[  339.048400] [drm:nv_drm_dumb_map_offset [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to lookup gem object for mapping: 0x00000007

3. The post-install ebuild log output also includes logic to detect for the API mismatch and instructions for the solution:

user $emerge @module-rebuild
>>> Installing (1 of 1) x11-drivers/nvidia-drivers-520.56.06::gentoo
 * >>> SetUID: [chmod go-r] /usr/bin/nvidia-modprobe ...                                                                             [ ok ]
 * Removing x11-drivers/nvidia-drivers-520.56.06 from moduledb.
 * Updating module dependencies for 6.0.5-gentoo-x86_64 ...                                                                          [ ok ]
 * Adding module to moduledb.
 * Currently loaded NVIDIA modules do not match the newly installed
 * libraries and may prevent launching GPU-accelerated applications.
 * The easiest way to fix this is usually to reboot

Cause: API mismatch occurs when the nvidia kernel modules are of a different version than the userspace utilities. This occurs when a full system reboot is not performed after an nvidia-drivers package the update.

Solution: The simplest solution is to perform a full system reboot.

전문가 설정

문서

x11-drivers/nvidia-drivers 꾸러미에는 실용적인 문서가 있습니다. 이 문서는 /usr/share/doc에 있으며 다음 명령으로 살펴볼 수 있습니다:
user $less /usr/share/doc/nvidia-drivers-*/README.bz2

커널 모듈 매개 변수

nvidia 커널 모듈은 드라이버의 동작을 세밀하게 설정할 수 있는 몇가지 매개 변수(옵션)를 받아들입니다. 대부분 이 매개 변수 설명은 문서에 있습니다. 이 매개 변수의 값을 추가하거나 바꾸려면 /etc/modprobe.d/nvidia.conf 파일을 편집하십시오. 이 파일을 편집한 다음 update-modules실행을 잊지 마시고, 새 설정을 적용하기 전에 nvidia 모듈을 다시 불러와야 함도 잊지 마십시오.

경고
Pay close attention to this section as these kernel options can enable features that the hardware may or may not support. These options are not forgiving, so be careful with the parameters. Do not made any changes without validating and double-checking that the change is needed.
Attribute Default Description
NVreg_DeviceFileUID 0 Modify the user ID for the device file. The default value sets it to the root user. Setting this to another user ID will make the driver module create the device file with access available to that user ID.
NVreg_DeviceFileGID 27 Modify the Group ID for the device file. The default value sets it to the video group.
NVreg_DeviceFileMode Undefined Set the permissions for the device file. A value of 0660 grants the owner and group-owner read-write access while other users cannot access the device file.
NVreg_ModifyDeviceFiles 1 Instruct the driver to enable or disable dynamic device file management.
NVreg_EnablePCIeGen3 0 Enable PCIe Gen 3.x support. If the system supports this 8GT high speed bus then enable it with this module option flag. When this is enabled but the system does not support Gen 3.0, the behavior of the system can become irratic and unstable. Some have even reported damage to hardware enabling this when it is not properly supported. By default the Nvidia driver is set to use PCIe Gen 2.x for compatibility reasons.
NVreg_UsePageAttributeTable 0 This is one of the latest and newest additions to the Nvidia driver modules option. It allows the driver to take full advantage of the PAT technology - a newer way of allocating memory, replacing the older Memory Type Range Register (MTRR) method. The PAT method creates a partition type table at a specific address mapped inside the register and utilizes the memory architecture and instruction set more efficiently and faster. If the computer supports PAT and the feature is enabled in the kernel then this flag can be enabled. Without PAT support, users may experience unstable performance and even crashes if this is enabled. So be careful with these options.
NVreg_EnableVia4x 0 Enable AGP 4x mode in the the NVIDIA driver on Via-chipset-powered systems. Some of these hardware configurations would not work properly in AGP 4x mode when others would. The default leaves it at AGP 2x mode.
NVreg_EnableALiAGP 0 On ALi1541 and ALi1647 chipsets, AGP support is by default disabled by the NVIDIA drivers. The value specifies the speed factor to use, so the values 1, 2, 4 and 8 represent AGP 1x, 2x, 4x and 8x respectively. NVIDIA does not recommend changing the value as it may lead to unstable systems.
NVreg_ReqAGPRate Unspecified Forces the AGP mode on the driver. For instance, a value of 1 means AGP 1x, while a value of 4 means AGP 4x.
NVreg_NvAGP Changes the AGP Gart mode setting. Possible values are: 0 (Disable), 1 (Enable using NVIDIAs internal AGP-Gart), 2 (Enable using the Linux kernel AGP-Gart) and 3 (Enable and use any available, but try th NVIDIA internal one first).
NVreg_EnableAGPSBA 0 Disables (0) or enables (1) AGP Side Banding. For stability reasons, the setting is by default disabled, but the setting can be enabled for testing and debugging purposes. This is not supported by NVIDIA though.
NVreg_EnableAGPFW 0 Enables AGP Fast-Writes when set to 1. Depending on the system's chipset this may cause stability issues if enabled.
NVreg_Mobile 0 Through this setting, users can force the EDID information for particular systems. This workaround is provided for mobile GPU's where EDID information is either non-functional or disabled. Potential values are 0 (Auto detection of the correct setting), 1 (Dell notebooks), 2 (non-Compaq Toshiba laptops), 3 (All other notebooks/laptops), 4 (Compaq Toshiba laptops) or 5 (Gateway machines).
NVreg_RemapLimit 60 Maximum amount of system memory remapping. It specifies the amount of memory that the driver will be allowed to remap through the IOMMU/SWIOTLB on a 64-bit system. Only use it if the IOMMU or SMIOTLB is larger than 64mb. NVIDIA recommends to subtract 4mb from the total amount of memory to use. For instance, the default value is 60 which is in fact 64mb. To set it to 128mb, set the value to 124.
NVreg_UpdateMemoryTypes 0 Tweak the use of page table attributes. Possible values are: 0 (Nvidias logic mechanism), 1 (Enable the use of changed page table attributes) and 2 (Disable the use of page table attributes).
NVreg_InitializeSystemMemoryAllocations 1 Tell the NVIDIA driver to clear system memory allocations prior to using it for the GPUs. Disabling can give a slight performance boost but at the cost of increased security risks. By default the driver will wipe the allocated by zeroing out its content.
NVreg_UseVBios 1 Enable or disable the use of the video BIOS int10 code. Set to 0 to disable.
NVreg_RMEdgeIntrCheck Unspecified Enable or disable checking for edge-triggered interrupts.
NVreg_EnableMSI 1 Enable or disable PCIe-MSI capabilities. Enable this to use MSI interrupts instead of wired interrupts.
NVreg_MapRegistersEarly 0 If set to 1, allow the driver to map the memory locations early when the system is probing the hardware instead of the default option of doing this when loaded by modprobe or during startx. This is a debugging feature.
NVreg_RegisterForACPIEvents 1 Enable the driver to register with the ACPI of the system to receive ACPI events. This can be disabled (0) when issues occur with ACPI or while debugging an issue.
NVreg_EnableGpuFirmware Varies Enable or disable use of GSP firmware. Turing and later GPUs include a GPU System Processor (GSP) which can be used to offload GPU initialization and management tasks. When using GSP firmware, the driver will not yet correctly support display-related features or power management related features. These features will be added to GSP firmware in future driver releases.

편집기에서 /etc/modprobe.d/nvidia.conf를 편집하십시오:

root #update-modules

nvidia 모듈을 불러온 상태를 취소하십시오...

root #modprobe -r nvidia

...그리고 다시 불러오십시오:

root #modprobe nvidia

고급 X 설정

GLX 계층에는 설정 가능한 상당히 많은 옵션이 있습니다. TV 출력, 듀얼 디스플레이, 모니터 주파수 감지 등의 설정을 다룰 수 있습니다. 다시 말씀드리지만, 여기에 있는 모든 옵션은 문서에 자세히 설명되어 있습니다.

이 옵션을 사용하려면 X 설정 파일의 관련 장치 섹션에 있는 목록을 살펴봐야 합니다(보통 /etc/X11/xorg.conf에 있음). 가령, 스플래시 로고를 비활성화 하려는 상황을 가정해보겠습니다.

파일 /etc/X11/xorg.conf스플래시 로고 비활성화
Section "Device"
  Identifier "nVidia Inc. GeForce2"
  Driver     "nvidia"
  Option     "NoLogo" "true"
  VideoRam   65536
EndSection

추가 참조

References


This page is based on a document formerly found on our main website gentoo.org.
The following people contributed to the original document: Sven Vermeulen (SwifT) , M Curtis Napier, and Chris Gianelloni
They are listed here because wiki history does not allow for any external attribution. If you edit the wiki article, please do not add yourself here; your contributions are recorded on each article's associated history page.