Go Back   FileForums > Game Backup > PC Games > PC Games - CD/DVD Conversions > Conversion Tutorials
Register FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 31-05-2020, 06:02
Razor12911's Avatar
Razor12911 Razor12911 is offline
Noob
 
Join Date: Jul 2012
Location: South Africa
Posts: 3,762
Thanks: 2,194
Thanked 11,261 Times in 2,320 Posts
Razor12911 is on a distinguished road
try this one, you can remove the DXGI code if you having issues and just use the registry. Should produce the same results.

Code:
uses
Winapi.Windows, Winapi.DXGI, System.Win.Registry;

type
  TGPUInfo = record
    FName: String;
    FSize: Integer;
  end;

  TGPUs = array of TGPUInfo;

procedure GetGPUs(out V: TGPUs; UseDXGI: Boolean);
  function Align(Value, Size: Integer): Integer;
  begin
    if Value mod Size <> 0 then
      Result := Succ(Max(0, Value div Size)) * Size
    else
      Result := Value;
  end;

const
  RegPath = 'SOFTWARE\Microsoft\DirectX\';
var
  GPUInfo: TGPUInfo;
  i, j, k, l: Integer;
  x: Int64;
  riid: TGUID;
  hr: HRESULT;
  pFactory: IDXGIFactory;
  pAdapter: IDXGIAdapter;
  dxAdapterDesc: DXGI_ADAPTER_DESC;
  Reg1: TRegIniFile;
  Reg2: TRegistry;
  SL: TStringList;
  mybool: Boolean;
begin
  Reg1 := TRegIniFile.Create(KEY_READ or KEY_WOW64_64KEY);
  SL := TStringList.Create;
  Reg1.RootKey := HKEY_LOCAL_MACHINE;
  if Reg1.OpenKey(RegPath, False) then
    Reg1.ReadSections(SL);
  Reg1.Free;
  Reg2 := TRegistry.Create(KEY_READ or KEY_WOW64_64KEY);
  Reg2.RootKey := HKEY_LOCAL_MACHINE;
  if UseDXGI then
  begin
    riid := StringToGUID('{7b7166ec-21c7-44ae-b21a-c9ae321ae369}');
    pFactory := nil;
    hr := CreateDXGIFactory(riid, pFactory);
    if (hr = S_OK) and Assigned(pFactory) then
    begin
      pAdapter := nil;
      i := 0;
      while (pFactory.EnumAdapters(i, pAdapter) = S_OK) do
      begin
        FillChar(dxAdapterDesc, SizeOf(DXGI_ADAPTER_DESC), 0);
        hr := pAdapter.GetDesc(dxAdapterDesc);
        if hr = S_OK then
        begin
          GPUInfo.FName := dxAdapterDesc.Description;
          GPUInfo.FSize := IfThen(dxAdapterDesc.DedicatedVideoMemory = 0,
            dxAdapterDesc.DedicatedSystemMemory,
            dxAdapterDesc.DedicatedVideoMemory) shr 20;
          if dxAdapterDesc.DedicatedSystemMemory = 0 then
            for j := 0 to SL.Count - 1 do
            begin
              if Reg2.OpenKey(RegPath + SL[j], False) then
              begin
                if (Reg2.ReadString('Description') = GPUInfo.FName) then
                  if Reg2.ReadBinaryData('DedicatedVideoMemory', x, x.Size) = x.Size
                  then
                  begin
                    GPUInfo.FSize := x shr 20;
                    break;
                  end;
                Reg2.CloseKey;
              end;
            end;
          GPUInfo.FSize := Align(GPUInfo.FSize, IfThen(GPUInfo.FSize < 512,
            32, 512));
          Insert(GPUInfo, V, Length(V));
        end;
        inc(i);
      end;
    end;
  end;
  for j := 0 to SL.Count - 1 do
  begin
    if Reg2.OpenKey(RegPath + SL[j], False) then
    begin
      mybool := True;
      for i := Low(V) to High(V) do
      begin
        if (Reg2.ReadString('Description') = V[i].FName) then
        begin
          mybool := False;
          break;
        end;
      end;
      if mybool then
      begin
        GPUInfo.FName := Reg2.ReadString('Description');
        x := 0;
        if Reg2.ReadBinaryData('DedicatedVideoMemory', x, x.Size) = x.Size then
          x := x shr 20;
        if x = 0 then
          if Reg2.ReadBinaryData('DedicatedSystemMemory', x, x.Size) = x.Size
          then
            x := x shr 20;
        GPUInfo.FSize := x;
        GPUInfo.FSize := Align(GPUInfo.FSize, IfThen(GPUInfo.FSize < 512,
          32, 512));
        Insert(GPUInfo, V, Length(V));
      end;
    end;
    Reg2.CloseKey;
  end;
  SL.Free;
  Reg2.Free;
  for i := Low(V) to High(V) do
  begin
    k := 0;
    for j := Low(V) to High(V) do
      if V[j].FSize >= k then
      begin
        k := V[i].FSize;
        l := j
      end;
    GPUInfo := V[i];
    V[i] := V[l];
    V[l] := GPUInfo;
  end;
