Jump to content

V0.24.0 Multicore processor issues and solutions (x86-x64)


Recommended Posts

There are more people using the 64 version and there is some issues on computers that have more that 2 cores.

This problem will effect all Intel quad or more cores processors, like Intel quad core, i5, i7. also effects the

AMD Multicore processors Like Athlon and Phenom.

Before doing this check;

if you have all the correct drivers installed.

If you have the DirectX updated.

If you have PhysX up to date (for Nvidia and ATI ).

If you have the dotNet and the visual c++ redist up to date.

symptoms :

Mouse unresponsive or slow to respond.

Massive lag on low part ships.

Crashing on save Load start.

The Main KSP engine is not optimize to use 4 or more cores and 64 bits memory address, to that end I created a tutorial in how to set you game to use only (the correct) number of cores and that way stay more stable.

This will help on the 32 bits version, again in a question of core support and not memory so the 32 version will experience this problem but at a lower rate.

Lets start.

Mouse unresponsive or slow to respond.

Massive lag on low part ships.

This is a direct result of the multicore problem, (this is a engine problem and not KSP/Squad).

You can fix this problem by (forcing) you game to use only 2 processors cores and making the game use

correct memory addresses.

You will have to use the affinity option on windows to correct that, don't stress is fast.

You also need set up the priority of the KSP to set it faster.

To set affinity automatic use this :

Create a shortcut (right click on the desktop) and add this;

C:\Windows\System32\cmd.exe /C start "" /affinity xx "GAME-LOCATION\KSP.exe" -adapter 0 -single-instance -force-d3d9

On affinity xx change it to your chosen core

Here is the list

xx=

01 - 1st CPU

02 - 2nd CPU

03 - 1st and 2nd CPU

04 - 3rd CPU

05 - 1st and 3rd CPU

06 - 2nd and 3rd CPU

07 - 1st 2nd and 3rd CPU

08 - 4th CPU

09 - 1nd and 4th CPU

0A - 2rd and 4th CPU

0B - 1st 2nd and 4th CPU

0C - 3rd and 4th CPU

0D - 1st 3rd and 4th CPU

0E - 2nd 3rd and 4th CPU

0F - 1st 2nd 3rd and 4th CPU

For CPUs with more cores, just continue the pattern.

