linux下查看显卡和驱动版本

$ lspci | grep -i vga
17:00.0 VGA compatible controller: NVIDIA Corporation GP102 [GeForce GTX 1080 Ti] (rev a1)
65:00.0 VGA compatible controller: NVIDIA Corporation GP102 [GeForce GTX 1080 Ti] (rev a1)

看其中某一个更详细的信息

lspci -v -s 17:00.0
17:00.0 VGA compatible controller: NVIDIA Corporation GP102 [GeForce GTX 1080 Ti] (rev a1) (prog-if 00 [VGA controller])
	Subsystem: NVIDIA Corporation GP102 [GeForce GTX 1080 Ti]
	Flags: bus master, fast devsel, latency 0, IRQ 67, NUMA node 0
	Memory at b4000000 (32-bit, non-prefetchable) [size=16M]
	Memory at 381fe0000000 (64-bit, prefetchable) [size=256M]
	Memory at 381ff0000000 (64-bit, prefetchable) [size=32M]
	I/O ports at 7000 [size=128]
	[virtual] Expansion ROM at b5000000 [disabled] [size=512K]
	Capabilities: <access denied>
	Kernel driver in use: nvidia
	Kernel modules: nvidiafb, nouveau, nvidia_drm, nvidia

nvidia显卡可以用nvidia-smi查看
$ nvidia-smi Mon Mar 7 18:17:12 2022

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.103.01   Driver Version: 470.103.01   CUDA Version: 11.4     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:17:00.0 Off |                  N/A |
| 50%   80C    P2    88W / 250W |   4027MiB / 11178MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   1  NVIDIA GeForce ...  Off  | 00000000:65:00.0  On |                  N/A |
| 56%   74C    P5    24W / 250W |   3321MiB / 11175MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A     15318      C   ...a3/envs/yolov5/bin/python     4021MiB |
|    1   N/A  N/A      2067      G   /usr/lib/xorg/Xorg                376MiB |

+-----------------------------------------------------------------------------+

可以看出两个显卡的显存是11178M,运行程序占用的显存是4021M+376M

参考:https://blog.csdn.net/wind19/article/details/17095541

你可能感兴趣的:(linux)