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.

DarkBASIC Professional Discussion / Image memory usage increased since 5.8

Author
Message
Morcilla
22
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 19th Jul 2005 02:56
Hi there,

I have a project that was loading fine 31 images. Now it stops in image 19, sometimes 20. "Could not load image at line xxx" says.

That's a 30% less than before!

Well, I've printed

SYSTEM SMEM AVAILABLE()

and it goes slowly down as it loads the images, starting in 138 until it gives the error about 40.

I have 512Mb of ram (and it says so with SYSTEM TMEM AVAILABLE()), and Radeon 9700pro 128Mb video ram (and it says so with SYSTEM DMEM AVAILABLE()). None of them decrease during the load.

Now this happens too here:

http://forum.thegamecreators.com/?m=forum_view&t=56556&b=15

http://forum.thegamecreators.com/?m=forum_view&t=51130&b=1

Well, erasing the .dbpro and rebuild it had no effect.
Adding ,1 after the load image was succesful (I had enough memory), but, who wants to disable mipmapping?

Now, I'm sure (I could be wrong, as always ) this wasn't happening before 5.8

Anyone else having the same problem? Do you know how to declare the number of mipmaps?

And, why video ram isn't decreasing?

Uh, I don't want to size down these bitmaps! They loaded before! And my hardware is the same!

Any ideas please?

Thanks in advance.
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 19th Jul 2005 03:20
Quote: "Adding ,1 after the load image was succesful (I had enough memory), but, who wants to disable mipmapping?"

Most people...

Sounds like someones got an internal graphics card...

George "Dubya" Bush says: 'I play AtomZ to keep my brain supple. Here it found be:http://www.nichkk.plus.com/'
http://spaces.msn.com/members/BouncyBrick/
the_winch
22
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 19th Jul 2005 03:38
Quote: "Most people..."


Most people here make 3d games why would they want to disable mipmapping?

Quote: "Sounds like someones got an internal graphics card..."


Quote: "and Radeon 9700pro 128Mb video ram"


Morcilla
22
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 19th Jul 2005 03:38 Edited at: 19th Jul 2005 03:40
Thanks, Bouncy Brick.

Most people... Why? Excuse my ignorance, but I supossed things look better with mipmapping.

Quote: "Sounds like someones got an internal graphics card..."

Not me, what do you mean?

Edit: Yep! the_winch, now I see your post. I was feeling like once again, lol.
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 19th Jul 2005 03:50
Quote: "Most people here make 3d games why would they want to disable mipmapping?"

For any needed 2D graphics for one.

Quote: "but I supossed things look better with mipmapping."

Sometimes, but only if they large enough to start with.

George "Dubya" Bush says: 'I play AtomZ to keep my brain supple. Here it found be:http://www.nichkk.plus.com/'
http://spaces.msn.com/members/BouncyBrick/
Morcilla
22
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 19th Jul 2005 03:54 Edited at: 19th Jul 2005 04:24
Uh The shorter the better, I suppose. Thanks anyway.
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 19th Jul 2005 04:15
Okay

George "Dubya" Bush says: 'I play AtomZ to keep my brain supple. Here it found be:http://www.nichkk.plus.com/'
http://spaces.msn.com/members/BouncyBrick/
Morcilla
22
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 19th Jul 2005 20:25
Quote: "Okay
"

...If you say so...

Shouldn't the windows swap file enter in action when the system is running out of memory?

I'm plenty of swap file, therefore of system memory.

Why do we get "Could not load image at line xxx" then?
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 19th Jul 2005 20:36
Quote: "Shouldn't the windows swap file enter in action when the system is running out of memory?"

Its not actually running out of system memory though - and its probably in use pretty much all the time anyway

Quote: "Why do we get "Could not load image at line xxx" then?"

Because other things are in VRAM - perhaps a high resolution screen, bitmaps, 3D objects too...

