KaFu

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

14 posts in this topic

#1 ·  Posted

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

 

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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
1 person likes this

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#3 ·  Posted

It shows "Intel(R) HD Graphics Family" for my notebook which is correct.

 


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

#4 ·  Posted

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

Share this post


Link to post
Share on other sites

#6 ·  Posted

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

 


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#7 ·  Posted

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

Share this post


Link to post
Share on other sites

#9 ·  Posted

on my system its:

No Intel string found...

AMD Radeon HD 7700 Series

which is correct

Share this post


Link to post
Share on other sites

#10 ·  Posted

Thanks folks, the feedback is much appreciated :)!

 

14 hours ago, jguinch said:

Works for me :
"Intel string found..." with "AMD Radeon HD 5450"

:shocked: ? Maybe it's "string not found"?

Share this post


Link to post
Share on other sites

#11 ·  Posted

---------------------------
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? ;)

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

No Intel string found...

0

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

 

 

Edited by RTFC

Share this post


Link to post
Share on other sites

#13 ·  Posted

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

 

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

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

Edited by RTFC

Share this post


Link to post
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