LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 10-09-2006, 10:51 AM   #1
walple
LQ Newbie
 
Registered: May 2006
Posts: 3

Rep: Reputation: 0
Command to retrieve the amount of memory on the video card


I am trying to determine how much of my graphics card memory is being utilized by the OS (I have systems with both SLED 10 and RHEL 4) both 2.6 kernels runnning on identical HW.

I am looking for a command that will work regardless of the video card vendor, or the distro, but can assume a 2.6+ kernel.

lspci gives some info about memory regions but I am not clear if these values correspond to the physical video card memory or just the regions it is mapped to.

"cat /var/log/XFree86.0.log | grep NV" reports
(--) NVIDIA(0): VideoRAM: 524288 kBytes
Which is correct and good, but this only works if you have the nvidia driver loaded on an nvidia card.

Thanks in advance.
 
Old 10-10-2006, 09:03 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Code:
grep -i ram.*byte /var/log/XFree86.0.log|awk '{print $4, $5}'
yields "65536 kByte" (laptop, Radeon), which is the physical amount of RAM.

Lspci OTOH shows what's actually in use (AFAIK):
Code:
VGA=`/sbin/lspci | grep "VGA.compatible.controller"|awk '{print $1}'`
MEM=`/sbin/lspci -v -v -s $VGA|grep -m1 gion.*pref.*size|awk '{print $NF}'`
MEM=${MEM//*=/}; MEM=${MEM%%]}; echo "Memory: ${MEM}"
a total of 128M (incl. BIOS configured mem share).
 
Old 10-10-2006, 03:57 PM   #3
walple
LQ Newbie
 
Registered: May 2006
Posts: 3

Original Poster
Rep: Reputation: 0
Thank You

I wrappe dthese in a shell script and it is working great!
Thanks again,
walple
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
check amount of memory naijaguy Linux - General 4 10-15-2008 02:11 PM
Video Card Memory Usage - How to tell? logosys Linux - Hardware 2 12-27-2006 04:25 PM
Command to display amount of memory rust8y Linux - Newbie 4 05-20-2006 07:30 PM
changing video card memory size from root command line tallboy Linux - Hardware 6 04-04-2005 03:20 PM
Video card memory esael Slackware 2 10-13-2002 01:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 05:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration