137

The reason I'm asking is that none of the games I've installed through software center that require 3D accelartion like TORCS for instance will run. When I try to run then, nothing happens. I have a Dell Inspiron N5110 with a nVidia GeForce GT 525M.

I tried the following which I were some suggestions for people with similar problems:

lspci -v

Which gave me:

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

I also tried:

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

Which gave me:

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

And:

nvidia-smi -a

Which gave:

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.

I don't really understand what all this means.

BenMorel
  • 161
Nic
  • 1,371

9 Answers9

66

I know the question is old, but I found a solution which I haven't found on any other topic.

Open a terminal and type

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

Your output will be something like that:

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)

Now look for the [VGA controller] at the end of each device. Whichever device has it, is the active GPU. In my case it's the i7 processor (HD 4000) that's handling the work.

Geo
  • 1,255
  • 1
  • 9
  • 16
  • 12
    Not really...

    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]: NVIDIA Corporation GK107M [GeForce GT 650M] [10de:0fd1] (rev a1) (prog-if 00 [VGA controller])

    – Anne van Rossum Feb 22 '15 at 16:55
  • @AnnevanRossum Did you get any solution to this? I have the exact same issue as you with two [VGA controller]. – Einar Sundgren Mar 05 '15 at 20:38
  • @EinarSundgren I gave up bumblebee for nvidia optimus (http://xmodulo.com/install-configure-nvidia-optimus-driver-ubuntu.html) which allows you to switch with prime-select. – Anne van Rossum Mar 06 '15 at 14:03
  • 20
    lspci -v | grep "VGA controller" should do the trick in this case... what an overblown way to get the same result... – Cestarian Feb 23 '16 at 12:45
  • 5
    This answer is WRONG I had [VGA controller] for a graphic card I did not use – G M Feb 22 '18 at 16:06
  • 6
    This is not correct. I have [VGA controller] for both my installed graphics cards (Intel and AMD). – Machisuji Jul 01 '19 at 20:12
  • Especially in a virtual environment (even with PCI passthrough) this only indicates whether the system detects the PCI device. This is a very primitive piece of information, which in no way indicates a working driver. Sure, if the device is not listed then we can be absolutely certain the driver will not work as well. I'm almost certain that in that case the installation process of the driver will at least give you a hint that it cannot see any supported device. – rbaleksandar Mar 31 '22 at 07:33
  • 2
    The perl command is not needed at all. Just type lspci -vnn | grep VGA – thanos.a Dec 15 '22 at 12:05
61

I found this (if you have NVidia and intel graphic cards):

I think the following command should give you an indication of your active chip:

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

OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Sandybridge Mobile*

If you switched to NVidia card:

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

OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce GT 555M/PCIe/SSE2
54

nvidia-settings utility

On Ubuntu 15.10, after I installed nvidia-352 and the GPU seems to work (see e.g. these steps):

nvidia-settings

shows something like:

enter image description here

Note how it shows:

GPU 0 - (NVS 5400M)

where NVS 5400M is my GPU model. Also tested on a Quadro K1100M. This did not show up before I had installed the driver.

Also if I fire:

sudo apt-get install mesa-utils
__GL_SYNC_TO_VBLANK=0 vblank_mode=0 glxgears

the GPU usage goes to > 90%, further sign that it is working.

Those env vars are there to disable vsync: https://stackoverflow.com/questions/17196117/disable-vertical-sync-for-glxgears

Run a benahcmark and see FPS

In the end, the only test that matters is to do a benchmark with / without GPU and see your FPS goes way up or not: How to perform a detailed and quick 3D performance test e.g.:

sudo apt install glmark2
glmark2

which shows:

enter image description here

and should raise your usage to 100% no matter what as it renders as many times as possible. If we run for one second:

glmark2 -b build:duration=1

it outputs to the terminal:

glmark2 Score: 4551

which is the average FPS.

Similar on Launchpad: https://answers.launchpad.net/ubuntu/+question/233462

  • this worked great for me. Just one addition - to show >90% use of GPU I had to so apt-get install glmark2 and then run it. pretty neat! – AruniRC Mar 17 '17 at 20:26
46

The easiest way to check is go to Settings -> Details -> About

Settings

29

Try this I think it'll work:

nvidia-smi

It will give you something like this

enter image description here

13

I think one of the easiest ways is to run this command prime-select query in the terminal.
The output will be the graphic card that is used by your PC.
Here is an example:
enter image description here If you want to switch between the graphic cards you have, use sudo prime-select <graphic card name>

singrium
  • 6,880
  • 1
    This may not work. I get nvidia, but if I run nvidia-smi, there is no process(Xorg) there. Checking ubuntu-> settings->about shows Intel processor being used. – saurabheights Mar 23 '21 at 06:39
4
sudo aptitude install inxi

inxi -G

Output will be like that:

Graphics:  Card: NVIDIA GF108 [GeForce GT 730]
           Display Server: x11 (X.Org 1.19.6 ) drivers: nvidia (unloaded: modesetting,fbdev,vesa,nouveau)
           Resolution: 1920x1080@60.00hz, 1920x1200@59.95hz
           OpenGL: renderer: GeForce GT 730/PCIe/SSE2 version: 4.6.0 NVIDIA 390.116
ephemerr
  • 211
3

I suggest nvtop tool, it is easy to watch in real-time. It also shows in a graph.

$ sudo apt install nvtop
$ nvtop

enter image description here

Zstack
  • 201
2

Also these commands are useful, if you have installed nvidia driver correctly:

find any graphic card:

ls -l /proc/driver/nvidia/gpus/

and

check installed NVIDIA GPUs:

cat /proc/driver/nvidia/gpus/0000:01:00.0/information

For example for me:

Model:       NVIDIA GeForce RTX 3060
IRQ:         152
GPU UUID:    GPU-dadf78f5-afd8-b3fd-c64f-1e3a2b6fc9bc
Video BIOS:      94.06.2f.00.bd
Bus Type:    PCIe
DMA Size:    47 bits
DMA Mask:    0x7fffffffffff
Bus Location:    0000:01:00.0
Device Minor:    0
GPU Excluded:    No