2024年5月21日

HYEOS

随事而为

Gentoo nvidia 驱动启动成功

2 min read

这次更改use到plasma进行全局更新时又将nvidia显卡的use进行了单独的设置,然后,nvidia加载运行成功了,我日,从Off终于变成了On,天可怜见如上图!

这次将涉及到的几个配置备档在这里吧:

#/etc/portage/make.conf
# These settings were set by the catalyst build script that automatically
# built this stage.
# Please consult /usr/share/portage/config/make.conf.example for a more
# detailed example.
COMMON_FLAGS="-march=native -O2 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
FCFLAGS="${COMMON_FLAGS}"
FFLAGS="${COMMON_FLAGS}"

# NOTE: This stage was built with the bindist Use flag enabled
PORTDIR="/var/db/repos/gentoo"
DISTDIR="/var/cache/distfiles"
PKGDIR="/var/cache/binpkgs"
# This sets the language of build output to English.
# Please keep this setting intact when reporting bugs.
LC_MESSAGES=C
MAKEOPTS="-j9 -l9"
RSYNC_TIMEOUT=500 
######my set config############

# Aria2                            
FETCHCOMMAND="/usr/bin/aria2c -d \${DISTDIR} -o \${FILE} --allow-overwrite=true --max-tries=5 --max-file-not-found=2 --max-concurrent-downloads=5 --connect-timeout=300  --timeout=300 --split=5 --min-split-size=2M --lowest-speed-limit=20K --max-connection-per-server=9 --uri-selector=feedback \${URI}"
RESUMECOMMAND="${FETCHCOMMAND}"

USE="X  acpi git python gtk aiglx  acl alsa  v4l bluetooth x264 x265 elogind dbus polkit udisks udev  -systemd -consolekit"
USE="handbook qt6 qt5 qt4"
USE="glamor  nvidia   vulkan Xaw3d dri gui kde nntp nvenc opengl pcmia ssl wifi imap ios http2 wifi " 
INPUT_DEVICES="libinput synaptics"
VIDEO_CARDS="nvidia intel i915 i965 virtualbox"
L10N="en-US zh-CN en zh" 
LANGUAS="en-US zh-CN en zh" 
ALSA_CARDS="hda-intel"
AUTO_CLEAN="yes"

GENTOO_MIRRORS="https://mirrors.tuna.tsinghua.edu.cn/gentoo"

ACCEPT_LICENSE="*"

#GENTOO_MIRRORS="http://mirrors.163.com/gentoo/"

#/etc/X11/xorg.conf
Section "ServerLayout"
    Identifier "layout"
    Screen 0 "nvidia"
    Inactive "intel"
EndSection

Section "Module"
        Load            "drm"
        Load            "fb"
        Load            "shadow"
        Load            "exa"
        Load            "glamoregl"
        Load            "glx"
        Load            "dri3"
EndSection

Section "DRI"
        Group 0
        Mode 0666
EndSection

Section "Device"
    Identifier "nvidia"
    Driver "nvidia"
    BusID "01:00:0"
    Option      "Accel" "true"
    Option      "RenderAccel" "true"
    Option      "NoFlip" "false"
    Option      "SWCursor" "false"
    Option      "HWCursor" "true"
    Option      "DamageEvents" "true"
    Option      "ModeDebug" "false"
    Option      "AllowSHMPixmaps" "false"
    Option      "SidebandSocketPath" "/tmp"
    Option      "UseSysmemPixmapAccel" "true"
    Option      "MultisampleCompatibility" "true"
    Option      "AllowEmptyInitialConfiguration" "true"
    Option      "ForceCompositionPipeline" "true"
    Option      "ForceFullCompositionPipelline" "true"
    Option      "AllowIndirectGLXProtocol" "true"
    Option      "TripleBuffer" "true"
    Option      "Stereo" "0"
    Option      "BaseMosaic" "false"
    Option      "MultiGPU" "true"
    Option      "SLI" "true"
    Option      "RegistryDwords" "EnableBrightnessControl=1"
EndSection

Section "Device"
    Identifier     "InactiveDevice1"
    Driver         "modesetting"
    VendorName     "Unknown"
    Option              "AccelMethod" "glamor"
    Option              "DRI" "3"
    Option              "TearFree" "true"
EndSection

Section "Screen"
    Identifier "nvidia"
    Device      "nvidia"
    Option      "AllowEmptyInitialConfiguration"
EndSection

Section "Device"
    Identifier "intel"
    Driver      "modesetting"
    BusID       "00:02:0"
EndSection

Section "Screen"
    Identifier "intel"
    Device "intel"
EndSection

#/etc/portage/package.use/nvidia-drivers
x11-drivers/nvidia-drivers X   driver  persistenced  static-libs tools 
#个人觉得重点是persistenced标记子之后安装了nvidia-persistenced设置启动之后成功加载成功nvidia的

#/etc/portage/package.use/videos
x11-drivers/xf86-video-intel sna tools uxa xvmc udev dri
media-libs/xine-lib bluray alsa  jpeg v4l opengl truetype  dxr3 X xvmc  
media-libs/opencv       contrib opencl opencvapps opengl v4l  xine qt5 ffmpeg  
media-libs/mesa  X dri3 egl libglvnd vmware intel v3d virgl d3d12   virgl   
x11-base/xorg-server elogind udev  xorg 
kde-plasma/plasma-meta bluetooth browser-integration colord crypt desktop-portal display-manager elogind handbook sddm  sdk smart  thunderbolt wallpapers

当然内核是必不可少的,按照Gentoo Wiki的nvidia的编译选项进行设置即可,另外还有一个没有解决的是virtualbox安装windows之后居然不能玩lol了,这个问题的出现也是上一次发神经进行了use调整之后重装virtualbox之造成的,现在改来改去也回不去了,不知道哪里问题,有可能是存在的配置文件?之前装过一次离线的版本,又装过一次bin的二进制版本,我都麻了,删除都没有删除干净好像,懒得整了,反正也不玩游戏了

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注