Jump to content

[Build 0.03] (Testing needed!) The MiniCL Project - GPU computation made easy


minxomat
 Share

Recommended Posts

Hello.

Here's a small project of mine. Early last year, AndyG wrote OpenCL headers for AutoIt, so you could use GPGPU on OpenCL supported devices. Now, there's a problem. There is some kind of battle going on between OpenCL and CUDA, the latter being NVIDIA exclusive. All of those highly polished GPGPU APIs are highly complex and hard to use in a real script. 

My goal is to eliminate the hurdle of "well, I don't really want to use this bloated API for this small project" and make GPGPU (not only) in AutoIt very feasible, even for beginners.

So I started working on MiniCL. The idea is simple:

  • has to run on AMD, NIVIDIA and Intel GPUs
  • has to be self-contained, no other libraries required
  • as user-friendly as possible, seperate the user completely from any kind of graphics work

 

MiniCL 0.03 (CURRENT)

  1. Please download the attached zip and open Testing.au3
  2. Change the constant in line 75, try every constant
  3. If the output is correct (~25), note that constant
  4. Use GPU-Z to determine your exact GPU model
  5. Copy the compatibility chart at the start of the script and put in your GPU model and all working constants

You should have something like this:

;---------------------------------------------------------------------------------------------------------------------------+
;   AMD Radeon(TM) R5 Graphics (Engineering Sample - WDDM v2.0)     $GL_RGBA32F_ARB             32 bit      4 fpd           |
;                                                                   $GL_RGB32F_ARB              32 bit      3 fpd           |
;                                                                   $GL_INTENSITY32F_ARB        32 bit      1 fpd           |
;                                                                   $GL_RGBA16F_ARB             16 bit      4 fpd           |
;                                                                   $GL_RGB16F_ARB              16 bit      3 fpd           |
;                                                                   $GL_INTENSITY16F_ARB        16 bit      1 fpd           |
;                                                                   $GL_LUMINANCE_ALPHA16F_ARB  16 bit      1 fpd           |
;---------------------------------------------------------------------------------------------------------------------------+

Please post it here in this thread. Don't do this if your GPU was already posted (some new AMD cards are just rebranded old cards...).

 

Features:

  • Compatible with all GPUs
  • Self-Contained
  • Kernels are written in GLSL syntax
  • Manipulates Arrays ByRef, no conversion has to be done by the user
  • Small, measuring 250kB

 

ToDo (Features not yet implemented):

  • Pass unlimited Input and Output structs
  • autoconvert AutoIt Arrays
  • Pass multiple kernel
  • Ping-Pong support in a single MiniCL instance
  • Auto-Limit array size to the max the GPU can handle
  • Adding debug options
  • whatever will pop into my mad mind...

 

Remarks

Fancy graphs will be added later on.

 

Downloads

0.03.zip

Edited by minx

I will answer every single PM, and you are free to ask anything anytime.

Link to comment
Share on other sites

minx,

I have to copy following 2 DLLs to get it run properly:

msvcp120.dll
msvcr120.dll
 
Further after running the example script I get following output:
> Before (5):       5
ERROR - Could not build GLSL shader: varying vec2 location;/* onscreen location */
uniform sampler2D SRC;
uniform vec2 SRCScale;
uniform sampler2D DEST;
uniform vec2 DESTScale;
void main(void){  float c = texture2D(SRC, location).r;  gl_FragColor = c * c + 0.2; }

ERROR LOG:
ERROR: 0:6: 'assign' :  cannot convert from 'float' to 'FragColor 4-component vector of float'



Press ENTER to quit

Might be that my gfx card doesn't support CL properly or something is wrong with the DLL code.

Edited by UEZ

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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Hello Minx,

To avoid the missing runtime libraries problem that UEZ ran into, you'll have to compile with  RunTime Libraries flags /MT /LD; this will generate a dll with the libcmt library placed in the object file for internal linking.

:) Interesting (and quite ambitious) project you're undertaking (I use CUDA myself).

Link to comment
Share on other sites

> Before (5):       5
ERROR LOG:
ERROR: 0:6: 'assign' :  cannot convert from 'float' to 'FragColor 4-component vector of float'
Might be that my gfx card doesn't support CL properly or something is wrong with the DLL code.

Seems odd. I think your GPU is rejecting the 8bit Texture and tries to create an 32bit (4 floats per dot) one. I'll look into that. When testing, please provide your exact GPU model, regardless if it works or not.

 

Hello Minx,

To avoid the missing runtime libraries problem that UEZ ran into, you'll have to compile with  RunTime Libraries flags /MT /LD; this will generate a dll with the libcmt library placed in the object file for internal linking.

 

:) Interesting (and quite ambitious) project you're undertaking (I use CUDA myself).

Aw, forgot that. Thanks ;-) . Does it work for you?

Edited by minx

I will answer every single PM, and you are free to ask anything anytime.

Link to comment
Share on other sites

I have a "Intel HD Graphics 4600"

did not work due, I'd guess, to the missing DLLs, but no clue, just passing the info. for your collection. Added the DLLs to the folder

