[DX9] calling all intel gma owners

Discussion in 'Game Development (Technical)' started by TheMysteriousStranger, Jun 26, 2010.

  1. TheMysteriousStranger

    Original Member

    Joined:
    Jan 17, 2006
    Messages:
    222
    Likes Received:
    0
    I have an annoying problem - my current game is refusing to start on a laptop powered with intel's integrated gma card.

    I have another problem too - it's not my laptop. It's also the only access I have to intel gma architecture. As it belongs to a friend, I can't really ask her to let to borrow it for a few days while I install a ton of dev software on it and find the problem. I've pretty much exhausted the info I can get out of it logging errors and return values, so now I need some help.

    If there's someone here with access to an intel gma powered pc, could you lend a hand please?

    This rar:

    http://www.sayagain.co.uk/temp/medleyv0003.rar

    contains my game. Just extract the folder somewhere and run 'd3d engine.exe'.

    If it runs, could you please tell me the HW you are on. If it fails, could you send me the debugOutput.log file from documents/my games/gogomedley/

    Also - anyone who runs this - you'll need to manually delete the folder documents/my games/gogomedley when you want to get rid of it.

    For anyone so inclined to investigate the problem - the crash is occurring because for some unknown reason the laptop if refusing to load the shaders - both precompiled and dynamically compiled fail, without any errors or erroneous return values.

    If you reach the main menu, it's working. It fails right near the start, just after window creation.

    Thanks.
     
  2. Applewood

    Moderator Original Member Indie Author

    Joined:
    Jul 29, 2004
    Messages:
    3,859
    Likes Received:
    2
    Don't have one handy, but I'm sure I know your problem right off the bat - this is certainly a problem on every intel I've tested on in the past:

    Are you asking for a pure device when creating your direct3d object? Intel has to emulate vertex shaders so you need a fallback on device create that asks for a nonpure device with software VS. Can't remember the syntax for that, but it'll be in the docs.

    EDIT: Here you go...

    Code:
    		RZDebug::LogEvent("Creating D3D Device");
    		HWND		Window=RZCore::Core->GetWindowHandle();
    		Res=D3DObject->CreateDevice(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,Window,D3DCREATE_HARDWARE_VERTEXPROCESSING|D3DCREATE_PUREDEVICE|D3DCREATE_FPU_PRESERVE|D3DCREATE_MULTITHREADED,&Presentage,&D3DDevice);
    		if (FAILED(Res))
    		{
    			RZDebug::LogError("Unable to create proper D3D Device: Err=%08x",Res);
    			RZDebug::LogEvent("Trying non pure Device with no vertex processing");
    
    			Res=D3DObject->CreateDevice(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,Window,D3DCREATE_SOFTWARE_VERTEXPROCESSING|D3DCREATE_FPU_PRESERVE|D3DCREATE_MULTITHREADED,&Presentage,&D3DDevice);
    			if (FAILED(Res))
    			{
    				RZDebug::LogError("Unable to create ANY D3D Device: Err=%08x, Bailing out",Res);
    				DecodeDDerror(Res,"Creating D3D Device");
    				RZ_ASSERT(FALSE);
    				return (ERR_NO_VIDEO_MODE);
    			}
    		}
    
    
    
    You proably do get an error return, but it won't be where you think it is. ->Present() will fail with "INTERNAL DRIVER ERROR" in cases like this.
     
    #2 Applewood, Jun 26, 2010
    Last edited: Jun 26, 2010
  3. barrygamer

    Original Member

    Joined:
    Apr 10, 2006
    Messages:
    490
    Likes Received:
    0
    It runs on my crappy netbook (atom cpu, intel gma950/945 express, win XP sp3). Well, it runs except the graphics sometimes freeze completely for ~10 seconds and then carry on again, but that might not be the problem you are looking for.

    My directx claims to be up to date - 9.0c (4.09).
     
  4. TheMysteriousStranger

    Original Member

    Joined:
    Jan 17, 2006
    Messages:
    222
    Likes Received:
    0
    Applewood - in my init code I test for caps of D3DDEVCAPS_HWTRANSFORMANDLIGHT and D3DDEVCAPS_PUREDEVICE, only requesting a pure device if both are reported as present. I also call for software VS if the D3DDEVCAPS_HWTRANSFORMANDLIGHT cap is not present.

    Is it a case that intel cards are misreporting their abilities, or should those tests be sufficient to get around the non hardware VS issue?

    Here's my init code (minus the bits I think are irrelevant to this issue):

    Code:
    // initialize d3d and the main surfaces
    	Log<<"Begin D3D Init"<<endl;
    	d3dBase = Direct3DCreate9(D3D_SDK_VERSION);
    	Log<<"base device created"<<endl;
    	D3DDISPLAYMODE mode;
    	d3dBase->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &mode);
    	mode.Format = D3DFMT_X8R8G8B8;
    	if (FAILED(d3dBase->CheckDeviceType(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, mode.Format, mode.Format, true)))
    	{
    		Log<<"ERROR ======== failed on checkDeviceType in g->init"<<endl;
    	}
    	HRESULT h = d3dBase->CheckDeviceType(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, D3DFMT_X8R8G8B8, config->bWindowed);
    	if (h!=D3D_OK)
    	{
    		h = d3dBase->CheckDeviceType(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, D3DFMT_X8R8G8B8, !config->bWindowed);
    		if (h==D3D_OK)
    			config->bWindowed = !config->bWindowed;
    		Log<<"Forcing flip of config->bWindowed after failed support return"<<endl;
    	}
    
    	// check for standard capabilities
    	HR(d3dBase->GetDeviceCaps(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, &caps));
    
    	DWORD devFlags=0;
    	if (caps.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT)
    	{
    		devFlags |= D3DCREATE_HARDWARE_VERTEXPROCESSING;
    		Log<<"using HW vertex proc"<<endl;
    	}
    	else
    	{
    		devFlags |= D3DCREATE_SOFTWARE_VERTEXPROCESSING;
    		Log<<"using SW vertex proc"<<endl;
    	}
    
    	if (caps.DevCaps & D3DDEVCAPS_PUREDEVICE && devFlags & D3DCREATE_HARDWARE_VERTEXPROCESSING)
    	{
    		devFlags |= D3DCREATE_PUREDEVICE;
    		Log<<"Pure device supported"<<endl;
    	}
    
    	if (!HasFeature(EGC_NonPower2Textures) && (config->bPostRenderFX || config->bRenderToTexture))
    	{
    		config->bPostRenderFX=false;
    		config->bRenderToTexture=false;
    		config->profile->SaveProfile();
    		Log<<"non-power 2 textures unsupported"<<endl; 
    	}
    
    	if (caps.MaxTextureWidth < 1027 || caps.MaxTextureHeight < 1027)
    	{
    		Log<<"Unable to support high resolution textures";
    	}
    
    	maxAniso = caps.MaxAnisotropy;
    	maxStreams = caps.MaxStreams;
    
    	// store shader model value
    	if (caps.PixelShaderVersion < D3DPS_VERSION(2,0))
    	{
    		Log<<"shader model 1 support - oh globbits!"<<endl;
    		MB("Unfortunately this game requires a video card with a minimum of DirectX 9 and shader model 2 support.\nGame will now close");
    		shaderModel=2;
    		PostQuitMessage(0);
    		return false;
    	}
    	else if (caps.PixelShaderVersion < D3DPS_VERSION(3,0))
    	{
    		Log<<"shader model 2 support only"<<endl;
    		shaderModel=2;
    	}
    	else
    		Log<<"Shader model 3+ available and in use"<<endl;
    
    	// check for render to target support
    	if (!HasFeature(EGC_RenderToTarget) && config->bRenderToTexture)
    	{
    		config->bRenderToTexture=false;
    		config->bPostRenderFX=false;
    		Log<<"no RTT support"<<endl;
    	}
    
    	// get window dimensions for config and pres params
    	// ... stripped out pres param creation ...
    
    	if (FAILED(d3dBase->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, devFlags, &pres, &d3d)))
    	{
    		Log<<"ERRROR - unable to create the device"<<endl;
    		return false;
    	}
    	else
    		Log<<"device created"<<endl;
    
    The logs don't show device creation failure, and all caps are as expected for the card. I will try adding an extra test on the present call though, just to be sure.


    Barry:
    When does this happen? Is it all the time randomly, or only at a specific point in time, or something else?
     
  5. barrygamer

    Original Member

    Joined:
    Apr 10, 2006
    Messages:
    490
    Likes Received:
    0
    the freeze/unfreeze seemed random, and never affected the audio. I had to kill the process eventually. nothing obvious in the log. see if others get the same thing I guess? It looked very smooth whilst it was running.
     
  6. TheMysteriousStranger

    Original Member

    Joined:
    Jan 17, 2006
    Messages:
    222
    Likes Received:
    0
    @#&%!

    I bet it's a threading issue. I did have one thread-race bug that I thought I had solved. Although a 10 second pause is rather long for threading (it's set to release after 1 second of lockup).

    Thanks Barry.
     
  7. Applewood

    Moderator Original Member Indie Author

    Joined:
    Jul 29, 2004
    Messages:
    3,859
    Likes Received:
    2
    Possibly. Intel are known for bending their drivers, but they're not the only ones by far. I generally don't check caps much tbh. The working practice that's given me the most mileage is to try and set what you think should work, then try plan b) if it didn't.

    The code I posted is my init code. There're no missing checks before that snippet - there just aren't any.

    Of course, if someone else posted that they got past this bit then you might have (partially) gotten away with it. Either later drivers are frigging the init parameters to stop games breaking on their pos hardware, or maybe with 950 this issue has actually gone away. I'd still recommend doing the above init method though, it's not failed me yet.
     
  8. Applewood

    Moderator Original Member Indie Author

    Joined:
    Jul 29, 2004
    Messages:
    3,859
    Likes Received:
    2
    I have a nagging feeling that this is for fixed function stuff so might not be a perfect test anyway.

    Not sure though. Could easily be wrong, but I recommend you check that out.
     
  9. TheMysteriousStranger

    Original Member

    Joined:
    Jan 17, 2006
    Messages:
    222
    Likes Received:
    0
    Thanks for the tips Applewood. I'll give them a try, especially the fallback device creation, and see what happens on my friends laptop.

    I'm not convinced it'll work though because device creation wasn't failing to start with, so it's unlikely to hit the fallback. I may have to resort to detecting crappy intel chipsets and running with special-case settings for them.

    Whatever happened to DirectX doing away with all this vendor specific stuff, eh? Damn you intel! *shakes fist*
     
  10. Applewood

    Moderator Original Member Indie Author

    Joined:
    Jul 29, 2004
    Messages:
    3,859
    Likes Received:
    2
    That one's an easy pick up.

    Microsoft having tight control over Microsoft's own stuff was deemed to be a monopoly, so they had to open their driver creation stuff right up. And now any fucker can make a half-assed interface that fails all the time.

    I had a row similar in nature to your point with the DX team releasing DX11/12/13 when DX9 is still fucked and I got a pretty long and decent answer, to the above effect. Basically, the DX team hate it as much as we do!
     
  11. TheMysteriousStranger

    Original Member

    Joined:
    Jan 17, 2006
    Messages:
    222
    Likes Received:
    0
    Yeah I knew why it was - I was only half-serious, half-joking when I said that. One of those things that would be funny if it wasn't so crappy. For a while there, it really did seem like MS was going to make the PC a simple platform to develop for.

    XBox indie club looks more tempting every day :(
     
  12. Applewood

    Moderator Original Member Indie Author

    Joined:
    Jul 29, 2004
    Messages:
    3,859
    Likes Received:
    2
    I think DX10+ probably does that. I've not even looked in the docs yet as I don't want to get all hot over something thats not yet ubiquitous.
     
  13. TheMysteriousStranger

    Original Member

    Joined:
    Jan 17, 2006
    Messages:
    222
    Likes Received:
    0
    Well, she tested it and it's not the device creation at fault. Even with fallbacks, even if I create a SW vertex processing device from outset, the fault remains.

    It really is a very annoying bug - and made all the more annoying by the fact it (kinda) works on Barry's gma system. My friend's laptop runs most games with ease (even AAA titles) so it must be something in my code that's screwing things up :(

    I'll just have to try and convince her to sell me her brand new laptop for less than £50.
     
  14. Applewood

    Moderator Original Member Indie Author

    Joined:
    Jul 29, 2004
    Messages:
    3,859
    Likes Received:
    2
    Bummer. Sounds like time for more "got here" messages. Oh the days of flashing border colours, lol.

    Can you not borrow this laptop for a couple of days?

    Remote debugging is fairly easy to setup too, but I've only ever done that over a LAN. Can't imagine it being too much fun over an internet wire, but your first attempt will be "execute and tell me where it crashes/fails" so could be doable.
     
  15. TheMysteriousStranger

    Original Member

    Joined:
    Jan 17, 2006
    Messages:
    222
    Likes Received:
    0
    Yeah I've already peppered logging calls all over the code. Two things fail, which would almost seem to suggest no device is active: The textures fail to load (but return no error values), and the shaders can not load or compile (also not returning any errors).

    That would normally mean no device is present, but the device pointer is valid, and the device creation always returns ok.

    Looks like I'm gonna have to try and convince her to let me have the laptop for a few days. There's no way I could get her to setup and use remote debugging, she's almost entirely computer illiterate. It took me 3 attempts to explain to her how to overwrite the exe file to use an updated version :)
     
  16. TheMysteriousStranger

    Original Member

    Joined:
    Jan 17, 2006
    Messages:
    222
    Likes Received:
    0
    oh, for the love of...

    turns out she was using an out of date directX. Now that she "thinks about it", she hasn't run any directX games since reinstalling windows, despite her being so certain that she had played Viva Pinata recently.

    Once she updated directX, it worked fine.

    On the plus side, I now have a detectable failure point for out of date directX drivers which I can use to inform users they are out of date and point them to he web redistributables.

    Thanks for your help guys.
     
  17. Applewood

    Moderator Original Member Indie Author

    Joined:
    Jul 29, 2004
    Messages:
    3,859
    Likes Received:
    2
    Heh, good news then I guess.

    Is there any reason you're not installing the redist with your game? I thought people had long since stop worrying about adding another 10 meg or so to the download.

    The freebie game I have in my link is only 30Mb all in. Admitedly it's not exactly an asset fest though :)
     
  18. Bad Sector

    Original Member

    Joined:
    May 28, 2005
    Messages:
    2,742
    Likes Received:
    5
    If only people wrote code without assuming everyone had access to the patchnet :)
     
  19. TheMysteriousStranger

    Original Member

    Joined:
    Jan 17, 2006
    Messages:
    222
    Likes Received:
    0
    I'd rather not include the redist if possible, as it would literally be doubling the size of the download. Especially for something like DirectX which should be up to date for anyone that plays games. Now that I have a failing point in the code that will fail if DirectX is out of date, I can simply use the web redistributable instead. I may just call that from the installer anyway - a nice easy way to get DirectX up to date without the need for a large footprint.
     
  20. Applewood

    Moderator Original Member Indie Author

    Joined:
    Jul 29, 2004
    Messages:
    3,859
    Likes Received:
    2
    The web redist is probably a good compromise if you're dead set against providing it first hand, but consider that all of your customers will have broadband and assuming by doubling you mean your app goes from 10Mb to 20Mb, then they should get that down in an instant either way.

    I just think you're asking for more support calls is all. Out of a sampling of one, you found one fail - that'd have me running for a permanent fix... ;)
     

Share This Page

  • About Indie Gamer

    When the original Dexterity Forums closed in 2004, Indie Gamer was born and a diverse community has grown out of a passion for creating great games. Here you will find over 10 years of in-depth discussion on game design, the business of game development, and marketing/sales. Indie Gamer also provides a friendly place to meet up with other Developers, Artists, Composers and Writers.
  • Buy us a beer!

    Indie Gamer is delicately held together by a single poor bastard who thankfully gets help from various community volunteers. If you frequent this site or have found value in something you've learned here, help keep the site running by donating a few dollars (for beer of course)!

    Sure, I'll Buy You a Beer