Vote For AtomZ - You know it makes senze
http://spaces.msn.com/members/BouncyBrick/
Morcilla
22
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 19th Jul 2005 22:25
If VRAM (video ram) is running out, it automatically should use the system memory, through the GART, depending on the AGP aperture size (AAS).

My AAS was of 128Mb, that's a total of 256Mb (on-board video memory 128Mb + 128Mb from AAS).

I increased the AAS to 256Mb, for a total of 384Mb video memory, but no success...
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 19th Jul 2005 22:26 Edited at: 19th Jul 2005 22:27
Quote: "it automatically should use the system memory"

Dont think its automatic. Anyway, lets see some code & if you can make all the images availiable, that will be useful too.

Vote For AtomZ - You know it makes senze
http://spaces.msn.com/members/BouncyBrick/
Morcilla
22
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 19th Jul 2005 23:35 Edited at: 19th Jul 2005 23:37
Quote: "Dont think its automatic."

If you're going to rebate me, please, tell me what you know, not what you think. However I appreciate your interest and want to thank you for that.

Cheers.

http://support.microsoft.com/default.aspx?scid=kb;en-us;263039

GART is a chipset driver, that usually comes included with the videocard/motherboard drivers and windows. It should take care of the VRAM, and "steal" as much system memory as the AAS limit, if needed.
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 20th Jul 2005 01:15
Quote: "If you're going to rebate me, please, tell me what you know, not what you think"

I was going by what DirectX 9.0 does - not the driver.

Vote For AtomZ - You know it makes senze
http://spaces.msn.com/members/BouncyBrick/
Morcilla
22
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 20th Jul 2005 19:32 Edited at: 20th Jul 2005 20:47
Ok, Bouncy Brick. Sorry if I did not understand you.

What I tested so far:

- AGP aperture size increased: no change
- Display settings->Advanced options->3D->Directx->Texture Quality->low: no change
- Display settings->Advanced options->3D->Directx->Mipmap Quality->low: no change
- System settings->Performance->Advanced->Optimize->System cache: no change
- Updating video drivers: no change
- Increase free ram with Rambooster1.6 : no change
- Install Windows SP2: no change
- Updating BIOS: no change
- Updating motherboard drivers: +6 more images than before were able to load!

The motherboard drivers included the gart drivers for the nvidia nforce chipset.

If I have time I'll do a test program. We could test how many 512x512 images can load in different systems...
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 20th Jul 2005 19:56
Hey Morcilla, instead of doing all those updates, did you try installing a previous version of DBP to see if that was infact the problem?

Might be a good idea, seen as you think it was working before

Team EOD :: All-Round Nice Guy
Want Better dbHelp Files?
Morcilla
22
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 20th Jul 2005 20:34 Edited at: 20th Jul 2005 20:44
@JessTicular, that could be a good idea.
We could test this program also:



It creates an image, saves it to disk, and try to load it as many times as it can. Add ",1" at the end of the "load image" command, to turn off mipmapping.

I suggest that if any of you hasn't still upgraded to 5.8, test it for us.

My numbers:

171 512x512 images loaded with mipmapping

1682 512x512 images loaded withOUT mipmapping


Now here is the strange thing, if we calculate the total memory used with mipmapping:
(
1x512 = 1Mb +
1x256 = 0,5Mb +
1x128 = 0,25Mb +
1x64 = 0,125Mb +
1x32 = 0,0625Mb +
1x16 = 0,03125Mb +
1x8 = 0,015625Mb +
1x4 = 0,0078125Mb +
1x2 = 0,00390625Mb +
1x1 = 0,001953125Mb ) * 171 images = 341,6 Mb

But if we calculate the same WITHOUT mipmapping, we have:!

(1x512 = 1Mb ) * 1682 images = 1682 Mb !!!!!!!!!!!!!


I would have expected to load 341 images of 1Mb, not 1682! The swap file grown to 1.2Gb! Now this is using ALL my memory, FIVE times more than before!

