Login
Username:

Password:

Remember me



Lost Password?

Register now!
Sections
Who's Online
60 user(s) are online (46 user(s) are browsing Forums)

Members: 0
Guests: 60

more...
Support us!
Recent OS4 Files
OS4Depot.net
Report message:*
 

Re: RadeonHD 3.x bug (?): more than ~256mb of used GPU (second chunk) memory cause a heavy lockup/crash.

Subject: Re: RadeonHD 3.x bug (?): more than ~256mb of used GPU (second chunk) memory cause a heavy lockup/crash.
by kas1e on 2019/9/27 19:17:49

@All
Was able to create test-case with just pure ogles2 , without gl4es and without SDL: and when i cross the line of 256mb our crash/lockup is here.

There is test case anyone can try:

#include <stdlib.h>
#include <stdio.h>
#include <proto/exec.h>
#include <proto/intuition.h>
#include <GLES2/gl2.h>
#include <proto/ogles2.h>


struct Library *OGLES2 NULL;
struct OGLES2IFace *IOGLES2 NULL;

void texturesload_crash(void)
{


// 100 : eat 34 mb of GPU 
// 200 : eat 68 mb of GPU 
// 300 : eat 101 mb of GPU 
// 400 : eat 135 mb of GPU 
// 500 : eat 168 mb of GPU 
// 600 : eat 202 mb of GPU 
// 700 : eat 235 mb of GPU 
// 750 : eat 252 mb of GPU 

// 764 : fill 256 mb of GPU , but not overbound to 257 mb at moment 
// 765 : now we cross the line of 256 mb => CRASH 


    
int num_of_textures 764;

    
int width 256;
    
int height 256;
    
unsigned char *data;
    
data malloc(width*height*3);    

    
GLuint TextureID[num_of_textures];
        
    for(
int a=0;a<num_of_textures;a++)
    {
        
glGenTextures1, &TextureID[a]);
        
glBindTextureGL_TEXTURE_2DTextureID[a]);
        
glTexImage2D(GL_TEXTURE_2D0GL_RGBwidthheight,0GL_RGBGL_UNSIGNED_BYTEdata);
        
    }

    
free(data);


}



/*  Main Loop
 *  Open window with initial window size, title bar,
 *  RGBA display mode, and handle input events.
 */
int main(int argcchar** argv)
{

        
OGLES2 IExec->OpenLibrary("ogles2.library",0);
        
IOGLES2 = (struct OGLES2IFace *)IExec->GetInterface(OGLES2"main"1NULL);
        


        
ULONG errCode 0;
           const 
char titleStrBase[] = "Hello OpenGLES2";
        
struct Window *win=IIntuition->OpenWindowTags(NULL,
                                
WA_Title,                titleStrBase,
                                
WA_Activate,            TRUE,
                                
WA_RMBTrap,                TRUE,
                                
WA_DragBar,                TRUE,
                                
WA_DepthGadget,            TRUE,
                                
WA_SimpleRefresh,        TRUE,
                                
WA_CloseGadget,            TRUE,
                                
WA_SizeGadget,            TRUE,
                                
WA_IDCMP,                IDCMP_REFRESHWINDOW IDCMP_NEWSIZE 
                                                        
IDCMP_CLOSEWINDOW IDCMP_RAWKEY,
                                
WA_InnerWidth,            500,
                                
WA_InnerHeight,            200,
                                
WA_MinWidth,            100,
                                
WA_MinHeight,            100,
                                
WA_MaxWidth,            2048,
                                
WA_MaxHeight,            2048,
                                
WA_BackFill,             LAYERS_NOBACKFILL,
                                
TAG_DONE);
        
    
struct TagItem contextparams[] =
    {
            {
OGLES2_CCT_WINDOW,(ULONG)win},
            {
OGLES2_CCT_DEPTH,16},
            {
OGLES2_CCT_STENCIL,8},
            {
OGLES2_CCT_VSYNC,0},
            {
OGLES2_CCT_SINGLE_GET_ERROR_MODE,1},
            {
OGLES2_CCT_RESIZE_VIEWPORTTRUE},
            {
TAG_DONE,0}
    };
        
    
void *ogles_context aglCreateContext2(&errCode,contextparams);

      if (
ogles_context)
    {
        
aglMakeCurrent(ogles_context);

        
texturesload_crash();
        
        
BOOL bRun TRUE;

        if (!
IIntuition->ModifyIDCMP(winIDCMP_VANILLAKEY|IDCMP_MOUSEMOVE|IDCMP_MOUSEBUTTONS|IDCMP_NEWSIZE|IDCMP_CLOSEWINDOW))
            
bRun FALSE;

        while (
bRun)
        {
            
struct IntuiMessage *imsg;


            
aglSwapBuffers();

            while ((
imsg = (struct IntuiMessage *)IExec->GetMsg(win->UserPort)))
            {
                switch (
imsg->Class)
                {
                    case 
IDCMP_CLOSEWINDOW:
                        
bRun FALSE;
                        break;
                    case 
IDCMP_VANILLAKEY:
                        switch (
imsg->Code)
                        {
                            case 
27:
                                
aglDestroyContext(ogles_context);
                                
IIntuition->CloseWindow(win);
                                exit(
0);
                                break;
                        }
                        
                    default:
                        break;
                }
                
IExec->ReplyMsg((struct Message *)imsg);
                }
        }
        
aglDestroyContext(ogles_context);
        
IIntuition->CloseWindow(win);
    }    
    return 
0;
}


Build it just like "gcc -Wall test.c -o test -lauto"

As can be seen in comments, when we will 764 textures of our size we will fully 256 mb , but not cross the line : system operational, all fine. But then, once we add a little bit and cross 256mb line, then BAH !

That on x5000.

If anyone can try it on x1000, will be good to know.. As well as with Sysmon's System tab opened, and auto-refresh mark ticked. The field to watch "Used GPU".

Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project