news 2026/9/12 17:20:00

ubuntu关键配置

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
ubuntu关键配置

Time sync

timedatectl set-local-rtc1--adjust-system-clock timedatectlsudoaptupdatesudoaptinstallntpdatesudontpdate ntp.aliyun.com

Snap提速

sudosnapsetsystemproxy.https="socks5://192.168.1.1:1080"sudosnapsetsystemproxy.http="socks5://192.168.1.1:1080"sudosystemctl daemon-reloadsudosystemctl restart snapd

仅适合部分用户,如效果不佳,请还原。

sudosnapsetsystemproxy.http=""sudosnapsetsystemproxy.https=""

sudosnapsetsystem proxy.http!sudosnapsetsystem proxy.https!

Hardware video decoding

Step 1: Install API

VA-API Drivers

For 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-driverffmpeg可能不是必须,没有测试。intel-gpu-tools是工具集合。

For older Intel GPUs (Gen 7 and older):

sudoaptinstalli965-va-driver-shaders

For AMD/Radeon GPUs:

sudoaptinstallmesa-va-driverssudoaptinstallintel-media-va-driver-non-free

For Nvidia GPUs:

sudoaptinstall-ynvidia-driver-full nvidia-vaapi-driver libvdpau-va-gl1 vainfo

If 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# reboot

VDPAU Drivers

sudoaptinstallnvidia-vdpau-driver libvdpau-va-gl1 vdpauinfo

Step 2: Verify API is Present

VA-API

ethan@A4060TI:~$ 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.10

VD-PAU

ethan@4060TI:$ vdpauinfo display: :0 screen:0API version:1Information string: NVIDIA VDPAU Driver Shared Library580.82.07 Wed Aug2718:03:55 UTC2025

Test on Deepin 25

Step 3:

Chrome

Please modify desktop file like this:

ethan@A4060TI:~$cat/usr/share/applications/google-chrome.desktop|grepstableExec=/usr/bin/google-chrome-stable %U --enable-features=VaapiVideoDecoder,VaapiOnNvidiaGPUs,IgnoreGpuBlocklist,AcceleratedVideoDecodeLinuxGLExec=/usr/bin/google-chrome-stable --enable-features=VaapiVideoDecoder,VaapiOnNvidiaGPUs,IgnoreGpuBlocklist,AcceleratedVideoDecodeLinuxGLExec=/usr/bin/google-chrome-stable --enable-features=VaapiVideoDecoder,VaapiOnNvidiaGPUs,IgnoreGpuBlocklist,AcceleratedVideoDecodeLinuxGL--incognito

Looks NG with this configuration

MPV

Via VAAPI

ethan@4060TI:$cat~/.config/mpv/mpv.confhwdec=vaapivo=gpu gpu-api=vulkan

Test OK with this configuration on Deepin 25

Via VDPAU

ethan@4060TI:$cat~/.config/mpv/mpv.confhwdec=vdpauvo=vdpau gpu-api=vulkanprofile=gpu-hq,high-quality

Test OK with this configuration on Deepin 25

G5000 ubuntu 26.04笔记本配置

# hwdec=nvdec-copy # 使用显存复制模式避免兼容性问题# vo=gpu-next# gpu-api=vulkan# profile=gpu-hq,high-qualityaudio-spdif=ac3,eac3,truehd,dts,dts-hd audio-device=alsa/hdmi:CARD=NVidia,DEV=1# mpv --hwdec=no --audio-device=alsa/hdmi:CARD=NVidia,DEV=1 --audio-spdif=ac3,eac3,truehd,dts,dts-hd Dolby5.1.mp4# =============================================================================# 基础渲染架构# =============================================================================# 启用高质量预设作为基底profile=high-quality,gpu-hq# 强制使用基于 libplacebo 的下一代渲染器vo=gpu-next# 使用 Vulkan API 以获得最佳 Shader 性能和 HDR 处理# 如果遇到初始化缓慢问题,可尝试 gpu-api=openglgpu-api=vulkan# 硬件解码策略# NVIDIA显卡使用 nvdec-copy(将解码数据拷贝回内存),兼容性最好hwdec=nvdec-copy# AMD显卡可尝试:hwdec=vulkan# Intel核显可尝试:hwdec=vaapi# 启用所有格式的硬件解码hwdec-codecs=all# =============================================================================# 缩放算法配置# =============================================================================# 高质量缩放算法(针对动画内容优化)scale=ewa_lanczossharpcscale=ewa_lanczossharpdscale=mitchell# 关闭线性缩放,避免干扰 Shader 效果linear-downscaling=no sigmoid-upscaling=yes# =============================================================================# 色彩与 HDR 处理# =============================================================================# 允许直接输出类似 HDR 的信号(如果显示器支持)target-colorspace-hint=yes# 色调映射算法:bt.2446a 是目前最先进的曲线之一,能保留更多高光细节tone-mapping=bt.2446a# 混合模式,平衡亮度与细节# tone-mapping-mode=hybrid# 色域映射模式gamut-mapping-mode=clip# 设置目标显示亮度(根据你的显示器参数调整,单位尼特)# 常见值:SDR显示器 100-300,HDR显示器 600-1000,OLED可达1000+target-peak=300# 自动检测HDR峰值亮度hdr-compute-peak=yes# =============================================================================# 去色带与抖动# =============================================================================# 抖动:消除 8bit 面板色阶dither-depth=autodither=error-diffusion error-diffusion=floyd-steinberg# 启用去色带deband=yes deband-iterations=4deband-threshold=35deband-range=16deband-grain=4# =============================================================================# 视频同步与插值# =============================================================================# 视频同步到显示器刷新率video-sync=display-resample# 帧插值/运动补偿,让24fps视频在高刷屏上更流畅interpolation=yestscale=oversample# =============================================================================# 性能优化# =============================================================================# 缓存设置demuxer-max-bytes=500M demuxer-readahead-secs=60cache=yes cache-secs=10

