Gamestudio Links
Zorro Links
Newest Posts
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
Deeplearning Script
by wolfi. 02/26/24 12:46
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/22/24 16:22
AssetAdd() vs. modern asset list?
by jcl. 02/21/24 15:01
How many still using A8
by Aku_Aku. 02/20/24 12:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (degenerate_762, TedMar), 519 guests, and 12 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 3 of 10 1 2 3 4 5 9 10
Re: video memory and d3d_texfree [Re: Ch40zzC0d3r] #465242
04/13/17 20:43
04/13/17 20:43
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,823
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?

Last edited by Reconnoiter; 04/13/17 20:43.
Re: video memory and d3d_texfree [Re: Reconnoiter] #465245
04/13/17 22:26
04/13/17 22:26
Joined: Jul 2004
Posts: 785
Serbia
Iglarion Offline
User
Iglarion  Offline
User

Joined: Jul 2004
Posts: 785
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.

Re: video memory and d3d_texfree [Re: Reconnoiter] #465248
04/14/17 09:46
04/14/17 09:46
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
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

Check out my new game: Pogostuck: Rage With Your Friends
Re: video memory and d3d_texfree [Re: Superku] #465369
04/21/17 16:09
04/21/17 16:09
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
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.

Re: video memory and d3d_texfree [Re: jcl] #465380
04/22/17 01:52
04/22/17 01:52
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
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

Check out my new game: Pogostuck: Rage With Your Friends
Re: video memory and d3d_texfree [Re: Superku] #465382
04/22/17 08:33
04/22/17 08:33
Joined: May 2008
Posts: 2,113
NRW/Germany
alibaba Offline
Expert
alibaba  Offline
Expert

Joined: May 2008
Posts: 2,113
NRW/Germany
I can confirm this behaviour


Professional Edition
A8.47.1
--------------------
http://www.yueklet.de
Re: video memory and d3d_texfree [Re: alibaba] #465394
04/24/17 12:05
04/24/17 12:05
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
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.

Re: video memory and d3d_texfree [Re: jcl] #465397
04/24/17 15:01
04/24/17 15:01
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
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

Check out my new game: Pogostuck: Rage With Your Friends
Re: video memory and d3d_texfree [Re: Superku] #465398
04/24/17 16:17
04/24/17 16:17
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
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.

Re: video memory and d3d_texfree [Re: jcl] #465399
04/24/17 16:32
04/24/17 16:32
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
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.

Last edited by Superku; 04/24/17 16:35.

"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Page 3 of 10 1 2 3 4 5 9 10

Moderated by  old_bill, Tobias 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1