>"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" /ErrorStdOut "G:\au3s\the-minicl-project-gpu-computation-made-easy\Example #1 - Proof-of-Work - Relevant release MiniCL 0.02.au3"    

> Before (5):       5
ERROR - Could not build GLSL shader: varying vec2 location;/* onscreen location */
uniform sampler2D SRC;
uniform vec2 SRCScale;
uniform sampler2D DEST;
uniform vec2 DESTScale;
void main(void){  float c = texture2D(SRC, location).r;  gl_FragColor = c * c + 0.2; }

ERROR LOG:
ERROR: 0:6: 'assign' :  cannot convert from 'float' to 'FragColor 4-component vector of float'



Press ENTER to quit
Edited by argumentum

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

Please try to replace this in the Kernel code. I made at least this mistake. Let's see if this will fix it :) :

 

" gl_FragColor = c * c + vec4(0.2); " & _ ; Change value
If the above doesn't work I'll carry on. Edited by minx

I will answer every single PM, and you are free to ask anything anytime.

Link to comment
Share on other sites

Please try to replace this in the Kernel code. I made at least this mistake. Let's see if this will fix it :) :

 " gl_FragColor = c * c + vec4(0.2); " & _ ; Change value

If the above doesn't work I'll carry on.

 

>"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" /ErrorStdOut "G:\au3s\the-minicl-project-gpu-computation-made-easy\Example #1 - Proof-of-Work - Relevant release MiniCL 0.02.au3"    

> Before (5):       5
+> MiniCL successfull!
> After (25.2): 5

>Exit code: 0    Time: 0.207
Edited by argumentum

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

  • 4 weeks later...
> Before (5):       5
+> MiniCL successfull!
> After (25):   5

+>20:44:37 AutoIt3.exe ended.rc:0

ok, here is the values that worked:

Global Const $GL_RGBA32F_ARB = 0x8814 ; fail
Global Const $GL_RGB32F_ARB = 0x8815 ; fail
Global Const $GL_ALPHA32F_ARB = 0x8816 ; ok
Global Const $GL_INTENSITY32F_ARB = 0x8817 ; ok
Global Const $GL_LUMINANCE32F_ARB = 0x8818 ; ok
Global Const $GL_LUMINANCE_ALPHA32F_ARB = 0x8819 ; ok
Global Const $GL_RGBA16F_ARB = 0x881A ; fail
Global Const $GL_RGB16F_ARB = 0x881B ; fail
Global Const $GL_ALPHA16F_ARB = 0x881C ; ok
Global Const $GL_INTENSITY16F_ARB = 0x881D ; ok
Global Const $GL_LUMINANCE16F_ARB = 0x881E ; ok
Global Const $GL_LUMINANCE_ALPHA16F_ARB = 0x881F ; ok

Need you help building a basic compatibility chart. Instructions in first post. Thanks.

59                            1                                                                                 
 AcceleratorCapabilities       0                                                                                 
 AdapterCompatibility          Intel Corporation                                                                 
 AdapterDACType                Internal                                                                          
 AdapterRAM                    -2080374784                                                                       
 Availability                  3                                                                                 
 CapabilityDescriptions        0                                                                                 
 Caption                       Intel(R) HD Graphics 4600                                                         
 ColorTableEntries                                                                                               
 ConfigManagerErrorCode        0                                                                                 
 ConfigManagerUserConfig       0                                                                                 
 CreationClassName             Win32_VideoController                                                             
 CurrentBitsPerPixel           32                                                                                
 CurrentHorizontalResolution   1920                                                                              
 CurrentNumberOfColors         4294967296                                                                        
 CurrentNumberOfColumns        0                                                                                 
 CurrentNumberOfRows           0                                                                                 
 CurrentRefreshRate            59                                                                                
 CurrentScanMode               4                                                                                 
 CurrentVerticalResolution     1200                                                                              
 Description                   Intel(R) HD Graphics 4600                                                         
 DeviceID                      VideoController1                                                                  
 DeviceSpecificPens                                                                                              
 DitherType                    0                                                                                 
 DriverDate                    10/01/2013 00:00:00                                                               
 DriverVersion                 10.18.10.3308                                                                     
 ErrorCleared                                                                                                    
 ErrorDescription                                                                                                
 ICMIntent                                                                                                       
 ICMMethod                                                                                                       
 InfFilename                   oem8.inf                                                                          
 InfSection                    iHSWD_w7                                                                          
 InstallDate                   // ::                                                                             
 InstalledDisplayDrivers       igdumdim64.dll,igd10iumd64.dll,igd10iumd64.dll,igdumdim32,igd10iumd32,igd10iumd32 
 LastErrorCode                                                                                                   
 MaxMemorySupported                                                                                              
 MaxNumberControlled                                                                                             
 MaxRefreshRate                75                                                                                
 MinRefreshRate                50                                                                                
 Monochrome                    0                                                                                 
 Name                          Intel(R) HD Graphics 4600                                                         
 NumberOfColorPlanes                                                                                             
 NumberOfVideoPages                                                                                              
 PNPDeviceID                   PCI\VEN_8086&DEV_0412&SUBSYS_D0001458&REV_06\3&11583659&0&10                      
 PowerManagementCapabilities   0                                                                                 
 PowerManagementSupported                                                                                        
 ProtocolSupported                                                                                               
 ReservedSystemPaletteEntries                                                                                    
 SpecificationVersion                                                                                            
 Status                        OK                                                                                
 StatusInfo                                                                                                      
 SystemCreationClassName       Win32_ComputerSystem                                                              
 SystemName                    GZ87                                                                              
 SystemPaletteEntries                                                                                            
 TimeOfLastReset               // ::                                                                             
 VideoArchitecture             5                                                                                 
 VideoMemoryType               2                                                                                 
 VideoMode                                                                                                       
 VideoModeDescription          1920 x 1200 x 4294967296 colors                                                   
 VideoProcessor                Intel(R) HD Graphics Family

 