Have to look like this ( start "" /affinity 0C " )

For me I use the 03 but its up to you.

For OC (overclock) boards the combination of core 0 and 1 will work better (the OC is normally center in the 1º and 2º core)

and on normal Boards the 3º and 4º core are better.

Warning the affinity shortcut will not work on steam tracking system, for this you need another fix if

you are using steam, see below a solution.

For process priority use this http://www.prnwatch.com/prio/ and save the process priority after you set it on high.

This is important to set the game to use more recourses.

***************************************************************************************

Crashing on loading saves on the 64bits version is due to the way the KSP loads the graphics cards, it have a problem on using fantastic quality on some GPU´s on 64bits (this is not a problem on the 32 bits).

The fix is to force the use o directX9 and lower quality settings (beautiful is good).

For configuration of graphic cards that have SLI or Crossfire I recommend this settings:

On a NVidia /ATI system (side the ticks on the textures etc etc) need to add this to the exe [ -adapter 0 ], [ -single-instance ] and [ -nolog ] NOT the ( [] ) , this is for people that have multi GPU or multi screen, that way the game will use the 1º device and only the 1º it encounters, the single inst will help on the cores process, the log is only need if you are debugging stuff.

If you like you can add this [ -force-d3d9 ] to force DirectX9 support.

On NVidia systems you need to do this :

On NVidia control panel, on SLI control the (maximize 3d performance) have to be on if you are using SLI.

On NVidia control panel, in manage 3d settings you need to set the Multi-display to a single screen,

them in Anti-Aliasing settings set as (enhance application settings), set vertical sync to off but turn the OpenGL Buffer on (the game will use it).

On ATI/AMD Systems you need to do this :

On Catalyst control panel, on 3d app settings, create a setting and change this:

Set Anti-Aliasing settings to (enhance application settings), Filter (standard) the rest stays as default.

Set vertical sync to off but turn the OpenGL Buffer on (the game will use it).

Set texture quality to standard.

If you find texture artifacts you need to set the crossfire to default of even off, don't worried the game will use the 2 gpus even if the crossfire is in disabled mode.

KSP Config


// KSP Game Settings
SETTINGS_FILE_VERSION = 0.18.0
TUTORIALS_EDITOR_ENABLE = False
TUTORIALS_FLIGHT_ENABLE = False
VAB_USE_CLICK_PLACE = True
VAB_USE_ANGLE_SNAP = False
VAB_ANGLE_SNAP_INCLUDE_VERTICAL = False
VAB_CAMERA_ORBIT_SENS = 0.04
VAB_CAMERA_ZOOM_SENS = 0.1
FLT_CAMERA_ORBIT_SENS = 0.04
FLT_CAMERA_ZOOM_SENS = 0.5
FLT_CAMERA_WOBBLE = 0.1
FLT_CAMERA_CHASE_SHARPNESS = 1.5
FLT_CAMERA_CHASE_USEVELOCITYVECTOR = True
FLT_VESSEL_LABELS = True
SPACENAV_CAMERA_SENS_ROT = 30
SPACENAV_CAMERA_SENS_LIN = 20
SPACENAV_CAMERA_SHARPNESS_LIN = 8
SPACENAV_CAMERA_SHARPNESS_ROT = 10
SIMULATE_IN_BACKGROUND = True
PHYSICS_FRAME_DT_LIMIT = 0.035
MAX_VESSELS_BUDGET = 150
CONIC_PATCH_DRAW_MODE = 3
CONIC_PATCH_LIMIT = 3
SHOW_PWARP_WARNING = False
EVA_ROTATE_ON_MOVE = True
USE_STAGING_CONTROLS_ON_DOCKING = False
SPACENAV_FLIGHT_SENS_ROT = 5
SPACENAV_FLIGHT_SENS_LIN = 1
KERBIN_TIME = True
CALL_HOME = False
DONT_SEND_IP = True
SEND_PROGRESS_DATA = True
CHECK_FOR_UPDATES = True
VERBOSE_DEBUG_LOG = True
SHOW_CONSOLE_ON_ERROR = False
AUTOSAVE_INTERVAL = 200
AUTOSAVE_SHORT_INTERVAL = 30
SHOW_SPACE_CENTER_CREW = True
UI_SIZE = 990
SHIP_VOLUME = 0.4499291
AMBIENCE_VOLUME = 1
MUSIC_VOLUME = 0.8029597
UI_VOLUME = 1
VOICE_VOLUME = 1
SOUND_NORMALIZER_ENABLED = False
SOUND_NORMALIZER_THRESHOLD = 1
SOUND_NORMALIZER_RESPONSIVENESS = 16
SOUND_NORMALIZER_SKIPSAMPLES = 0
SCREEN_RESOLUTION_WIDTH = 1280
SCREEN_RESOLUTION_HEIGHT = 1024
FULLSCREEN = True
QUALITY_PRESET = 4
ANTI_ALIASING = 8
TEXTURE_QUALITY = 1
SYNC_VBL = 0
LIGHT_QUALITY = 2
SHADOWS_QUALITY = 2
FRAMERATE_LIMIT = 60
FALLBACK_PART_SHADERS = True
PLANET_FORCE_SHADER_MODEL_2_0 = True
PLANET_SCATTER = True
PLANET_SCATTER_FACTOR = 0.05
AERO_FX_QUALITY = 3
INPUT_KEYBOARD_SENSIVITITY = 2
dontShowLauncher = True

Please note that the resolution is for 4.3 (1200-1024) so for wide screens you need to change that.

***************************************************************************************

For steam users : (I'm unable to test this)

You could theoretically botch in a way to launch it with a certain affinity with Steam... Not sure how well this would work, but:

"C:\Windows\System32\cmd.exe" /C start "" /affinity xx "%command%" -adapter 0 -single-instance -force-d3d9

Try putting that into Steam's Launch Options (you can find this option in KSP's Properties from your Steam Library) and launching the game.

***************************************************************************************

OC (overclock) Boards/Cpu and GPU´s are not problematic on KSP just need to be aware of some issues.

All GPU that use [Crossfire/SLI] will some time have some problems on the textures, fix on top.

OC boards will some time create a BSOD if they have to aggressive memory configurations (this will affect more the 64 version).

OC CPU will work but on the 64 version will be instable and crash more if affinity is not in use.

If all is done correctly the 32Bits version will work faster (the difference is minimal) and will work better (more stability).

If all is done correctly the 64Bits version will work faster (the difference is huge on 4 cores) and will have more stability and will crash less.

Warning this fix will work in 80% of the machines, the other 20% will not see any difference or a minimal difference.

Any questions you can add it here.

Best regards to all

Edited by custume
Link to comment
Share on other sites

To fix affinity with Steam, users can always open task manager and right click on KSP process (depending on windows version), and choose to adjust affinity (below priority) the UI is easier than the command line tool (just a checkbox to check :) ).

(example here, picture from this article)

Edited by Justin Kerbice
add more details
Link to comment
Share on other sites

You could theoretically botch in a way to launch it with a certain affinity with Steam... Not sure how well this would work, but:

"C:\Windows\System32\cmd.exe" /C start "" /affinity xx "%command%" -adapter 0 -single-instance -force-d3d9

Try putting that into Steam's Launch Options (you can find this option in KSP's Properties from your Steam Library) and launching the game.

Link to comment
Share on other sites

