Jump to content

Forcing DirectX11: 40% memory reduction!


Captain Sierra

Recommended Posts

I have an install that has 3.4GB of mods just loaded to the space center scene. That's the razor's edge of a mem crash right there.

In the past, someone had the bright idea of forcing KSP to run under DirectX11 instead of DX9. Some people tried and discovered it delivers massive memory savings. Some people also reported violent instability within their game when using this.

What kind of memory savings are we talking about?

Forcing KSP to use DirectX11 causes a 40% reduction in memory usage. Thats a good bit better than OpenGL*!

Before: 3.4GB of memory usage just loading into menu.

After: 2.1GB of memory usage after 20 minutes of construction.

How to force DX11

  1. Create shortcut for KSP
  2. Open its properties
  3. In the target line, add " -force-d3d11" without the quotes (the intial space does matter)
  4. Accept/apply changes (you can also add " -popupwindow" for fake full screen mode)
  5. . . . .
  6. Profit!
    Now enjoy KSP with 40% less RAM usage!

WARNING: I do not advise using this to squeeze in more mods than you can successfully load to menu without this tweak (use 64 bit for that). Some players have reported extreme instability in the past when forcing DX11. I claim no responsibility for any damage to your saves, crafts, game install, steam library, computer hardware, or anything else. You have been warned.

Now load to menu, play around, and ensure your game (or computer) doesnt explode in a nuclear fireball. As long as that remains the case (and until Unity 5 comes out and KSP upgrades to it), enjoy!

*DX11 yields 1.3GB of RAM savings on my maxed out install, whereas OpenGL only saves 0.6-0.7. While enough to prevent memory leak crashing, OpenGL does not reduce RAM as much as DX11 in my testing. Your milage may vary.

EDIT:

DO NOT add -no-singlethreaded to the force DX11 command entry. This is confirmed to corrupt whatever save game you open if not all of them.

Edited by Captain Sierra
Link to comment
Share on other sites

It should also be pointed out that dx11 causes a fair few more graphical glitches than either dx9 or opengl, last I checked.

You may want to advise people to back up their saves before doing this, just in case something really​ breaks, however unlikely.

Link to comment
Share on other sites

It should because Unity4x has some Dx11 support, that's what the above command is, a Unity3D command line argument to force Unity to use DirectX 11

More info here.

But it uses DirectX 9 by default for greater compatibility and stability, it should also be noted that because this is a Unity thing if you have trouble with it you'll need to ask on the Unity forums ;)

Link to comment
Share on other sites

It should because Unity4x has some Dx11 support, that's what the above command is, a Unity3D command line argument to force Unity to use DirectX 11

More info here.

But it uses DirectX 9 by default for greater compatibility and stability, it should also be noted that because this is a Unity thing if you have trouble with it you'll need to ask on the Unity forums ;)

Thankyou sal_vager.

seems like unity 5 is going to be a big step up, hopefully not too far in the future.

Link to comment
Share on other sites

to remove the graphics glitches use

force-d3d11-no-singlethreaded

[MODERATOR COMMENT - This command may cause damage to savegames, you at your own risk]

Edited by sal_vager
Link to comment
Share on other sites

It should also be pointed out that dx11 causes a fair few more graphical glitches than either dx9 or opengl, last I checked.

You may want to advise people to back up their saves before doing this, just in case something really​ breaks, however unlikely.

I claim no responsibility for any damage to your saves, crafts, game install, steam library, computer hardware, or anything else. You have been warned.

^^ I put this in bright red in the OP so I hope it's a sufficient disclaimer.

to remove the graphics glitches use
force-d3d11-no-singlethreaded

I have yet to experience any graphical issues (have not had a lot of flight time with it yet). What exactly is this doing and how does it help?

Thankyou sal_vager.

seems like unity 5 is going to be a big step up, hopefully not too far in the future.

Oh very much so. A lot of us are hoping desperately that Unity 5 will come out early enough that the dev team can evaluate and convert before 0.91 is released. Unity 5 will be the saving grace of the mod-loving community, who has been suffering under buggy workarounds and semi-stable clients for several versions now. ;)

Edited by Captain Sierra
Link to comment
Share on other sites

So did I. It does seem to make you use slightly more memory, though.

Combine with -forcedx11 didn't seem to reduce memory usage for me. Game boot time feel to be slight faster but doesn't seem to help much framerate flying plane with alot parts burning through atmosphere.

Link to comment
Share on other sites

Combine with -forcedx11 didn't seem to reduce memory usage for me. Game boot time feel to be slight faster but doesn't seem to help much framerate flying plane with alot parts burning through atmosphere.

If you're using "-forcedx11", it won't work. Unity recognizes the command as "-force-d3d11". Try that and you'll notice a good bit of memory freed up. Please report back if you experience any graphical issues.

Link to comment
Share on other sites

If you're using "-forcedx11", it won't work. Unity recognizes the command as "-force-d3d11". Try that and you'll notice a good bit of memory freed up. Please report back if you experience any graphical issues.

Alright tried that parameter, normal memory usage 2.2GB at KSC menu got down to just 1.2GB. But generates alot black clipping textures causing framerate drop.

Link to comment
Share on other sites

I tried this just before Christmas, but it made my vessels turn purple during re-entry though. I didn't have anywhere near a 40% memory reduction either. Opengl caused the dynamic shadows not to render at all and it cut my framerate in half. Ended up just cherry picking mods and using active texture manager with DX9.

Link to comment
Share on other sites

I've just tried this myself as I'm very interested to see a benefit if possible. I've a 32GB machine for photo work but with the 64bit version being a bit jank I've gone back to using the 32bit *Prays for Unity 5*