Edited by argumentum

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

Now I'm confused, you've listed the working constants, but it says 

> Before (5):       5
+> MiniCL successfull!
> After (25):   5

This is not a correct result, though :) . After has to be something around 25.2...

I will answer every single PM, and you are free to ask anything anytime.

Link to comment
Share on other sites

Now I'm confused, you've listed the working constants, but it says 

> Before (5):       5
+> MiniCL successfull!
> After (25):   5

This is not a correct result, though :) . After has to be something around 25.2...

​yep, those are wrong results but are the ones that did not crash.
As those didn't crash I assumed without much more attention that was ok.

that's why I removed the code from the past post where I coded a for loop for the test and a WMI thing to get the video card.

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

​yep, those are wrong results but are the ones that did not crash.As those didn't crash I assumed without much more attention that was ok.

​Now that is weird. Your GPU has to support at least one texture format. There's an error hiding somewhere...

I will answer every single PM, and you are free to ask anything anytime.

Link to comment
Share on other sites

Seems i found the answer...

Intel does not provide a proper, up-to-date OpenGL implementation for their integrated GPUs. There is nothing that can be done about this. NVIDIA and ATI provide good support for their integrated GPUs.

 

Edit:

Intel is a mess! This issue was reported over and over and no fix in sight, duh. https://communities.intel.com/message/263941 

Edited by minx

I will answer every single PM, and you are free to ask anything anytime.

Link to comment
Share on other sites

My output isn't formatted like yours, this was most convenient for me....

 

ATi Radeon HD 4290, onboard, current drivers though the CPU-Z info shows old dates......

CPU-Z graphics info:

Graphics
-------------------------------------------------------------------------

Number of adapters        1

Graphic APIs
-------------------------------------------------------------------------

API                ATI I/O
API                ADL SDK

Display Adapters
-------------------------------------------------------------------------

Display adapter 0    
    Name            ATI Radeon HD 4290
    Board Manufacturer    Micro-Star International Co., Ltd. (MSI)
    Memory size        624 MB
    PCI device        bus 1 (0x1), device 5 (0x5), function 0 (0x0)
    Vendor ID        0x1002 (0x1462)
    Model ID        0x9714 (0x7642)
    Performance Level    0
        Core clock    500.0 MHz
        Memory clock    667.0 MHz
    Performance Level    1
        Core clock    700.0 MHz
        Memory clock    667.0 MHz

Win32_VideoController        AdapterRAM = 0x27000000 (654311424)
Win32_VideoController        DriverVersion = 8.947.0.0
Win32_VideoController        DriverDate = 05/04/2012

 

Working textures:

$GL_RGBA32F_ARB
$GL_RGB32F_ARB
$GL_INTENSITY32F_ARB
 

 

Looking forward to seeing what capabilities this will bring!

Ian

Edited by llewxam

My projects:

  • IP Scanner - Multi-threaded ping tool to scan your available networks for used and available IP addresses, shows ping times, resolves IPs in to host names, and allows individual IPs to be pinged.
  • INFSniff - Great technicians tool - a tool which scans DriverPacks archives for INF files and parses out the HWIDs to a database file, and rapidly scans the local machine's HWIDs, searches the database for matches, and installs them.
  • PPK3 (Persistent Process Killer V3) - Another for the techs - suppress running processes that you need to keep away, helpful when fighting spyware/viruses.
  • Sync Tool - Folder sync tool with lots of real time information and several checking methods.
  • USMT Front End - Front End for Microsoft's User State Migration Tool, including all files needed for USMT 3.01 and 4.01, 32 bit and 64 bit versions.
  • Audit Tool - Computer audit tool to gather vital hardware, Windows, and Office information for IT managers and field techs. Capabilities include creating a customized site agent.
  • CSV Viewer - Displays CSV files with automatic column sizing and font selection. Lines can also be copied to the clipboard for data extraction.
  • MyDirStat - Lists number and size of files on a drive or specified path, allows for deletion within the app.
  • 2048 Game - My version of 2048, fun tile game.
  • Juice Lab - Ecigarette liquid making calculator.
  • Data Protector - Secure notes to save sensitive information.
  • VHD Footer - Add a footer to a forensic hard drive image to allow it to be mounted or used as a virtual machine hard drive.
  • Find in File - Searches files containing a specified phrase.
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

×
×
  • Create New...