end;

procedure TForm1.Button1Click(Sender: TObject);
var
  i: Integer;
  MyGPUs: TGPUs;
begin
  Memo1.Lines.Clear;
  GetGPUs(MyGPUs, True);
  for i := Low(MyGPUs) to High(MyGPUs) do
    Memo1.Lines.Add(MyGPUs[i].FName + ' (' + MyGPUs[i].FSize.ToString + ' MB)');
end;
Attached Images
File Type: png 60.PNG (5.7 KB, 180 views)
Attached Files
File Type: 7z Project1.7z (1.97 MB, 65 views)

Last edited by Razor12911; 31-05-2020 at 06:43.
Reply With Quote
The Following 5 Users Say Thank You to Razor12911 For This Useful Post:
audiofeel (04-07-2026), BLACKFIRE69 (31-05-2020), Cesar82 (31-05-2020), Harsh ojha (31-05-2020), Jiva newstone (31-05-2020)
Sponsored Links
  #2  
Old 31-05-2020, 20:33
Cesar82's Avatar
Cesar82 Cesar82 is offline
Registered User
 
Join Date: May 2011
Location: Brazil
Posts: 1,081
Thanks: 1,844
Thanked 2,316 Times in 791 Posts
Cesar82 is on a distinguished road
Thanks @Razor12911

I just didn't understand one thing ...
In your code above, the registration information overlaps the GDXI values (if parametter UseDXGI = true).
Shouldn't there be an "end else" in place of "end;"?
Code:
        inc(i);
      end;
    end;
  end else
    for j := 0 to SL.Count - 1 do
    begin
If someone using older versions of Delphi, I attached the example of Razor12911 adapted for Delphi 2010.
Thanks again Razor12911 for the code, it's working perfectly, especially the version using registry that also detects the ON-BOARD video card.

Last edited by Cesar82; 01-06-2020 at 08:00. Reason: After explaining Razor12911 I removed the "end else" from my modified file.
Reply With Quote
The Following User Says Thank You to Cesar82 For This Useful Post:
BLACKFIRE69 (07-06-2020)
  #3  
Old 01-06-2020, 01:06
Razor12911's Avatar
Razor12911 Razor12911 is offline
Noob
 
Join Date: Jul 2012
Location: South Africa
Posts: 3,762
Thanks: 2,194
Thanked 11,261 Times in 2,320 Posts
Razor12911 is on a distinguished road
I made it to work like that for a reason. Remember you said your intel you was not detected. So after dxgi is done detecting gpus using its methods, if any gpus were missed then registry code adds the remaining gpus. This is why I didn’t use “else”.
But then you might say why not just get rid of dxgi if doesn’t detect all gpus.