This is on a ATI 6950 though.

Standard 32 bit with my 1gb GameData folder (20 something mods but no EVE or anything like that)

2.17 used just getting to the intro screen

2.3 used after new sandbox created and looking at my KSP Complex.

2.41 used once in the VAB.

2.57 used after loading FAR Shuttle Montauk in VAB

2.54 used after moving to launch pad (Ship exploded at 1500m lol)

2.63 once back looking at my KSC Complex

2.57 once in the Tracking Station.

After doing all that with the command in the OP and writing it all out, I noticed that the command in the OP is wrong and missing a - as Captain Sierra has included in post 13.

So

1.19 at the intro screen

1.31 at the KSC

1.39 in the VAB

1.52 with ship in VAB

1.54 on pad

1.64 in the Tracking station.

A few graphical glitches but I've not really played with it yet. At least I get some AA this way!

Here is a before and after with the ship on the pad at least. Just those weird black bars on the latter version as far as I can see in a hurry. Seem to be around the prebaked shadows/burn marks. Full 1080 versions if you view full size.

Javascript is disabled. View full album
Edited by DBT85
Link to comment
Share on other sites

-snip-

I noticed the typo and corrected it. I think my browser autocorrected me.

As for graphical glitches, I started out fine but eventually this happened after playing for 3 hours.

0ISXyxL.png

It appears that, in my case at least, the issues only set in after sustained gameplay and restarting my client clears the problem.

Link to comment
Share on other sites

I literally can't play in anything but DX11... and the shaders for re-entry are all pink, transparent shaders like the stock parachutes (but not mod parachutes! Apparently RoverDude makes better models than Squad...) have some weird pseudo-transparency where I can see the sky through them, but not the rest of the craft or parachute or the ground (but my EVE textures through the ground!)... the lines in the VAB are inexplicably black...

-no-singlethreaded doesn't even run for me either...

The whole idea behind making a game accessible isn't to cripple it's high-end capabilities. But Squad failed that the moment they chose Unity...

Edited by Nitrous Oxide
Link to comment
Share on other sites

Have been using "-force-d3d11 -force-d3d11-no-singlethreaded" for months, no savegame corruption for me, although I have one save that is stuck with the KSC camera bug ( I suspect that is a rogue mod though ).

List of known graphical glitches from my install

* Craft turn solid pink in atmosphere: - fix, turn atmospheric effects to minimum

* SPH floor has black stripes - I'm used to this now :)

* Minmus surface is totally black - no fix I've found for this, and this is almost a killer given how much I usually use Minmus.

Otherwise it seems fine, and reduces memory usage by quite a bit. Odd transparency issues were down to the craft viewer mod, I forget the name of it.

Link to comment
Share on other sites

Have been using "-force-d3d11 -force-d3d11-no-singlethreaded" for months, no savegame corruption for me, although I have one save that is stuck with the KSC camera bug ( I suspect that is a rogue mod though ).

List of known graphical glitches from my install

* Craft turn solid pink in atmosphere: - fix, turn atmospheric effects to minimum

* SPH floor has black stripes - I'm used to this now :)

* Minmus surface is totally black - no fix I've found for this, and this is almost a killer given how much I usually use Minmus.

Otherwise it seems fine, and reduces memory usage by quite a bit. Odd transparency issues were down to the craft viewer mod, I forget the name of it.

Are you referencing VesselViewer or Kronal?

Link to comment
Share on other sites

One of the two - it's known to cause issues with B9, I found after removal some other glitches cleared up too.

I'm wondering if we could replace Minmus with another planet of the same size with a different surface, with one of the mods around atm.

It may be theoretically possible to override the stock texture for Minmus with an identical copy, however I'd have to know exactly what's triggering the load error as opposed to just that it's happening so I can overwrite without that override getting glitched out itself.

Link to comment
Share on other sites

It may be theoretically possible to override the stock texture for Minmus with an identical copy, however I'd have to know exactly what's triggering the load error as opposed to just that it's happening so I can overwrite without that override getting glitched out itself.

I suspect it's a shader issue, which is why I'm thinking the entire planet might need replacing. The green glow is there if you orbit close enough, but there's absolutely no surface. Of course the SPH floor does the same thing in places, I guess that might be worth a poke just in case it's the same issue.

Link to comment
Share on other sites

Hmm for me this is not working.

Tried to use "-force-d3d11" ( without space ) before xmas and on the welcome screen Mun was a black hole and Kerbin was not there.

Tried to sue "-force-d3d11-no-singlethreaded" is not working for me the game is starting in dx9 not in dx11. I do not know why is this happening with this command.

I will try today that " -force-d3d11" ( with space ) I will see what will be the result.

EDIT: wohoo. So I tried that : " -force-d3d11" ( with space ) and nice on the welcoem screen I see Mun and Kerbin. And memory savings are nice. Before with dx9 I had around 3Gb memory on welcome screen now I have 2.1GB on welcome screen.

Great thx for posting this " -force-d3d11" ( with space ) it is working as is should.

EDIT2: I found why I have missing Mun and Kerbin. I had to remove my sweetFX :( So now I need to make a decision to trade very nice sweetfx settings with DX9 and higher memory consumption for DX11 and less memory consumption and it looks like no sweetFX :(

Edited by Jovzin
typos
Link to comment
Share on other sites

Been using this all day while fiddling with another mod and can report no other issues yet. The craft does go pink under atmospheric stress but goes back to normal again when it's gone. Not been to Minmas yet to see if it's wrong.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...