This is so ridiculous, it just makes me cry. Why do people post such ridiculous posts, without proper knowledge. In order for the application to be affected by Multi-Core CPU, it must be able to use such in the first place. This is usually done automatically when creating threads and not setting up the affinity for them, or by setting it explicitly when creating threads. If an application doesn't create threads, and doesn't make use or implement libraries which do so, then it doesn't matter what the affinity mask is, as only a single core will ever be used to support such application. In a 99.9% case scenarios, it will be Core 0. If on the other hand an application is using threads to support its functionality, limiting affinity mask can have negative impact on the application performance and/or its stability, depending on whether it explicitly manages thread affinity or not.

Also, note: Affinity is not priority. The affinity is a bitmask of which cores are available for the application, and the priority is the amount of time the application will have assigned when OS is switching the context. The higher the priority, the less time will other processes have for themselves. I.e. Realtime priority means, nothing (absolutely nothing) else will be executed on the CPU, except for the application with the realtime priority. This means drivers and services, background and foreground apps, will be silenced, and the system will most likely hang, unless the application will allow it. Changing priority is very bad idea, and it should only be done for applications which require such action to finish time critical tasks, or system important functions. In most cases, such management is done automatically by applications requiring it, for a very short time.

As far as changing the affinity is involved, the only change that makes sense, is to .... the application from Core 0 to use all the other cores only, which will leave Core 0 for the system ops, and everything else will be available to the application.

Link to comment
Share on other sites

While your point is valid, it assumes the application is working correctly. As it stands, some bugs in the x64 build of Unity mean that threads are hanging and not being resumed or picked up properly -- their timings are all over the place. Confining that application to one or two cores has, at least for the present, solved more issues that it has caused and can be considered a workable solution for the time being. It's likely the usefulness of such a workaround is limited, but as long as it is useful, it's not a bad thing.

Link to comment
Share on other sites

  • 2 weeks later...

Hello Dre4dW0rm, you have a good point, As it stands the engine is not ready for x64 and the treats are not manage ok but ....

1º of the hardware/firmware controls the cpu overall use not the OS, to clarify the main core (core 0) is responsible to address the treats to all cores (by hardware) the OS can influence this but normally its up to the main core to decide what core will be use, and by default the main core will send part of the process it needs to the other cores and them wait, a bit like you say.

The affinity will tell the main core to use only specify cores for the job, but like I say before is up to the main core (by firmware/hardware) to make the decision so some process can jump from core to core but the main process will stay on the define cores, that way the main core will not wait that long and not hang.

Setting more that 2 cores for the job it will become unstable due to the imparity of the memory address ( 8 , 16 , 32, and so on using 2 cores but on 3 cores the memory address are out of the range) but ....

If you use the 3 and 4 core for the job , them the core 0 will be available to manage the process better, in my rig I prefer to use core 0 and 1 due to my board have OC and is center on the core 0 and 1, but I recommend on the post to use core 2 and 3 (3 and 4).

The real problem in plane English is that unity will send request to a 1 or 2 core´s scenario in a 4 core´s rig and do not give time for the process to finish and them it hang´s, this have same impact on the x86 (32bits) version but duo to the address is in a 32 bits process it will not make use of the extra cores, so the affinity in 32 bits will not do much, just center the process in the (extra) core´s.

off course this is not a perm. fix, for that you need to set the code to make use of the multi treat sys and compile the bin to x64 memory address.

As it stands this fix will help more that have "negative impact" on the app.

Best regards to all

PS, on 6 or 8 core´s you need to find the best core combination, but in 8 core´s scenario you don't need the affinity but in 6 works better if you set the core 2,3,4,5 to do the job that way core 0 will be available to manage.

Edited by custume
Link to comment
Share on other sites

  • 3 weeks later...

Hi CorperalVasquez, looks like you did not read all the tutorial.

you do not need to set up the affinity all the time, there is a shortcut that have a small scrip to open the game using the correct affinity.

Regards

Link to comment
Share on other sites

Hi CorperalVasquez, looks like you did not read all the tutorial.

you do not need to set up the affinity all the time, there is a shortcut that have a small scrip to open the game using the correct affinity.

Regards

Yeah I set that, kinda answered my own silly question, but alas, to no avail. Using the 24 version I can only run Fasa mod, any other mods, like my favorite KSO, and crash on launch, silly machine runs out of memory, drat, drat drat. I guess I will stick to 23.5 and this will be as far as I can go.

Its been fun, will miss the upgrades....

Corporal Vasquez

USCSM/KSCSM 8th BMTS Sulaco.

Link to comment
Share on other sites

You can use the 32 bits version but if you are planning to use a lot of mods you can take a look at the scenario tweaks, they have ways to lower the memory use.

Like this one

http://forum.kerbalspaceprogram.com/threads/87961-The-Ballad-of-x86-Tips-for-32-bit-users-to-save-RAM-and-make-KSP-%28more%29-playable

But there are more.

Regards

Edited by custume
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...