If the same memory would be used with mipmapping, I estimate I would be able to load about 800 images (4.6 times more than 171).

So there's something wrong with the load, not being able to load the mipmapping "not locally" or something...

Please tell us your numbers

Oh yeah, my specs:

512Mb Ram
128Mb Video Ram
256Mb AGP aperture size
1593Mb Swap file
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 20th Jul 2005 21:34
Don't know if this helps as I don't understand what you are trying to show. Reloading a 1MB huge bitmap is not a normal thing you would want to do.

Using DBPro 5.8 on WinXP SP2 with 512MB RAM and 128MB Geforce Ti4600

Test 1 gives 148 images
Test 2 gives 1780 images and increases swap from normal 786KB to 1.5GB and almost kills the pc. Reboot gets things back to normal.


Morcilla
22
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 20th Jul 2005 21:51 Edited at: 20th Jul 2005 21:57
@spooky, well it's just an example.
I guess you are loading some 512x512 bitmaps for your best textures (player object, etc.) and with mipmapping it uses 2Mb of memory (1Mb without it), so as you can see, it is very normal and not so huge in my oppinion.

Of course, you're not reloading, but loading several different textures of the same size. To load the same all the time it's only in the example, so I have to provide no media files, you know.

Dont' you think that 148 images is a poor number compared with 1780 images?

By now I'm trying to show that we cannot load as many mipmapped textures as we should be able to, and want to know if we could consider this a bug or what...

Maybe any TGC programmer could come around
NeX the Fairly Fast Ferret
20
Years of Service
User Offline
Joined: 10th Apr 2005
Location: The Fifth Plane of Oblivion
Posted: 21st Jul 2005 06:21
It's what they invented blend mapping for.... You shouldn't really need textures bigger than 256x256x16 in my opinion.

My programs on average: 500-2000 lines
An average GameCube game: 5000+
Windows XP: Too much to fit on this screen.
ZioNz
21
Years of Service
User Offline
Joined: 4th Sep 2003
Location:
Posted: 21st Jul 2005 07:30
This also happen when you load textured objects? ie: loading 200 objects textured with 512x512 images?

-
Morcilla
22
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 21st Jul 2005 08:28 Edited at: 21st Jul 2005 09:07
@NeX the Fairly Fast Ferret:
Now that's a blow of fresh air, thanks a lot. But, shouldn't we need then a bigger number of textures?

Also, 256x256x16 = 0.5Mb with mipmaping, yes we divide the problem by 4, but we are still using the same amount of maximum memory.

@ZioNz:
Quote: "This also happen when you load textured objects?"


What do you mean with "This". If you are asking if you're going to run out of memory, well, not. You can use:

SET OBJECT TEXTURE Object Number, Texturing Mode, Mipmap Flag

with "Mipmap Flag" = 1 (or 0, you know I had 50% ) to turn mipmapping on/off.

or

SET OBJECT Object Number, Wire, Transparent, Cull, Filter

with "Filter" = 0,1,2 (0 for no-mipmapping).

Otherwise, yes, dbpro uses mipmapping on as default. But hey, you have to test it!

So maybe we have to choose more carefully mipmapped and not-mipmapped objects. Since it seems, at this moment (5.8, or directx) that:

