lspci | grep -i vga
(或3D
)查看PCI设备中的显卡信息。 ,2. 通过 lshw -C display
(需sudo权限)获取详细显卡硬件信息。 ,3. NVIDIA显卡可运行 nvidia-smi
查看状态及驱动信息。 ,Ubuntu用户也可在”设置>中查看显卡型号。在Linux系统中查找GPU信息是硬件识别、驱动安装或性能优化的关键步骤,以下为多种专业方法,适用于不同场景:
使用 lspci
命令(推荐)
lspci
是基础工具,直接读取PCI总线信息:
lspci | grep -i vga
- 输出示例:
01:00.0 VGA compatible controller: NVIDIA Corporation GA106 [GeForce RTX 3060] (rev a1)
- 进阶操作:
- 查看详细型号:
lspci -v -s 01:00.0
(替换为你的设备号) - 列出所有设备:
lspci -v | grep -A1 -i vga
- 查看详细型号:
专用工具检测
NVIDIA显卡
nvidia-smi
- :型号、驱动版本、显存占用、温度等(需安装NVIDIA驱动)。
- 若未安装驱动,使用:
lshw -C display
AMD显卡
sudo apt install radeontop # 安装工具 radeontop -v # 查看型号和状态
Intel集成显卡
sudo apt install intel-gpu-tools # 安装工具 intel_gpu_top # 监控状态
系统级工具
lshw
(硬件概览)
sudo lshw -C display
- 输出示例:
*-display description: VGA compatible controller product: GA106 [GeForce RTX 3060] vendor: NVIDIA Corporation
inxi
(综合硬件工具)
sudo apt install inxi # 安装 inxi -G # 专查GPU
- :型号、驱动、分辨率、OpenGL版本。
内核信息文件
cat /proc/driver/nvidia/gpus/*/information # NVIDIA专用 cat /sys/kernel/debug/dri/*/name # 通用(需root权限)
图形API工具
OpenGL信息
sudo apt install mesa-utils glxinfo | grep "OpenGL renderer"
- 输出示例:
OpenGL renderer string: NVIDIA GeForce RTX 3060/PCIe/SSE2
Vulkan信息
sudo apt install vulkan-tools vulkaninfo | grep GPU_name
其他方法
- 桌面环境:
- GNOME:
Settings > About > Graphics
- KDE:
System Settings > Hardware Info
- GNOME:
- DMESG日志:
dmesg | grep -i drm # 显示内核加载的显卡驱动
选择建议
场景 | 推荐命令 |
---|---|
快速查看型号 | lspci | grep -i vga |
NVIDIA显卡监控 | nvidia-smi |
详细硬件配置 | sudo lshw -C display |
图形API信息 | glxinfo |
注意:部分工具需安装(如
nvidia-smi
需驱动、inxi
需手动安装),无root权限时可能受限。
引用说明
- PCI设备数据库:https://pci-ids.ucw.cz
- NVIDIA官方文档:https://docs.nvidia.com/datacenter/tesla/
- Linux内核文档:https://www.kernel.org/doc/html/latest/gpu
- Mesa 3D图形库:https://www.mesa3d.org
通过以上方法,可全面掌握Linux系统下的GPU信息,建议优先使用系统内置工具(如lspci
),特殊需求时选择专用工具。
原创文章,发布者:酷盾叔,转转请注明出处:https://www.kd.cn/ask/36801.html