Gamestudio Links
Zorro Links
Newest Posts
How to save the contents of an array, WRS/resource
by Superku
Today at 07:43
Shadows Flickering
by Dooley
Today at 07:36
PSSM shadows are flickering and are change darkness level
by Dooley
Today at 02:46
Retrieving Zorro S after a couple of years
by chepstow
Yesterday at 22:53
[ALL STYLES] 2D Videogame Artist (pixel, vector, painted)
by jumpman
Yesterday at 21:18
AUM Magazine
Latest Screens
Triton Wing
ZeaL
Computer Repair Simulator
Collider (working title)
Space Rider
Who's Online
14 registered (jyd, Jens, MatPed, Calli, kmerlo, ibne, Dooley, Dalla, jumpman, Ezzett, 2 invisible), 392 Guests and 4 Spiders online.
Key: Admin, Global Mod, Mod
Newest Members
marx_vonde, A_Dearheart, adamcurry, lucnes, Mike429
17629 Registered Users
Page 3 of 6 < 1 2 3 4 5 6 >
Topic Options
Rate This Topic
#465242 - 04/13/17 22:43 Re: video memory and d3d_texfree [Re: Ch40zzC0d3r]
Reconnoiter Offline
Serious User

Registered: 12/26/11
Posts: 1699
Loc: Netherlands
Originally Posted By: Ch40zzC0d3r
x86 processes can only take a maximum of 2gb ram if the app wasnt compiled with a special flag (/LARGEADDRESSAWARE) which allows to address up to 4gb ram.
, maybe its possible to enforce that flag?


Edited by Reconnoiter (04/13/17 22:43)

Top
#465245 - 04/14/17 00:26 Re: video memory and d3d_texfree [Re: Reconnoiter]
Iglarion Offline
User

Registered: 07/09/04
Posts: 764
Loc: Serbia
Originally Posted By: Reconnoiter
Originally Posted By: Ch40zzC0d3r
x86 processes can only take a maximum of 2gb ram if the app wasnt compiled with a special flag (/LARGEADDRESSAWARE) which allows to address up to 4gb ram.
, maybe its possible to enforce that flag?

But we here talking about out of memory problem if game use just 1GB, so something is definitely wrong here. I agre with Superku idea about one unofficial relase for us who have this problem. I just hope is possible to put some extra debuging in engine to finally isolate the problem.
Jcl what do you think about this did you can help somehow? I really understand it's very difficult without enough information and test project say something more, but do you have any advice on what we should pay attention to find reason of this error.
Too many people with a completely different games have this problem, but none of us has any idea why this is happening.

Top
#465248 - 04/14/17 11:46 Re: video memory and d3d_texfree [Re: Reconnoiter]
Superku Online
Senior Expert

Registered: 09/13/03
Posts: 6552
Loc: Kiel (Germany)
Originally Posted By: Reconnoiter
@Superku, could try setting this d3d_texdepth = 16; before level loading? (so e.g. in your main function)

Never tried that but I'm not trying to avoid this error message, I'm trying to isolate (and indirectly fix) that bug or error.
As I've said the game even gave me the DirectX error on my laptop (8GB RAM) while using less than 300 MB according to the task manager.
Trying to avoid that error by various measures is not helping, it's rather counterproductive IMO.
_________________________
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Superku side-scroller: ~98.5% (??????!??)

Steam® Store Page ("Coming Soon"): http://store.steampowered.com/app/407570 Wowowowow!

Top
#465369 - 04/21/17 18:09 Re: video memory and d3d_texfree [Re: Superku]
jcl Offline

Chief Engineer

Registered: 07/22/00
Posts: 25499
Loc: Frankfurt
Large address aware linking won't help with video memory issues.

But can't you just check and print the d3d_tex... variables in several steps during initialization of your game? This should tell you where the problem is. Maybe some particularly large textures.

Top
#465380 - 04/22/17 03:52 Re: video memory and d3d_texfree [Re: jcl]
Superku Online
Senior Expert

Registered: 09/13/03
Posts: 6552
Loc: Kiel (Germany)
Code:
///////////////////////////////
#include <acknex.h>
#include <default.c>
///////////////////////////////

