如何检查Ubuntu是否正在使用我的NVIDIA显卡?

分享于 

3分钟阅读

ubuntu

  繁體

问题

我有一个Dell Inspiron N5110,NVIDIA GEFORCE GT 525M。

 
lspci -v



给了我:


01:00.0 VGA compatible controller: nVidia Corporation Device 0df5 (rev a1) (prog-if 00 [VGA controller])


 Subsystem: Dell Device 04ca


 Flags: bus master, fast devsel, latency 0, IRQ 16


 Memory at f5000000 (32-bit, non-prefetchable) [size=16M]


 Memory at e0000000 (64-bit, prefetchable) [size=256M]


 Memory at f0000000 (64-bit, prefetchable) [size=32M]


 I/O ports at e000 [size=128]


 Expansion ROM at f6000000 [disabled] [size=512K]


 Capabilities: <access denied>


 Kernel driver in use: nvidia


 Kernel modules: nvidia_current, nvidia_current_updates, nvidia, nouveau, nvidiafb



我还尝试:


egrep -i" connected|card detect|primary dev" /var/log/Xorg.0.log



给了我:


[ 20.873] (II) intel(0): Output LVDS1 connected



和:

 
nvidia-smi -a



给出:


NVIDIA: could not open the device file /dev/nvidiactl (No such file or directory).


Nvidia-smi has failed because it couldn't communicate with NVIDIA driver. Make sure that latest NVIDIA driver is installed and running.




答案1

打开终端,并键入


lspci -vnnn | perl -lne 'print if /^d+:.+([S+:S+])/' | grep VGA



输出将如下所示:


00:02.0 VGA compatible controller [0300]: Intel Corporation 3rd Gen Core processor Graphics Controller [8086:0166] (rev 09) (prog-if 00 [VGA controller]) 



01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Chelsea LP [Radeon HD 7730M] [1002:682f] (rev ff) (prog-if ff)



在末尾查找[VGA controller],无论哪个设备拥有它,都是活动的GPU。


答案2


$ glxinfo|egrep"OpenGL vendor|OpenGL renderer*"



OpenGL vendor string: Intel Open Source Technology Center


OpenGL renderer string: Mesa DRI Intel(R) Sandybridge Mobile*



如果你切换到NVidia卡:


$ optirun glxinfo|egrep"OpenGL vendor|OpenGL renderer"



OpenGL vendor string: NVIDIA Corporation


OpenGL renderer string: GeForce GT 555M/PCIe/SSE2