ubuntu关键配置

发布时间:2026/9/12 17:20:04
ubuntu关键配置 Time synctimedatectl set-local-rtc1--adjust-system-clock timedatectlsudoaptupdatesudoaptinstallntpdatesudontpdate ntp.aliyun.comSnap提速sudosnapsetsystemproxy.httpssocks5://192.168.1.1:1080sudosnapsetsystemproxy.httpsocks5://192.168.1.1:1080sudosystemctl daemon-reloadsudosystemctl restart snapd仅适合部分用户如效果不佳请还原。sudosnapsetsystemproxy.httpsudosnapsetsystemproxy.https或sudosnapsetsystem proxy.http!sudosnapsetsystem proxy.https!Hardware video decodingStep 1: Install APIVA-API DriversFor newer Intel GPUs (Gen 8):sudoaptinstallintel-media-va-driver-non-free libvdpau-va-gl1 vainfo ffmpeg intel-gpu-tools特别地intel-media-va-driver-non-free也可以替换成开源包intel-media-va-driver。ffmpeg可能不是必须没有测试。intel-gpu-tools是工具集合。For older Intel GPUs (Gen 7 and older):sudoaptinstalli965-va-driver-shadersFor AMD/Radeon GPUs:sudoaptinstallmesa-va-driverssudoaptinstallintel-media-va-driver-non-freeFor Nvidia GPUs:sudoaptinstall-ynvidia-driver-full nvidia-vaapi-driver libvdpau-va-gl1 vainfoIf Deepin 25, please compile and install follow nvidia-vaapi-driver website# Disable file system# sudo deepin-immutable-writable enable -d /usr# rebootsudoaptinstallmeson gstreamer1.0-plugins-bad libffmpeg-nvenc-dev libva-dev libegl-dev libdrm-dev libgstreamer-plugins-bad1.0-dev meson setup build mesoninstall-Cbuild# Enable file system# sudo deepin-immutable-writable disable# rebootVDPAU Driverssudoaptinstallnvidia-vdpau-driver libvdpau-va-gl1 vdpauinfoStep 2: Verify API is PresentVA-APIethanA4060TI:~$ vainfo Trying display: wayland libva info: VA-API version1.22.0 libva info: Trying toopen/usr/lib/x86_64-linux-gnu/dri/nvidia_drv_video.so libva info: Found initfunction__vaDriverInit_1_0 libva info: va_openDriver()returns0vainfo: VA-API version:1.22(libva2.22.0)vainfo: Driver version: VA-API NVDEC driver[direct backend]Test on Ubuntu 25.10VD-PAUethan4060TI:$ vdpauinfo display: :0 screen:0API version:1Information string: NVIDIA VDPAU Driver Shared Library580.82.07 Wed Aug2718:03:55 UTC2025Test on Deepin 25Step 3:ChromePlease modify desktop file like this:ethanA4060TI:~$cat/usr/share/applications/google-chrome.desktop|grepstableExec/usr/bin/google-chrome-stable %U --enable-featuresVaapiVideoDecoder,VaapiOnNvidiaGPUs,IgnoreGpuBlocklist,AcceleratedVideoDecodeLinuxGLExec/usr/bin/google-chrome-stable --enable-featuresVaapiVideoDecoder,VaapiOnNvidiaGPUs,IgnoreGpuBlocklist,AcceleratedVideoDecodeLinuxGLExec/usr/bin/google-chrome-stable --enable-featuresVaapiVideoDecoder,VaapiOnNvidiaGPUs,IgnoreGpuBlocklist,AcceleratedVideoDecodeLinuxGL--incognitoLooks NG with this configurationMPVVia VAAPIethan4060TI:$cat~/.config/mpv/mpv.confhwdecvaapivogpu gpu-apivulkanTest OK with this configuration on Deepin 25Via VDPAUethan4060TI:$cat~/.config/mpv/mpv.confhwdecvdpauvovdpau gpu-apivulkanprofilegpu-hq,high-qualityTest OK with this configuration on Deepin 25G5000 ubuntu 26.04笔记本配置# hwdecnvdec-copy # 使用显存复制模式避免兼容性问题# vogpu-next# gpu-apivulkan# profilegpu-hq,high-qualityaudio-spdifac3,eac3,truehd,dts,dts-hd audio-devicealsa/hdmi:CARDNVidia,DEV1# mpv --hwdecno --audio-devicealsa/hdmi:CARDNVidia,DEV1 --audio-spdifac3,eac3,truehd,dts,dts-hd Dolby5.1.mp4# # 基础渲染架构# # 启用高质量预设作为基底profilehigh-quality,gpu-hq# 强制使用基于 libplacebo 的下一代渲染器vogpu-next# 使用 Vulkan API 以获得最佳 Shader 性能和 HDR 处理# 如果遇到初始化缓慢问题可尝试 gpu-apiopenglgpu-apivulkan# 硬件解码策略# NVIDIA显卡使用 nvdec-copy将解码数据拷贝回内存兼容性最好hwdecnvdec-copy# AMD显卡可尝试hwdecvulkan# Intel核显可尝试hwdecvaapi# 启用所有格式的硬件解码hwdec-codecsall# # 缩放算法配置# # 高质量缩放算法针对动画内容优化scaleewa_lanczossharpcscaleewa_lanczossharpdscalemitchell# 关闭线性缩放避免干扰 Shader 效果linear-downscalingno sigmoid-upscalingyes# # 色彩与 HDR 处理# # 允许直接输出类似 HDR 的信号如果显示器支持target-colorspace-hintyes# 色调映射算法bt.2446a 是目前最先进的曲线之一能保留更多高光细节tone-mappingbt.2446a# 混合模式平衡亮度与细节# tone-mapping-modehybrid# 色域映射模式gamut-mapping-modeclip# 设置目标显示亮度根据你的显示器参数调整单位尼特# 常见值SDR显示器 100-300HDR显示器 600-1000OLED可达1000target-peak300# 自动检测HDR峰值亮度hdr-compute-peakyes# # 去色带与抖动# # 抖动消除 8bit 面板色阶dither-depthautodithererror-diffusion error-diffusionfloyd-steinberg# 启用去色带debandyes deband-iterations4deband-threshold35deband-range16deband-grain4# # 视频同步与插值# # 视频同步到显示器刷新率video-syncdisplay-resample# 帧插值/运动补偿让24fps视频在高刷屏上更流畅interpolationyestscaleoversample# # 性能优化# # 缓存设置demuxer-max-bytes500M demuxer-readahead-secs60cacheyes cache-secs10FirefoxReferencelinux下ffmpeg调用GPU硬件解码VDPAU/VAAPI保存文件N卡LinuxB站视频硬解-使用nvidia-vaapi-drivernvidia-vaapi-driverSetup特别地对于snap方式安装firefox的用户应修改到core24通道命令如下sudosnap refresh--channellatest/candidate/core24 firefoxInstall dependenciessudoaptinstallffmpeg ffmpeg-hwaccels# make sure include vaapi/etc/environment# Controls which backend this library uses. Either egl (default), or direct. See direct backend for more details.NVD_BACKENDdirect# Disables the sandbox for the RDD process that the decoder runs in.MOZ_DISABLE_RDD_SANDBOX1# For libva versions prior to 2.15, this forces libva to load the nvidia backend.LIBVA_DRIVER_NAMEnvidia# Required for the 470 driver series only. It overrides the list of drivers the glvnd library can use to prevent Firefox from using the MESA driver by mistake._EGL_VENDOR_LIBRARY_FILENAMES/usr/share/glvnd/egl_vendor.d/10_nvidia.json对于笔记本来说大部分都是Intel集显和Nvidia独显。如果是想启动集显只需要# Disables the sandbox for the RDD process that the decoder runs in.MOZ_DISABLE_RDD_SANDBOX1/etc/default/grubAddnvidia-drm.modeset1# Generated by deepin-installerGRUB_BACKGROUND/boot/grub/themes/deepin/background.jpgGRUB_CMDLINE_LINUX_DEFAULTvideoefifb:nobgrt splash quiet loglevel0 localeszh_CN.UTF-8 nvidia-drm.modeset1GRUB_DEFAULT0GRUB_DISTRIBUTOR/usr/bin/lsb_release-d-s2/dev/null||echoUOS20GRUB_THEME/boot/grub/themes/deepin/theme.txtGRUB_TIMEOUT1GRUB_GFXMODEautoDEEPIN_GFXMODE_DETECT1GRUB_CMDLINE_LINUX非Nvidia用户不用执行此步骤。Update initramfssudoupdate-initramfs-usudoupdate-grubfirefoxabout:configPlease check this table carefully.media.ffmpeg.vaapi.enabledis missing, but it is OK at firefox 144 in Deepin 25.Enablediscrete graphicon notebook bios/uefiStep 4: VerificationCheck onchrome://gnuCheck bynvidia-utilssudoaptinstallnvidia-utils-580# (Replace 580 with your current driver version)nvidia-smi dmonethan4060TI:$ nvidia-smi dmon# gpu pwr gtemp mtemp sm mem enc dec jpg ofa mclk pclk# Idx W C C % % % % % % MHz MHz03050-2302008751258003150-2302008751258003150-2302008751258003151-6302008751258003151-2302008751258003151-23020087512580对于Intel显卡或者集成Intell显卡sudointel_gpu_top播放网络视频时显示效果如下intel-gpu-top: Intel Alderlake_p(Gen12) /dev/dri/card1 -346/758MHz;44% RC6;0.93/10.22 W;268irqs/s ENGINES BUSY MI_SEMA MI_WAIT Render/3D24.44%|███████████████████████████████████████████████▌|0%0% Blitter0.00%||0%0% Video3.80%|███████▌|0%0% VideoEnhance0.00%||0%0%显然已经生效。firefoxnvidia-smi dmon or Nvidia X server settingsTest OK with this configuration on Deepin 25. Please make chrome is close. It is failed in my side while chrome is workingVulkanStep 1: Install dependenciessudoaptinstallvulkan-tools libvulkan1Step 2: Verify VULKANINFO is PresentethanA4060TI:~$ vulkaninfoVULKANINFOVulkan Instance Version:1.4.321Step 3: Load Vulkan by command lineWayland is not compatible with Vulkan. Please only test via command line. Please don’t modifychrome://flags.Force X11 and enable Vulkan/usr/bin/google-chrome-stable %U --enable-featuresVaapiVideoDecoder,VaapiOnNvidiaGPUs,IgnoreGpuBlocklist,AcceleratedVideoDecodeLinuxGL --ozone-platformx11 --enable-featuresVulkanollamaStep 1: Installsudoaptinstallnvidia-cuda-toolkitwgethttps://ollama.com/install.shshinstall.sh ollama--versionStep 2: Choose model and runollama run deepseek-r1:7bStep 3: Online ModelPlease sign up on ollama offical website before trying to run online model.ollama signinThen follow the instructions to finish signin jobs.Just copy and go to the link on browser.https://signin.ollama.com/?client_idxxxxxxxxxxxThen choose model and run.ethanA4060TI:~$ ollama run deepseek-v3.1:671b-cloud Connecting to deepseek-v3.1:671b on ollama.com ⚡ hello Thinking... Hmm, the user just said hello. This is a simple greeting that doesnt require complex analysis. The best response is a friendly and warm greeting in return. Since its the start of a conversation, I should keep it open-ended and inviting. A simple Hello! How can I help you today? would work well—it acknowledges the greeting and encourages the user to share what they need. No need to overthink this. Just be polite and approachable. ...done thinking. Hello! How can I help you today?Cloud models and capabilities such as web search contribute to limits that apply to the last hour and week.Mount vhdxvhdx is WSL file. Just want to use in linux. WSL2 fs is here(Please replace You by your real name):C:\Users\You\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu24.04LTS_79rhkp1fndgsc\LocalStatemkdir/dev/shm/vhdxsudoapt-getupdateapt-getinstall-ynbd-clientsudomodprobe nbdmax_part8sudoqemu-nbd-c/dev/nbd0 ext4.vhdxsudoaptinstallqemu-utilssudomount-oro /dev/nbd0 /dev/shm/vhdx/Ubuntu studioInstall chinese inputInstall fcitx5(better than ibus in KDE)sudoaptinstalllanguage-pack-zh-hanssudoaptinstallfcitx5 fcitx5-chinese-addons fcitx5-config-qtim-configim-config# Choose fcitx5System settingsKeyboardVirtual KeyboardFictx5Wayland launcherAdded pinyin in Fictx Configuration# filter by input chineseAdd PinyinReboot

关于本文作者

来自尧图内容编辑团队

尧图内容编辑团队 内容团队

尧图内容编辑团队

本文由尧图网络内容编辑团队执笔。团队由资深项目经理、前端工程师与设计师组成,所有内容均来自亲手交付的真实项目,先讲清问题、再给出可落地的解法。尧图深耕北京网站建设十年,服务过京华建材集团、智造科技等各行业客户,把一线经验沉淀为可复用的行业观察。

  • 十年建站经验,覆盖建材、制造、服务、文创等
  • 项目经理把关选题与事实准确性
  • 工程师与设计师联合撰写专业细节
  • 统一编辑规范,保证文风与排版一致
  • 每月复盘转化数据,迭代选题方向

延伸阅读

相关资讯与近期热门内容

深度阅读推荐

建站决策前值得细读的三篇

网站改版的5个关键决策
2024-08-12

网站改版的5个关键决策

什么时候该改版、改到什么程度、如何避免流量掉光,京华建材集团改版复盘给出答案。

获取专属建站方案

看完文章,把您的行业与预算告诉我们,免费获取一份量身定制的官网建设方案与报价。

立即免费咨询