LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Command to retrieve the amount of memory on the video card (https://www.linuxquestions.org/questions/linux-hardware-18/command-to-retrieve-the-amount-of-memory-on-the-video-card-490835/)

walple 10-09-2006 10:51 AM

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.

unSpawn 10-10-2006 09:03 AM

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).

walple 10-10-2006 03:57 PM

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


All times are GMT -5. The time now is 03:24 AM.