The values used in the attempt to create the GraphicsDevice were invalid.
- Is this because my graphic card does not support shader model 2?I didn't even know of this requirement till I saw it on the readme file.Time to change my geforce4?

Answers
I got it to work. Add this line after the Graphics component is created:
graphics.AllowMultiSampling = false;
Then in the WindowsGame_Starting function set graphics.AllowMultiSampling equal to false again.
All Replies
- What type of card do you have? We should be giving a better exception message than that (i.e. we check for lots of things and throw better exceptions but that one must have slipped through.)
- I'm getting the same error here at work..... card is an nVidia Quadro 2. lol.... not sure if its the shader model or what.
- Thanks for the reply Paul, I have a geforce 4 ti4200 on this pc.I get this error in the InitializeComponent method of the sample projects
- And apparently I'm unable to make edits to my posts.
Anyway, the error is this (it happens at runtime):
"NoSuitableGraphicsDeviceException was unhandled" on line 26 of SpacewarGame.Design.cs - Nvidia GeForce 4 Ti 4600 here, same error - total bummer too, might have to work on the laptop for a while until I either buy a new card or a solution arises... still, looks like nice concise code, reminds me of the Jad engine, good stuff guys at least from what I can see of it :)
I got it to work. Add this line after the Graphics component is created:
graphics.AllowMultiSampling = false;
Then in the WindowsGame_Starting function set graphics.AllowMultiSampling equal to false again.
Struan wrote: I got it to work. Add this line after the Graphics component is created:
graphics.AllowMultiSampling = false;
Then in the WindowsGame_Starting function set graphics.AllowMultiSampling equal to false again.
THAT WORKED!!
Good on ya mate
This is a congratulatory sheep ->
- Yeah, that did it. Thanks a lot!
Groovy. This is a bug. We're supposed to fallback to disable multisampling if it isn't available. I'll file a bug.
I tried that, but I continue to get the same error. I'm just trying to build the basic Windows Game (XNA) project (from File->New). The relevant (I think) code looks like this:
private void InitializeComponent()
{
this.graphics = new Microsoft.Xna.Framework.Components.GraphicsComponent();
this.graphics.AllowMultiSampling = false;
this.GameComponents.Add(this.graphics);
}There's no WindowsGame_Starting function in this example.
Any suggestions?
AG
- try line 109 in SpacewarGame.cs
Hi Aaron
What type of graphics hardware do you have?
According to my Device Manager, I have a Rage 128 Pro Ultra GL AGP. What should I have in order to create and run games in XNA?
AG
IIRC the Rage 128 is DX7 era hardware. You'll need a card that supports the programmable pipeline (we recommend something that supports at least Shader Model 2.0 or above). You can find reasonably priced SM2.0 cards these days (or check Ebay).
- You can try falling back to the reference rasterizer fix that was suggested in another post until you get a compatible card.
- http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=672046&SiteID=1
This is the post he talks about. If you can make it work, please tell me =o)
Cheers! I tried xna on two machines, one had the issue and one did not. On my vista machine it did not happen. XpSP2, did happen. Setting multisampling to false did work.
Thanks - Andrew
XBL GT=ViralSpiral
Yeah I got the same error and I added the code line but it didn't work for me either, I don't know if I put it in the right spot though either, here's my code:
using
System;using
System.Collections.Generic;using
System.Xml;using
Microsoft.Xna.Framework;using
Microsoft.Xna.Framework.Graphics;using
Microsoft.Xna.Framework.Components;namespace
Spacewar{
partial class SpacewarGame{
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent(){
this.graphics = new Microsoft.Xna.Framework.Components.GraphicsComponent(); // // WindowsGame //this.Starting += new System.EventHandler<Microsoft.Xna.Framework.GameEventArgs>(this.WindowsGame_Starting);
this.Exiting += new System.EventHandler<Microsoft.Xna.Framework.GameEventArgs>(this.WindowsGame_Exiting);
graphics.AllowMultiSampling = false;
this.GameComponents.Add(this.graphics);
}
private GraphicsComponent graphics;
}
}
- I added
graphics.ModifyDevice += new EventHandler<ModifyDeviceEventArgs>(graphics_ModifyDevice);
but I don't know what to put inside to make the GraphicsComponent being of type DeviceType.Reference.
Cheers! That simple change at line 109 worked, thanks
With FSAA enabled, it worked to change the resolution (for example, 1024x720).
ATI Mobile X300
I have the following card in my laptop and I'm having a similar problem.
Mobil Intel 915GM/GMS,910GML Express Chipset Family
I add it the lines you wrote and I'm still getting the following error"Could not find a Direct3D device compatible with the current device preferences."
Is it that my video card won't work? I had use Directx 9 before
Thanks
Francisco
Ok, here's what I got:
ATI MOBILITY RADEON 9000 IGP, I have Service Pack 2, can run DirectX9.0c easily, I have all prerequisites & requirements I need...But I gut an error message along this line: this.GameComponents.Add(this.graphics);
message: The values used in the attempt to create the GraphicsDevice were invalid.
- I do not know if I can bump topics here but I do not know what the problem is. I have everything, I can run everything, I have a high graphics card and work DirectX9.0c easily....why can I not run any XNA games?
- Thanks, this thread was very helpful! The computer I'm using for this program isn't very well equipped (i think the graphics card is about two years old). I hope that the program won't require a very powerful PC....I don't plan on making a 3D game with this tool.
- truepsion, have you tried this?
Add the following to line 20 in SpacewarGame.Designer.cs
graphics.AllowMultiSampling = false;
and change line 109 in SpacewarGame.cs from
graphics.AllowMultiSampling = true;
to
graphics.AllowMultiSampling = false; - how can u tell what line something is in?
- use ctrl g and type in a line number; line number is also displayed in the bottom right corner. ex: Ln 109 Col 22 etc etc
- I have an old graphics card, Nvidia Vanta/Vanta LT 16MB. When I try to debug appear an error in the file SpaceWarGame.Designer.Cs where it say:
this
.GameComponents.Add(this.graphics);Error say: The values used in the attempt to create the GraphicsDevice were invalid.
So I want to know the solution. For more info, I have no downloaded DirectX SDK yet. I hope you understand me and could help me
- Your graphics card is too old and XNA doesn't support that old of a graphics card. Sorry, you'll either have to Buy a new graphics card for that computer or use another computer with a newer card for XNA.
- This worked perfectly for me, thank you!
I tried it in a blank Windows Game project, just without the bit in WindowsGame_Starting(). Got the blank blue DX window coming up. - I read in another post that we can use the reference rasterizer, but it did not explained how to do it. Does anybody knows?
Cheers! What graphics cards you recommend?
And what about the reference rasterize? I think this is important.
The reference rasterizer, found in the DirectX SDK, is a really bad idea. It renders very slowly (seconds, sometimes minutes, per frame). XNA was designed for DX9.0-capable graphics cards (which have been on the market for many years now).
Then again, it's better than butcher paper and crayons