void main()
{
	fps_max = 60;
	video_mode = 6;
	camera.stage = view_create(0);
	set(camera.stage,PROCESS_TARGET);
	level_load(NULL);
	me = ent_create(CUBE_MDL,vector(128,0,0),NULL);
	var videoSwitchCounter = 32;
	var videoSwitchMode = 8;
	while(1)
	{
		my.pan += 6*time_step;
		draw_text(str_printf(NULL,"d3d_texbmaps: %.1f",(double)d3d_texbmaps),20,20,COLOR_WHITE);

		videoSwitchCounter = maxv(videoSwitchCounter-time_step,0);
		if(!videoSwitchCounter)
		{
			videoSwitchCounter = 16;
			videoSwitchMode++;
			if(videoSwitchMode > 12) videoSwitchMode = 8;
			video_switch(videoSwitchMode,0,2);
		}
		wait(1);
	}
}



d3d_texbmaps rises continuously (except a small bump going from highest to lowest resolution). Let a similar more resource heavy test run until > 65GB.
Does that make sense? Is this just a bug with the variable d3d_texbmaps (like that one nexus variable bug) or something else with the memory allocation for the post processing stage (target)?
_________________________
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Superku side-scroller: ~98.5% (??????!??)

Steam® Store Page ("Coming Soon"): http://store.steampowered.com/app/407570 Wowowowow!

Top
#465382 - 04/22/17 10:33 Re: video memory and d3d_texfree [Re: Superku]
alibaba Offline
Expert

Registered: 05/05/08
Posts: 2050
Loc: NRW/Germany
I can confirm this behaviour
_________________________
Professional Edition
A8.47.1
--------------------
http://www.yueklet.de

Top
#465394 - 04/24/17 14:05 Re: video memory and d3d_texfree [Re: alibaba]
jcl Offline

Chief Engineer

Registered: 07/22/00
Posts: 25499
Loc: Frankfurt
d3d_texbmaps is indeed not reduced by releasing the old textures when switching the resolution. I have put this on the bug list. But you should still be able to find the problem this way when you don't change the resolution.

Top
#465397 - 04/24/17 17:01 Re: video memory and d3d_texfree [Re: jcl]
Superku Online
Senior Expert

Registered: 09/13/03
Posts: 6552
Loc: Kiel (Germany)
Originally Posted By: jcl
But can't you just check and print the d3d_tex... variables in several steps during initialization of your game? This should tell you where the problem is. Maybe some particularly large textures.
[...]
But you should still be able to find the problem this way when you don't change the resolution.

I'm sorry but I don't really understand how. Here's the IMO relevant part of the acklog just created:

Code:
Video memory found: 4094 MB

main_event() at frame 4... (nexus: 31.7/ 150.0) (sys_memory: 219.3) (d3d_texfree: 4072.0) (d3d_texbmaps: 1.0) (d3d_texskins: 0.0) (d3d_texsmaps: 0.0) (d3d_texsurfs: 0.0).


create_rendertargets() START at frame 17... (nexus: 35.8/ 150.0) (sys_memory: 219.3) (d3d_texfree: 4071.0) (d3d_texlimit: 8192.0) (d3d_texbmaps: 1.0) (d3d_texskins: 0.0) (d3d_texsmaps: 0.0) (d3d_texsurfs: 0.0)
bmap_createblackDEBUG(1920,1080,24)...DONE. (CAMTARG1, d3d_texbmaps: 1.0)
bmap_createblackDEBUG(1920,1080,24)...DONE. (KUREF, d3d_texbmaps: 1.0)
bmap_createblackDEBUG(1920,1080,24)...DONE. (REFRAC, d3d_texbmaps: 1.0)
bmap_createblackDEBUG(1920,1080,24)...DONE. (CAMBMAP, d3d_texbmaps: 1.0)
bmap_createblackDEBUG(960,540,24)...DONE. (COMBINE, d3d_texbmaps: 1.0)
bmap_createblackDEBUG(480,270,24)...DONE. (BLOOM2, d3d_texbmaps: 1.0)
bmap_createblackDEBUG(1920,1080,24)...DONE. (COMBINE2, d3d_texbmaps: 1.0)
bmap_createblackDEBUG(1920,1080,24)...DONE. (LOADDISPLAY, d3d_texbmaps: 1.0)DONE
MEMORY NOW (after all bmap creations): (nexus: 35.8/ 150.0) (sys_memory: 219.3) (d3d_texfree: 4071.0) (d3d_texlimit: 8192.0) (d3d_texbmaps: 1.0) (d3d_texskins: 0.0) (d3d_texsmaps: 0.0) (d3d_texsurfs: 0.0) (sum: 1.0MB)

level_load(NULL)