Here is why, registry skips gpus with names that have already been detected which means if SLi/Crossfire was used, registry method will not be able to detect this but dxgi will be able to.
While dxgi has issues of detecting intel gpu, registry helps dxgi
Plus we have no idea if the same registry idea works on older operating systems so it’s best to have both methods working together

So you can see why both code have to exist because they nullify the disadvantages they both have, furthermore. Dxgi has issues detecting gpu size in x86 because the value type used in x86 has the same issue as with wmi adapterram where gpu over 4gb is misread.

Tl;dr both code help mitigate their own disadvantages so the code works flawlessly

Last edited by Razor12911; 01-06-2020 at 01:10.
Reply With Quote
The Following User Says Thank You to Razor12911 For This Useful Post:
Cesar82 (01-06-2020)
  #4  
Old 01-06-2020, 08:04
Cesar82's Avatar
Cesar82 Cesar82 is offline
Registered User
 
Join Date: May 2011
Location: Brazil
Posts: 1,081
Thanks: 1,844
Thanked 2,316 Times in 791 Posts
Cesar82 is on a distinguished road
@Razor12911
Now I understand. Thanks!
There will only be differences in the results checking or not DXGI if you use SLI/Crossfire.
Reply With Quote
  #5  
Old 07-06-2020, 06:05
BLACKFIRE69's Avatar
BLACKFIRE69 BLACKFIRE69 is offline
Registered User
 
Join Date: Mar 2019
Location: In the Hell
Posts: 701
Thanks: 486
Thanked 2,622 Times in 574 Posts
BLACKFIRE69 is on a distinguished road
Thumbs up SysInfo Library 2

SysInfo Library 2


Added:
  • CheckIsAdmin
  • CheckIs64Bit
  • GetOSVersionMajor
  • GetOSVersionMinor
  • GetServicePackMajorVersion
  • GetServicePackMinorVersion
  • DirectX Version
  • SoundCardName


Thanks Cesar82, Razor12911 ... who helped.
Attached Images
File Type: png systeminfo2.png (362.7 KB, 132 views)
Attached Files
File Type: rar SysInfo-2.rar (479.5 KB, 39 views)
Reply With Quote
The Following 4 Users Say Thank You to BLACKFIRE69 For This Useful Post:
bunti_o4u (07-06-2020), Harsh ojha (07-06-2020), Jiva newstone (07-06-2020), Razor12911 (07-06-2020)
  #6  
Old 07-06-2020, 09:19
Cesar82's Avatar
Cesar82 Cesar82 is offline
Registered User
 
Join Date: May 2011
Location: Brazil
Posts: 1,081
Thanks: 1,844
Thanked 2,316 Times in 791 Posts
Cesar82 is on a distinguished road
Quote:
Originally Posted by BLACKFIRE69 View Post
SysInfo Library 2
Added:
  • CheckIsAdmin
  • CheckIs64Bit
  • GetOSVersionMajor
  • GetOSVersionMinor
  • GetServicePackMajorVersion
  • GetServicePackMinorVersion
  • DirectX Version
  • SoundCardName

Thanks Cesar82, Razor12911 ... who helped.
Thanks @BLACKFIRE69!
It seems to be working perfectly.

For those who have Inno Setup 6 installed and do not have the knowledge to change the script and want to do the test, I attached to this post the script adapted for Inno Setup 6.0 or newer.
Attached Files
File Type: rar Script_ISV6 (SysInfo-2).rar (1.7 KB, 59 views)
Reply With Quote
The Following 3 Users Say Thank You to Cesar82 For This Useful Post:
BLACKFIRE69 (07-06-2020), Harsh ojha (07-06-2020), Razor12911 (07-06-2020)
  #7  
Old 07-06-2020, 23:20
bunti_o4u's Avatar
bunti_o4u bunti_o4u is offline
Registered User
 
Join Date: Aug 2017
Location: India
Posts: 162
Thanks: 29
Thanked 172 Times in 61 Posts
bunti_o4u is on a distinguished road
Quote:
Originally Posted by BLACKFIRE69 View Post
SysInfo Library 2