the_developer wrote: What graphics cards you recommend?
And what about the reference rasterize? I think this is important.
well the cheapest card with SM 3.0 is the GeForce 6200, you can pick one up for a little under 50 bucks(p.s. this is the card I'm using) Although you will need AGP 4x or higher(8x is recommended)
- UGH! This *really* sucks - why on earth do I need a T&L card to program a 2D game? I don't even need hardware lighting, let alone shader models!!
- hello paul. i have the same error but i dont want to wait for MS to update.ima complete noob and i cant find where to add the line to set multi sampling to false.what file is it in?
- I didnt found the WindowsGame_Starting in the project
i modified file with your writed,however the error still exist.
my graphics card is VIA/S3G Unichrome Pro IGP,
is it my graphics card too old?
- I have the same card, actually it's an on-board chipset that comes with my HP desktop. and I have the same problem.
When I run DXCapsViewer it shows under D3D Device Types/HAL/Caps PixelShaderVersion to be 0.0. So, I assume that means my card is not supported.
This presents a problem for me. I don't have a problem going out and buying a card for development, but I'm worried about limiting the market for my games. I was hoping to use this framework to help me build 2D games, which will not required hardware shading, etc. I don't think my target audience will be willing to go out an buy a card to run my games.
Is there a way to turn this requirement off in my final build? There are currently no plans to change the programmable shading requirement. We're interested in feedback around hardware "reach" for future versions.
Thanks,
Struan:
Can you point me to the location where the graphics component is created?
Thanks
Adding "graphics.AllowMultiSampling = false" in both places mentioned solved the problem for me and my laptop (ATI Mobility Radeon 9000). Thanks!
So there is no work-around this problem at all? (My laptop is not much more than a year old and runs quite a few games just fine.)
My husband has a new Macbook Pro- If I install Bootstrap and Windows on it, will it work with XNA Express?
- I got it to work.
- Struan U RULE!!!!
I knew it was in there somewhere, but I wasn't sure what... thanks! - I think it would be really, really good if this required were removed. I have a brand new PC that I can not use to run XNA based games (it has a VIA/S3G UniChrome Pro IGP chip onboard). I am guessing that I am not the only person - or likely to be the only person - with this problem. It is especially frustrating given that I am not even attempting to do anything complicated... just write a simple 2d game... I could see it if I were writting a massive 3d game...
Jeff Collins I don't know if this is the right place to start, but I'd like to find out if any of you know where to find support for ATI Mobility Radeon 9000 display drivers. I have the IGP series, and I have looked everywhere for updates. I have found some compatible drivers, but everytime I attempt to install them I receive an error message that states that there is no display driver found.
The reason I am looking for drivers (or any useful information that can solve this problem) is that I have a subscription to EVE on-line and during game play my computer freezes up. Once I reboot, I receive an error message that states that the ati2dvag is no longer working properly. My computer meets the minimum systems requirement for EVE and I have tried several attempts to troupleshoot this problem through Windows update.
If has any useful info, or knows of anyone who could help, please send this tread to them. Cheers