Firefox

Reference

  • linux下ffmpeg调用GPU硬件解码(VDPAU/VAAPI)保存文件
  • N卡LinuxB站视频硬解-使用nvidia-vaapi-driver
  • nvidia-vaapi-driver

Setup
特别地,对于snap方式安装firefox的用户,应修改到core24通道,命令如下:

sudosnap refresh--channel=latest/candidate/core24 firefox
  • Install dependencies
sudoaptinstallffmpeg 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_BACKEND=direct# Disables the sandbox for the RDD process that the decoder runs in.MOZ_DISABLE_RDD_SANDBOX=1# For libva versions prior to 2.15, this forces libva to load the nvidia backend.LIBVA_DRIVER_NAME=nvidia# 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_SANDBOX=1
  • /etc/default/grub
  1. Addnvidia-drm.modeset=1
# Generated by deepin-installerGRUB_BACKGROUND="/boot/grub/themes/deepin/background.jpg"GRUB_CMDLINE_LINUX_DEFAULT="video=efifb:nobgrt splash quiet loglevel=0 locales=zh_CN.UTF-8 nvidia-drm.modeset=1"GRUB_DEFAULT=0GRUB_DISTRIBUTOR="`/usr/bin/lsb_release-d-s2>/dev/null||echoUOS20`"GRUB_THEME="/boot/grub/themes/deepin/theme.txt"GRUB_TIMEOUT=1GRUB_GFXMODE=autoDEEPIN_GFXMODE_DETECT=1GRUB_CMDLINE_LINUX=""

Nvidia用户不用执行此步骤。

  1. Update initramfs
sudoupdate-initramfs-usudoupdate-grub
  1. firefoxabout:config

    Please check this table carefully.media.ffmpeg.vaapi.enabledis missing, but it is OK at firefox 144 in Deepin 25.

  2. Enablediscrete graphicon notebook bios/uefi

Step 4: Verification

  • Check onchrome://gnu
  • Check bynvidia-utils
sudoaptinstallnvidia-utils-580# (Replace 580 with your current driver version)nvidia-smi dmon
ethan@4060TI:$ 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%

显然已经生效。

firefox

nvidia-smi dmon or Nvidia X server settings

Test OK with this configuration on Deepin 25. Please make chrome is close. It is failed in my side while chrome is working

Vulkan

Step 1: Install dependencies

sudoaptinstallvulkan-tools libvulkan1

Step 2: Verify VULKANINFO is Present

ethan@A4060TI:~$ vulkaninfo==========VULKANINFO==========Vulkan Instance Version:1.4.321

Step 3: Load Vulkan by command line

Wayland 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-features=VaapiVideoDecoder,VaapiOnNvidiaGPUs,IgnoreGpuBlocklist,AcceleratedVideoDecodeLinuxGL --ozone-platform=x11 --enable-features=Vulkan

ollama

Step 1: Install

sudoaptinstallnvidia-cuda-toolkitwgethttps://ollama.com/install.shshinstall.sh ollama--version

Step 2: Choose model and run

ollama run deepseek-r1:7b

Step 3: Online Model

Please sign up on ollama offical website before trying to run online model.

ollama signin

Then follow the instructions to finish signin jobs.

Just copy and go to the link on browser.

https://signin.ollama.com/?client_id=xxxxxxxxxxx

Then choose model and run.

ethan@A4060TI:~$ 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 doesn't require complex analysis. The best response is a friendly and warm greeting in return. Since it's 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 vhdx

vhdx 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\LocalState
mkdir/dev/shm/vhdxsudoapt-getupdate&&apt-getinstall-ynbd-clientsudomodprobe nbdmax_part=8sudoqemu-nbd-c/dev/nbd0 ext4.vhdxsudoaptinstallqemu-utilssudomount-oro /dev/nbd0 /dev/shm/vhdx/

Ubuntu studio

Install chinese input

  1. Install fcitx5(better than ibus in KDE)
sudoaptinstalllanguage-pack-zh-hanssudoaptinstallfcitx5 fcitx5-chinese-addons fcitx5-config-qt
  1. im-config
im-config# Choose fcitx5
  1. System settings
Keyboard=>Virtual Keyboard=>Fictx5Wayland launcher
  1. Added pinyin in Fictx Configuration
# filter by input chineseAdd Pinyin
  1. Reboot
版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/9/12 17:13:59

Flutter跨平台家庭信息中枢系统开发实践

1. 家庭信息中枢系统(Family Hub)概述家庭信息中枢系统(Family Hub)是基于Flutter框架开发的跨平台家庭信息管理解决方案。这个系统本质上是一个数字化的家庭信息聚合器,能够将家庭成员、日程安排、重要文档、家庭账单…

作者头像 李华
网站建设 2026/9/12 17:09:05

MPPT步长对比仿真:固定步长与变步长在光伏Boost模型中的性能分析

做光伏控制器或者DC-DC变换器的人,大概率都纠结过MPPT的步长参数。步长调小了,稳态功率确实稳,但光照一变就半天追不上最大功率点;步长调大了,响应倒是快,可工作点在最大功率点附近来回晃,功率曲…

作者头像 李华