Extracting video card properties

Hi everyone.

I'm looking for a way to extract the video card properties (Name, Driver version, amount of vram). I've managed to deal with nVidia cards, but nothing came for ATI/AMD cards and other kind of chipsets. Can someone point a way to do this?

Thanks.

If lspci doesn't provide detailed enough info, the most straightforward way may be viewing x.org's logfile. Recent versions of X ( >= 7.3 ) have full autodetection with HAL.

Ok thanks. Hmm where can I find this (x.org log files)?:confused:

Edit: forget about my first message, I found it. However, it's a real pain in the ass to parse. Is there any other way to achieve this? I have to clarify things, I'm doing the video card's properties detection before creating any OpenGL context. Contrary to nVidia, ATI doesn't provide API or commands to get these sort of information. And moreover I have to detect properties for other type of video cards...

Well, it's a problem. easy tools like lspci and lsusb exist because the PCI and USB buses behave and communicate in a consistent way. Video cards, on the other hand, are a dogs' breakfast of warring standards and ad-hoc solutions. Nvidia was nice enough to make a tool for their cards but there's no general-purpose solution, supporting every card means special code for everything conceivable.

So, try lspci, if you're lucky the PCI ID will be unique enough to determine much about the card. Try the nvidia tool. If these aren't specific enough, you're stuck with large general-purpose things with specific code for every possible chipset, like Xorg.

I haven't had luck finding out how, but Xorg might be able to be induced to generate a configuration file based on the video hardware it sees.

Thanks for your answer.

It looks like I'm in a dead end. I'll try to parse the xorg.conf file.