main_event() at frame 20... (nexus: 42.8/ 150.0) (sys_memory: 219.4) (d3d_texfree: 4071.0) (d3d_texbmaps: 26.0) (d3d_texskins: 0.0) (d3d_texsmaps: 0.0) (d3d_texsurfs: 0.0)
main_event() at frame 21... (nexus: 42.8/ 150.0) (sys_memory: 219.4) (d3d_texfree: 4045.0) (d3d_texbmaps: 111.3) (d3d_texskins: 0.0) (d3d_texsmaps: 0.0) (d3d_texsurfs: 0.0)
main_event() at frame 22... (nexus: 42.8/ 150.0) (sys_memory: 219.4) (d3d_texfree: 3993.0) (d3d_texbmaps: 111.3) (d3d_texskins: 0.0) (d3d_texsmaps: 0.0) (d3d_texsurfs: 0.0)

level_load(...)

main_event() at frame 57... (nexus: 61.2/ 150.0) (sys_memory: 219.4) (d3d_texfree: 3993.0) (d3d_texbmaps: 111.3) (d3d_texskins: 0.0) (d3d_texsmaps: 0.4) (d3d_texsurfs: 0.1)

// now playing the game normally, task manager RAM usage at 1060MB
main_event() at frame 394... (nexus: 64.0/ 150.0) (sys_memory: 219.4) (d3d_texfree: 3962.0) (d3d_texbmaps: 127.5) (d3d_texskins: 4.5) (d3d_texsmaps: 0.4) (d3d_texsurfs: 0.1)


All values are the same as they used to be, right now it doesn't crash though. I had the d3d_... stuff in place before when it was crashing every time, did not see anything unusual there.
I don't think I've even added a single new texture or changed an old one (in size), just stuff in the code.

This cannot be "another" compiler related issue like in some past bug hunts where changing stuff in the code lead to crashes (mostly on MDL loading I think), right?
_________________________
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Superku side-scroller: ~98.5% (??????!??)

Steam® Store Page ("Coming Soon"): http://store.steampowered.com/app/407570 Wowowowow!

Top
#465398 - 04/24/17 18:17 Re: video memory and d3d_texfree [Re: Superku]
jcl Offline

Chief Engineer

Registered: 07/22/00
Posts: 25499
Loc: Frankfurt
If you mean with "crashing" not having enough video memory, then no, this is not caused by the compiler. The compiler translates C to machine language. It has nothing to do with your video memory.

However, I've meanwhile looked through some developer forums and it seems that E_OUTOFMEMORY can also happen when in fact video memory is still available. The object creation failed then for a different reason, for instance when the required format is not available or the system memory runs low. So we can not trust that E_OUTOFMEMORY always means that the 4 GB video memory are used up.

Top
#465399 - 04/24/17 18:32 Re: video memory and d3d_texfree [Re: jcl]
Superku Online
Senior Expert

Registered: 09/13/03
Posts: 6552
Loc: Kiel (Germany)
Yes, sorry, I meant the old

"Error E2005: Can't create DirectX texture unnamed
D3D_TexCreate: 8007000e - E_OUTOFMEMORY"

message. Got this message again 15min ago after switching resolutions a couple of times.
However, I noticed I can continue playing after closing all of these messages. In fact, depending on the size of the resolution I get 0, 1 (just once) or 8 E_OUTOFMEMORY errors which is the number of newly (re-)allocated render targets.
The error messages appear at the end of the frame (esp. after all bmap_createblack(DEBUG) calls in the log above and after MEMORY NOW).
I had added a GetAvailableTextureMem() call after my previous post. It returned (GetAvailableTextureMem: 4278190080) before the D3D messages.

What can I do or try next?

EDIT: The ninja edit! ->
Originally Posted By: jcl
However, I've meanwhile looked through some developer forums and it seems that E_OUTOFMEMORY can also happen when in fact memory is still available. [...]

After closing all of the E_OUTOFMEMORY errors it seems like I can continue playing normally with my render chain still in tact. The bitmap pointers all have received new and non-zero addresses, too.


Edited by Superku (04/24/17 18:35)
_________________________
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Superku side-scroller: ~98.5% (??????!??)

Steam® Store Page ("Coming Soon"): http://store.steampowered.com/app/407570 Wowowowow!

Top
Page 3 of 6 < 1 2 3 4 5 6 >


Moderator:  elsewood, old_bill, Tobias 

Gamestudio download | chip programmers | Zorro platform | shop | resources | magazine | manual | support faq | bugs | beta features

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) 3dgamestudio.net