Jump to content

Get GPU information programatically? BASH


vailixi

Recommended Posts

What are some good statements for getting GPU information. Pretty much I just need the make of the GPU so I can install drivers.

Here's some of the ideas I came up with. As you can see they are not really catch all statements. I need just a bit of help. Any ideas would be great.

 

ISINTEL="Intel"
IsINTEL=$(lspci | grep -EA2 'VGA|3D' | grep '00:0' | cut -d ' ' -f 5)

if [ "$IsINTEL" == "$ISINTEL" ]; then

  echo -e "Intel"
fi

ISNVIDIA="NVIDIA"
IsNVIDIA=$(lspci | grep -EA2 'VGA|3D' | grep '00:0' | cut -d ' ' -f 4)

if [ "$IsNVIDIA" == "$ISNVIDIA" ]; then

  echo -e "NVIDIA"
fi



ISAMD="Advanced"
IsAMD=$(lspci | grep -EA2 'VGA|3D' | grep '00:0' | cut -d ' ' -f 5)

if [ "$IsAMD" == "$ISAMD" ]; then

  echo -e "AMD"
fi

On a personal note, my BASH skills are getting a lot better.

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...