Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / CreateImageFromMemblock and running out of memory

Author
Message
Kilian
7
Years of Service
User Offline
Joined: 12th Jan 2017
Location:
Posted: 13th Jan 2017 19:57
Hi!

I try to create an image from memblock. I currently use a graphics card with 1GB RAM. When my memblock (created with ID 100) is about 4 0000 000 fields (size about 16MB) everything works fine. But when I try to create a memblock of 9 000 000 fields (memblock size about 36MB, value returned with agk::GetMemblockSize(100) ) and then try to use agk::CreateImageFromMemblock(image, 100) I get "Uncaught Exception: Ran out of GPU memory, try using smaller or fewer images". On systems with 2GB of GPU RAM this runs fine. Is it really consuming that much memory? Running Process Explorer shows that my app does not request more than 250MB of GPU RAM. What can i do?

Regards

Artur
Kilian
7
Years of Service
User Offline
Joined: 12th Jan 2017
Location:
Posted: 13th Jan 2017 20:09
Sorry, on 2GB system the same happens -- run out of GPU Memory. If I try to create image from memblock of 16 000 000 elements - 64MB of size - it gets even better, I get "Unhandled Exception: Sprite 0 does not exist". ???

Regards
Artur
Kilian
7
Years of Service
User Offline
Joined: 12th Jan 2017
Location:
Posted: 13th Jan 2017 20:27
Edit 2: It happens only in Tier2, Tier1 seems to work fine
Kilian
7
Years of Service
User Offline
Joined: 12th Jan 2017
Location:
Posted: 13th Jan 2017 20:55
Edit 2: Sorry for the confusion, I narrowed the problem further and it seems that not the CreateImageFromMemblock causes the problem, but rather SaveImage.


Artur
damothegreat
User Banned
Posted: 13th Jan 2017 21:08
Is it possible to attach a the memblock chunk of your code, so we can test the memory allocation issue

Again, it maybe to do with incorrect memory referencing from AppGameKit to C variables,

Not sure, without looking at how your coding it

Damo


Using Tier 1 AppGameKit V2
Started coding with AMOS
Works with a Lenovo IdeaPad 700, 1TB SSD (Data), 128GB HD (System), 12GB Ram, GeForce Nvdia 950M, Windows 10, 2.3Ghz (Turbo to 3.2ghz when required)
damothegreat
User Banned
Posted: 13th Jan 2017 21:11
Its always wise to deletememblock() once finished with a block - this should release its memory.



Using Tier 1 AppGameKit V2
Started coding with AMOS
Works with a Lenovo IdeaPad 700, 1TB SSD (Data), 128GB HD (System), 12GB Ram, GeForce Nvdia 950M, Windows 10, 2.3Ghz (Turbo to 3.2ghz when required)
Kilian
7
Years of Service
User Offline
Joined: 12th Jan 2017
Location:
Posted: 13th Jan 2017 21:28


actual_size is anything between 1 and 4000

Regards

Artur
damothegreat
User Banned
Posted: 13th Jan 2017 21:40
Cool. Will come back to you soon to see if I can reproduce the same effect that your experiencing and advise accordingly

Just on with something else at moment

Damo
Using Tier 1 AppGameKit V2
Started coding with AMOS
Works with a Lenovo IdeaPad 700, 1TB SSD (Data), 128GB HD (System), 12GB Ram, GeForce Nvdia 950M, Windows 10, 2.3Ghz (Turbo to 3.2ghz when required)
damothegreat
User Banned
Posted: 13th Jan 2017 22:01
Ok Cool - this does work, but probably looking in wrong area for final destination of the saveimage

I have run it in Tier 1 - and PNG file goes here

C : \ Users \ <Username> \ AppData \ Local\ AGKApps \ <Appname> \ media

For Tier 2, they going in here

C : \ Users \ <Username> \ AppData \ Local \ AGKApps \ My Company \ <Appname>


All I did was do a full filename search of the whole C drive to locate the filename.png and they hide in the above too

Not sure why mine states "My Company" unless it was a mishap when I installed VS15

Damo

Using Tier 1 AppGameKit V2
Started coding with AMOS
Works with a Lenovo IdeaPad 700, 1TB SSD (Data), 128GB HD (System), 12GB Ram, GeForce Nvdia 950M, Windows 10, 2.3Ghz (Turbo to 3.2ghz when required)
Kilian
7
Years of Service
User Offline
Joined: 12th Jan 2017
Location:
Posted: 13th Jan 2017 23:33 Edited at: 16th Jan 2017 14:28
Actually I use my own catalogue structure. Anyway, this does not impact the functionality - values like 3000x3000 and higher stop working. The funny thing is that it sometimes works, sometimes doesn't. Calling GetImageFromMemblock sometimes crashes with 4000x4000, SaveImage ALWAYS crashes. I have to use Tier2 because of some functionality I do not have in Tier1, so I would really appreciate some hints what to do.


Regards

Artur
Qugurun
Valued Member
9
Years of Service
User Offline
Joined: 8th Dec 2014
Playing: AppGameKit
Posted: 14th Jan 2017 19:31
damothegreat, SetRawWritePath ("path")

Login to post a reply

Server time is: 2024-03-28 11:30:00
Your offset time is: 2024-03-28 11:30:00