- Mipmapped textures can only load on VRAM. (We can obtain the maximun reliable with the "SYSTEM DMEM AVAILABLE()" command, although it's slow).

- Non-mipmapped textures can load even into swap file. (Uh, limit above 500Mb, loosing performance).

So it would be a nice idea to include an option for the end-user to turn mipmaping on/off, so he/she can choose the best deal, if not, we could see unexpected/unsolvable errors arising on some systems. (lots of / lol)

Interesting, isn't it?
Morcilla
22
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 22nd Jul 2005 20:11
So, anybody still with 5.7?

I should have added a question mark at the end of this thread subject

Also, I think it is a good idea to turn mipmap off while developing/testing, so the program starts quicker
Stringer2
19
Years of Service
User Offline
Joined: 24th Jul 2005
Location:
Posted: 25th Jul 2005 01:29
Quote: "So, anybody still with 5.7?"


I tried it with the trial version (5.3?) and seemed to work just fine. I ended both tests (with and without the mipmapping) when there was about 800 images loaded.

I have no idea how 5.8 would perform with me, since I dont have it.
Morcilla
22
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 26th Jul 2005 20:52
@Stringer2, thanks a lot. Now that can prove something!

At least, if I understand, you're able to load 800 mipmapped textures (5.3), while we only can 148 (spooky) and 171 (me) (5.8).

Now those 800 wouldn't fit in any VRAM (1598,4 MB !!!), so they must be loading outside it!

I think we should investigate this. As far as I know, DirectX allows loading mipmapped textures outside VRAM, so this must be a DBPro 5.8 limitation!
ZioNz
21
Years of Service
User Offline
Joined: 4th Sep 2003
Location:
Posted: 26th Jul 2005 21:37
I tried your test program and i could load 120 mipmapped textures and 1500+ with no mipmap (i cancelled the test at that point), 120 mipmapped textures should be at least 120mb of video memory right? but my gfx card is a radeon 9500 with 64mb ONLY. so i think all the textures cant be stored in the vram.

-
Morcilla
22
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 26th Jul 2005 23:42 Edited at: 28th Jul 2005 00:42
@ZioNz, I bet yo have an AAS (AGP Aperture Size) of 128Mb or more. Check it at your Bios.
My Radeon only has 128Mb, but I can load 171 mipmapped images if I use 256Mb AAS.

So AAS memory works fine as VRAM, but not the remaining system's memory.

You should be able to load around 750 mipmapped images.

Also check this:

http://developer.nvidia.com/object/General_FAQ.html#t1
Stringer2
19
Years of Service
User Offline
Joined: 24th Jul 2005
Location:
Posted: 27th Jul 2005 00:13
Quote: "At least, if I understand, you're able to load 800 mipmapped textures (5.3), while we only can 148 (spooky) and 171 (me) (5.8).

Now those 800 wouldn't fit in any VRAM (1598,4 MB !!!), so they must be loading outside it!"


Yes, with the 5.3 SMEM did start from something like 2.5gb (showed as bytes?) and shrinked to something like 1gb before I ended the test. I also just tried the version 5.8 and it shows SMEM of little bit over 622 (are those megabytes?) and didn't let me load more than 161 images.
Morcilla
22
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 27th Jul 2005 00:24
@Stringer2, maybe you can post your VRAM amount, so we can give some light about ZioNz's question. Do you have also 64Mb?

To TGC developers, maybe the 5.8 engine uses D3DPOOL_DEFAULT, instead of D3DPOOL_MANAGED?
It is not a problem that it works like this, as far as there is a reason why (performance?), but the users should know about these kind of changes, don't you think so?
Stringer2
19
Years of Service
User Offline
Joined: 24th Jul 2005
Location:
Posted: 27th Jul 2005 06:19
I have 128mb VRAM.
Morcilla
22
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 28th Jul 2005 00:14
@Stringer2, thanks again. Without you there would have been no test. It's also surprising that SMEM returns different values in 5.3 and 5.8 and yes, the 622 must be megabytes.

I guess you do not have 5.3 anymore, maybe some TGC people could show around, so we don't have to spend any more time testing their product. I don't want to spend my life installing and uninstalling DBPro.

Quote: "... just tried the version 5.8 ... and didn't let me load more than 161 images."


I have also 128Mb VRAM, then:

- DBPro 5.8 with 128Mb VRAM = 161 images
- DBPro 5.3 with 128Mb VRAM = 800 images

I think I'm posting this at the bug forum...

Login to post a reply

Server time is: 2025-06-05 21:03:57
Your offset time is: 2025-06-05 21:03:57