Added:
  • DirectX Version
retrieving directX version makes the setup to take more time then if directX is not added in script. pl look into it.

Last edited by bunti_o4u; 07-06-2020 at 23:42.
Reply With Quote
  #8  
Old 08-06-2020, 00:48
BLACKFIRE69's Avatar
BLACKFIRE69 BLACKFIRE69 is offline
Registered User
 
Join Date: Mar 2019
Location: In the Hell
Posts: 701
Thanks: 486
Thanked 2,622 Times in 574 Posts
BLACKFIRE69 is on a distinguished road
Quote:
Originally Posted by bunti_o4u View Post
retrieving directX version makes the setup to take more time then if directX is not added in script. pl look into it.
got it... 👍
Reply With Quote
  #9  
Old 08-06-2020, 01:48
bunti_o4u's Avatar
bunti_o4u bunti_o4u is offline
Registered User
 
Join Date: Aug 2017
Location: India
Posts: 162
Thanks: 29
Thanked 172 Times in 61 Posts
bunti_o4u is on a distinguished road
Quote:
Originally Posted by BLACKFIRE69 View Post
got it... 👍
Soundcard is Realtek high definition audio but it is showing Nvidia high definition audio.
Attached Images
File Type: png Untitled.png (29.6 KB, 116 views)
Reply With Quote
  #10  
Old 08-06-2020, 02:06
DiCaPrIo DiCaPrIo is offline
Registered User
 
Join Date: Apr 2017
Location: Don't Know
Posts: 48
Thanks: 90
Thanked 49 Times in 30 Posts
DiCaPrIo is on a distinguished road
Quote:
Originally Posted by bunti_o4u View Post
Soundcard is Realtek high definition audio but it is showing Nvidia high definition audio.
did you plugin your woofer or earphone
Reply With Quote
  #11  
Old 08-06-2020, 09:33
KaktoR's Avatar
KaktoR KaktoR is offline
Lame User
 
Join Date: Jan 2012
Location: From outer space
Posts: 4,741
Thanks: 1,114
Thanked 7,400 Times in 2,869 Posts
KaktoR is on a distinguished road
Works fine here
Attached Images
File Type: png Unbenannt.png (27.3 KB, 196 views)
__________________
Haters gonna hate
Reply With Quote
The Following 2 Users Say Thank You to KaktoR For This Useful Post:
BLACKFIRE69 (08-06-2020), Gehrman (04-12-2022)
  #12  
Old 09-06-2020, 05:19
Harsh ojha's Avatar
Harsh ojha Harsh ojha is offline
Registered User
 
Join Date: May 2019
Location: INDIA
Posts: 78
Thanks: 527
Thanked 77 Times in 36 Posts
Harsh ojha is on a distinguished road
Perfect
(Low End Pc)
Attached Images
File Type: jpg bandicam 2020-06-07 13-23-14-326.jpg (195.8 KB, 181 views)
__________________
Video Creator
Discord - Harsh_Ojha_748 #8782
Reply With Quote
The Following 2 Users Say Thank You to Harsh ojha For This Useful Post:
BLACKFIRE69 (09-06-2020), Gehrman (04-12-2022)
  #13  
Old 17-03-2021, 09:45
bundy-al bundy-al is offline
Registered User
 
Join Date: Oct 2009
Location: nederland
Posts: 13
Thanks: 1
Thanked 2 Times in 2 Posts
bundy-al is on a distinguished road
Hi is there anyone here on the forum that WILL help me.
I have asked 3 people but no one wants to help.
Who can change the script from Project1 or SysInfo DLL 2 and make it into a batch script ?

Project1 you have to click on a button first to read the GPU Memory, I want the GPU Memory to be read and saved on the desktop as .txt and the script preferably as a batch file.

SysInfo DLL 2 also looks good, but only read out and save as .txt with a batch script.
Now it's a setup and you have to click Next, I don't want to see a fixed screen at all.


