Jump to content

Display Device - Need some samples for AMD, Intel and NVIDIA GPUs


Recommended Posts

Hello Forum :),

I would need some samples for the code posted below, on my current machine it returns "NVIDIA GeForce GTX 770". Does it work for AMD and Intel GPUs properly too?

Thanks in advance!

Best Regards

 

#include <WinAPI.au3>

$_Determine_Display1_GPU = _Determine_Display1_GPU()
If StringInStr($_Determine_Display1_GPU, "Intel") Then
    MsgBox(0, "GPU Test", "Intel string found..." & @CRLF & @CRLF & $_Determine_Display1_GPU)
Else
    MsgBox(0, "GPU Test", "No Intel string found..." & @CRLF & @CRLF & $_Determine_Display1_GPU)
EndIf

Func _Determine_Display1_GPU()
    Local $aDevice, $i = 0 ;, $sText
    While 1
        $aDevice = _WinAPI_EnumDisplayDevices("", $i)
        If @error Or Not $aDevice[0] Or Not $aDevice[1] Then ExitLoop
        If $aDevice[1] = "\\.\DISPLAY1" Then
            Return $aDevice[2]
            ExitLoop
        EndIf
        $i += 1
    WEnd
EndFunc   ;==>_Determine_Display1_GPU

 

Link to comment
Share on other sites

  • Moderators

It returns Intel string found... Intel(R) HD Graphics 530 for my Intel box, and No Intel string found... AMD Radeon HD 7800 Series, for my other box. 

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

1 hour ago, KaFu said:

Hello Forum :),

I would need some samples for the code posted below, on my current machine it returns "NVIDIA GeForce GTX 770". Does it work for AMD and Intel GPUs properly too?

Thanks in advance!

Best Regards

 

#include <WinAPI.au3>

$_Determine_Display1_GPU = _Determine_Display1_GPU()
If StringInStr($_Determine_Display1_GPU, "Intel") Then
    MsgBox(0, "GPU Test", "Intel string found..." & @CRLF & @CRLF & $_Determine_Display1_GPU)
Else
    MsgBox(0, "GPU Test", "No Intel string found..." & @CRLF & @CRLF & $_Determine_Display1_GPU)
EndIf

Func _Determine_Display1_GPU()
    Local $aDevice, $i = 0 ;, $sText
    While 1
        $aDevice = _WinAPI_EnumDisplayDevices("", $i)
        If @error Or Not $aDevice[0] Or Not $aDevice[1] Then ExitLoop
        If $aDevice[1] = "\\.\DISPLAY1" Then
            Return $aDevice[2]
            ExitLoop
        EndIf
        $i += 1
    WEnd
EndFunc   ;==>_Determine_Display1_GPU

 

Intel(R) HD Graphics 530 4me... Try check the settings you have in the BIOS for your video card. Lenovo Y700

Link to comment
Share on other sites

  • Moderators

@rootx in the future please just hit reply rather than quoting everything said; pads the entire post unnecessarily.

 

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

For me it returns

No Intel string found...
NVIDIA Quadro 400
 

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Link to comment
Share on other sites

Link to comment
Share on other sites

---------------------------
GPU Test
---------------------------
Intel string found...



Intel(R) HD Graphics Family
---------------------------
OK   
---------------------------

excuse pettiness, but why on earth did you not use ConsoleWrite instead of MsgBox? ;)

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Link to comment
Share on other sites

No Intel string found...

0

:( It fails on my laptop with Intel HD Graphics 4600 (active default) and Nvidia Quadro K1000M.

 

 

Edited by RTFC
Link to comment
Share on other sites

2 hours ago, RTFC said:

 

:( It fails on my Dell Precision M3800 laptop with Intel HD Graphics 4600 (active default) and Nvidia Quadro K1000M.

 

Attached to an external monitor? Might be that this line kicks you out, it's not save and just for testing:

If $aDevice[1] = "\\.\DISPLAY1" Then

Maybe this one is more valid to test:

#include <WinAPI.au3>

$_Determine_Display_GPU = _Determine_Display_GPU()
If StringInStr($_Determine_Display_GPU, "Intel") Then
    MsgBox(0, "GPU Test", "Intel string found..." & @CRLF & @CRLF & $_Determine_Display_GPU)
Else
    MsgBox(0, "GPU Test", "No Intel string found..." & @CRLF & @CRLF & $_Determine_Display_GPU)
EndIf

Func _Determine_Display_GPU()
    Local $aDevice, $i = 0, $sText
    While 1
        $aDevice = _WinAPI_EnumDisplayDevices("", $i)
        If @error Or Not $aDevice[0] Or Not $aDevice[1] Then ExitLoop
        If Not StringInStr($sText, $aDevice[2], 2) Then $sText &= $aDevice[2] & @CRLF
        $i += 1
    WEnd
    Return StringTrimRight($sText, 2)
EndFunc   ;==>_Determine_Display_GPU

 

Link to comment
Share on other sites

Indeed, KaFu, that second version does detect my Intel graphics card correctly (no external monitor present, BTW). Well done.:)

Edited by RTFC
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

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