This would also be nice in a batch file.

Detecting Graphics Adapter Data

Basic Graphics Information

Adapter 1 Description : NVidia RTX 2070 Super
Adapter 1 Video Memory : 8.00 GB [Rounded Value].
Adapter 1 Driver Date : 2021-02-23
Adapter 1 Driver Version : 27.21.14.6172
Adapter 1 Bits Per Pixel : 32
Adapter 1 Video Mode Desc : 1920 x 1080 x 4294967296 colors

Adapter 2 Intel(R) HD Graphics 4600 (128 MB)
Adapter 2 Video Memory : 128 MB [Rounded Value]
Adapter 2 Driver Date : 2021-02-23
Adapter 2 Driver Version : 27.21.14.6172
Adapter 2 Bits Per Pixel : 32
Adapter 2 Video Mode Desc : 1920 x 1080 x 4294967296 colors

And if that's not possible, then just this,

Adapter 1 Description : NVidia RTX 2070 Super
Adapter 1 Video Memory : 8.00 GB [Rounded Value]
Adapter 2 Intel(R) HD Graphics 4600 (128 MB)
Adapter 2 Video Memory : 128 MB [Rounded Value]

Display this script with read in and then save it to the desktop as a .txt

Please message back if you are willing and able to make this batch script for me please, if you have the time.
Then you are the best for me.

Best regards
Reply With Quote
  #14  
Old 03-09-2022, 23:40
Lord.Freddy's Avatar
Lord.Freddy Lord.Freddy is offline
Registered User
 
Join Date: Apr 2022
Location: ...
Posts: 54
Thanks: 222
Thanked 41 Times in 25 Posts
Lord.Freddy is on a distinguished road
Exclamation Problem

1) Your dll was very good, but in the [ANSI] version, (Free Space) and (Total Space), it shows the disk size incorrectly.

2) Not working on windowsXP (X86)/(X64)
Attached Images
File Type: jpg Capture.JPG (147.9 KB, 74 views)
File Type: jpg Capture1.JPG (74.0 KB, 73 views)
__________________
¤ Life good be a Dream ¤

Last edited by Lord.Freddy; 03-09-2022 at 23:56.
Reply With Quote
  #15  
Old 12-04-2020, 08:11
bunti_o4u's Avatar
bunti_o4u bunti_o4u is offline
Registered User
 
Join Date: Aug 2017
Location: India
Posts: 162
Thanks: 29
Thanked 172 Times in 61 Posts
bunti_o4u is on a distinguished road
Quote:
Originally Posted by BLACKFIRE69 View Post
To reduce the file size, as Cesar82 said, recompiled the source code using "Delphi 2010".

Final Size : SysInfo.dll - 302 kb
Observed three issues. you may choose to fix
01. it is showing GPU name and memory as weird numbers. GPU description is Zotac rtx 2070 super 8GB.
02. 9700k has 8 cores and 8 threads but it is showing as 4 cores and 8 threads.
03. It is showing RAM as 8GB though my pc has 16GB of RAM
Attached Images
File Type: png Untitled.png (18.3 KB, 511 views)

Last edited by bunti_o4u; 12-04-2020 at 08:23.
Reply With Quote
The Following 2 Users Say Thank You to bunti_o4u For This Useful Post:
BLACKFIRE69 (12-04-2020), Titeuf (18-04-2020)
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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Nero Plugin to burn mdf/mds images Kall CD/DVD Software & Utilities 6 09-11-2007 02:29
REQUEST : SDF plugin and AHX tool --=FamilyGuy=-- DC Games 4 20-04-2007 13:13
is there a a gamecube plugin to 3d studio max gamesmell GameCube Games 1 12-03-2004 23:54
FlaskMPEG & Panasonic Plugin: Plugin has "Fatal Error" dan CD/DVD Software & Utilities 1 15-11-2000 16:23



All times are GMT -7. The time now is 01:42.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
FileForums @ https://fileforums.com