Jump to content

The Linux Thread!


Recommended Posts

Motokid600, there's no KSP_64_Data file that I am aware of with stock, the only x64 files are really just the KSP.x86_64 and launcher.x86_64, so please use the output_log.txt in the KSP_Data folder

I cannot seem to find the Output_log in the KSP_Data folder.

Link to comment
Share on other sites

Sorry, output_log is Windows, you mentioned not finding it and I should have been more clear.

On Linux it's the player.log in "/home/user/.config/unity3d/Squad/Kerbal Space Program" and the KSP.log in the main KSP directory, there isn't a separate log for x64.

Link to comment
Share on other sites

Hiya guys,

I had good experiences recording videos of KSP in Windows when x64 was relatively stable, but with the issues in the latest build, and since most modders and the devs are officially dropping support, I've had to bite the bullet and dual boot Windows 7 and Ubuntu. Problem is that now I can't get a decent screen capture.

I've tried a handful of programs and Simple Screen Recorder works the best so far. I can't get it to record in opengl mode though (which I suspect will help me get smoother footage). It tells me that "the application hasn't created an OpenGL window yet", so I'm guessing KSP needs to be told to do this. It was relatively easy to do in Windows, but I can't find any mention of how to force opengl for programs in Ubuntu. Can anyone show me how?

Thanks

Link to comment
Share on other sites

So I don't know if this is a Linux specific issue, but I'm having a couple of gamepad-related issues. XBox 360 pad. The following affects my stock install with a new auto-created settings.cfg.

1) When I'm holding down a button, KSP seems to sometimes regard it as though I'm repeatedly tapping that button. Very noticeable for things like the lights. Meanwhile for the brakes it seems to regard it as a brief tap, making it useless. Here I'm in that unhelpful boat of "It worked fine before and I don't know what I changed".

2) I just got a mouse with extra buttons, and KSP is regarding them as duplicate joystick buttons. For example the X button and the right extra button on the mouse are treated as one and the same by KSP. A big problem considering I have that button mapped to stage.

Neither of these phenomena show up in jstest, which registers button holds on the gamepad correctly and shows no effect when I press the mouse buttons.

Link to comment
Share on other sites

I've heard of this but wasn't able to find the cause, it may be only occurring with box pads though, possibly due to their triggers being analogue.

xboxdrv is supposed to be pretty good at handling the xbox pads on Linux, I suspect Unity changed something in how they handle these pads, but there's sparse documentation on controllers in Unity as a whole.

There's some stuff here on using xbox pads in Ubuntu that may help, but as it's already working in jstest I don't think you'll need it.

Link to comment
Share on other sites

So I don't know if this is a Linux specific issue, but I'm having a couple of gamepad-related issues. XBox 360 pad. The following affects my stock install with a new auto-created settings.cfg.

1) When I'm holding down a button, KSP seems to sometimes regard it as though I'm repeatedly tapping that button. Very noticeable for things like the lights. Meanwhile for the brakes it seems to regard it as a brief tap, making it useless. Here I'm in that unhelpful boat of "It worked fine before and I don't know what I changed".

I've traced this problem to my Gigabyte Aivia Osmium keyboard. Linux sees this as another joystick for some reason, dubbed the "Osmium interface". KSP then picks this up, as follows:

user@treno:~/software/ksp/0.90-stock$ ./KSP.x86_64 
Set current directory to /home/user/software/ksp/0.90-stock
Found path: /home/user/software/ksp/0.90-stock/KSP.x86_64
Mono path[0] = '/home/user/software/ksp/0.90-stock/KSP_Data/Managed'
Mono path[1] = '/home/user/software/ksp/0.90-stock/KSP_Data/Mono'
Mono config path = '/home/user/software/ksp/0.90-stock/KSP_Data/Mono/etc'
/dev/input/js0: driver version: 2.1.0 (20100)
: Too many buttons; using buttons 0 - 19 and ignoring buttons 20 - 57
/dev/input/js0: fd 3, buttons 20, axes 3, name Osmium Interface
/dev/input/js0: axis 0: raw -32767, mapped 0.000000
/dev/input/js0: axis 1: raw -32767, mapped 0.000000
/dev/input/js0: axis 2: raw -32767, mapped 0.000000
/dev/input/js1: driver version: 2.1.0 (20100)
/dev/input/js1: fd 4, buttons 11, axes 8, name Microsoft X-Box 360 pad
/dev/input/js1: using XBox 360 Controller mappings
/dev/input/js1: axis 0: raw 0, mapped 0.000000
/dev/input/js1: axis 1: raw 0, mapped 0.000000
/dev/input/js1: axis 3: raw 0, mapped 0.000000
/dev/input/js1: axis 4: raw 0, mapped 0.000000
/dev/input/js1: axis 6: raw 0, mapped 0.000000
/dev/input/js1: axis 7: raw 0, mapped 0.000000

So now I'm looking for a workaround. Is there a way to make KSP ignore the unwanted joysticks when a system has more than one joystick plugged in?

Link to comment
Share on other sites

So now I'm looking for a workaround. Is there a way to make KSP ignore the unwanted joysticks when a system has more than one joystick plugged in?
So far what I've done is added a udev rule to disable the "Osmium interface". This doesn't stop normal use of the keyboard working, although it does disable the volume control wheel on the keyboard.

For those in a similar situation, put a file in /etc/udev/rules.d with the following general layout:

# Disables the "Osmium Interface".
SUBSYSTEM=="usb", ATTRS{idVendor}=="1044", ATTRS{idProduct}=="7a03", ATTR{authorized}="0"

To find your vendor and product ids, or whatever else you need to identify the device, run lsusb -v. I recommend having a spare keyboard just in case you do manage to disable yours!

Link to comment
Share on other sites

KSP is crashing on me when i go to the launch pad.

"Using memoryadresses from more that 16GB of memory"

Does that mean KSP used 16gb of memory and crashed? o.O ...

Wow!

How many mods are you running? I have about 95, and only use about 4-5 gig normally.

What version of Linux? how much memory do you have?

I assume you are using the KSP.x86_64 executable, right?

Link to comment
Share on other sites

"Using memoryadresses from more that 16GB of memory"

I've seen this mentioned in a couple of other threads, but not seen it myself (yet). People report that re-starting KSP fixes it, so it seems to be a bug in the loader code which sometimes blows up.

Link to comment
Share on other sites

Continuing my adventures with KSP and Linux, I bring you a short HowTo install on Fedora 21:

For various reasons, I don't like Ubuntu. I don't want to get into a flame war, just accept the fact that I don't like it. If you want the reasons, PM me and I'll be happy to respond.

Ok. It's actually pretty easy to install in Fedora 21. Note that I use nVidia video cards, so my instructions will have a few nVidia specific steps. Other than that (which I'll note) it's all the same

1. Install Fedora 21. No specific options are needed during the install, just answer the questions. There are only a few, and are pretty self-explanatory. One thing is that you need to set up a user. For these instructions, I'm going to use "user" as the username that you setup. (obviously) Remember the passwords you set up, both for the root user and "user"

2. After installing, reboot, log in and do a full update of the system. Then reboot again.

3. Download and unzip the KSP zip file. It doesn't matter where, but note the location since you will need that in a few steps

4. Download CKAN and put it into the same directory as KSP. Again, note the path to the executable

5. Install the latest version of mono (needed for CKAN) using the following steps:


#
# Download and install the latest Mono
#
wget http://download.mono-project.com/sources/mono/mono-3.12.1.tar.bz2
cd mono-3.12.1
./configure --prefix=/usr/local
make
su root
make install

#
# Install some useful packages
#
yum -y install SDL2_image rpm-build ttmkfdir cabextract popt-devel pavucontrol
#
# Install the Microsoft fonts
#
wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec
rpmbuild -bb msttcorefonts-2.5-1.spec
yum localinstall /root/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm
fc-cache -fv

#
# Turn down the swappiness setting. This is a number from 0 to 100.
# Default is 60. If you have lots of memory, set it to 0, otherwise a low
# number such as 10 would be good
#
echo "vm.swappiness = 0" >/etc/sysctl.d/90-swappiness.conf
sysctl -p /etc/sysctl.d/90-swappiness.conf

If you have an nVidia card:

1. Download EasyLife from: http://easylifeproject.org/ EasyLife is a software management tool which automates installing some software, including the current nVidia drivers.

2. Open a terminal window and su to root using the root password

3. Do this command:

yum -y localinstall ~user/Downloads/easylife*

4. Run easyLife, using either the icon on the desktop or from the command line: /usr/local/bin/easylife

5. There are (as of this writing) two different nVidia drivers listed. Select one (I used the current version) and then click the OK button

I use the following two shell scripts to run both CKAN and KSP. Replace the <USER> with the userid that you are using, and set the directory to where it is on your system:

ckan.sh:

#!/bin/bash

# Set the following to the directory where the game executable is in
KSPDIR="/home/<USER>/Desktop/CKAN_Modded_KSP"
MONODIR=/usr/local/bin

### Don't change anything below here ###

cd $KSPDIR

${MONODIR}/mono ckan.exe

KSP.sh:

#!/bin/bash

# Set the following to the directory where the game executable is in
KSPDIR="/home/<USER>/Desktop/CKAN_Modded_KSP"

#
# Set the following to 1 to disable antialiasing in the file before running the game
# Antialiasing sometimes causes crashes, especially in VMWare Fusion
#
FORCE_DISABLE_ANTIALIASES=0

# If set to 1, try to run the 64 bit version
TRY_64_BIT=1

#
# Set to 1 if using an nvidia card
#
NVIDIA=1

# The following will enable the patch the 64 bit binary as needed for 0.90
# See this URL for information:
# http://forum.kerbalspaceprogram.com/threads/92231-The-Linux-Thread?p=1608655&viewfull=1#post1608655
#
PATCH_090=1

### Don't change anything below here ###

exe=KSP.x86

uname -a | grep x86_64 >/dev/null
rc=$?
[ $rc -eq 0 -a $TRY_64_BIT -eq 1 ] && exe=${exe}_64
cd $KSPDIR
[ $FORCE_DISABLE_ANTIALIASES -eq 1 ] && sed -i '/^ANTI_ALIASING/c ANTI_ALIASING = False' settings.cfg

# The following two lines may not be needed with 0.90
export LC_ALL=C
export LC_LANG=C

if [ $PATCH_090 -eq 1 ]; then
echo "0099e747: 00" | xxd -r - KSP.x86_64
echo "0099e74c: 00" | xxd -r - KSP.x86_64
fi

if [ $NVIDIA -eq 1 ]; then
#
# Apparently the following two lines help prevent the nVidia drivers from crashing
#
export LD_PRELOAD="libpthread.so.0 libGL.so.1"
export __GL_THREADED_OPTIMIZATIONS=1
fi

./${exe} -single-instance &


sleep 10
mono MemoryUsage.exe

Edited by linuxgurugamer
added fc-cache command to install commands
Link to comment
Share on other sites

So I've been playing for a couple weeks with minimal issues from my latest problem, the game freezing and making my HD go wild, but it hit again last night out of the blue. I was actually closing the game and as soon as I tried to go to the main menu, it started. I sat and watched and listened to my HD crank non-stop for minutes and kept trying to alt-tab or ctrl-alt-backspace to get out of it and I was actually able to alt-tab after about 10 minutes and grab some screenshots. I'll include the logfile as well if anyone wants to take a look, I'm not sure what to even look for.

The first shot is a normal game memory usage situation:

1q15LAn.png?1

And here is what happened when it locked up and started cranking to my HD:

b8TWpmm.png?1

and HERE is the logfile.

This was the first time I was actually able to do anything except a hard shutdown when this happens. I'm terrified each time it does happen because it killed one HD with this problem when I had to pull the laptop battery when the HD wouldn't stop cranking :(

Link to comment
Share on other sites

From the screenshots and the problem description, that sounds like KSP started using more memory for whatever reason, and it caused the system to "thrash" - when it spends all its time swapping data between RAM and disk and hardly any time actually doing useful work.

The best solution in my experience is to kill the offending program as fast as possible. On most Linux systems Ctrl+Alt+Esc activates a "kill cursor" then left-clicking on any window will close it immediately. (If you don't want to kill a program after all just right-click instead). If you need to force the whole system to restart, try REISUB

As for causes, how much physical RAM do you have? It looks like 8GB, so KSP alone oughtn't to crash unless it really starts chewing up memory like crazy, but are you running anything else RAM-hungry?

Link to comment
Share on other sites

Your log file wouldn't even open for me at first, but Abiword managed it.

There's a pair of texture load errors but they are near the start so probably not the cause:

Texture load error in '/home/user/Apps/KSP_090/GameData/BoulderCo/CityLights/Textures/detail.tga'

And null reference exceptions near the end of the file:


NullReferenceException
at (wrapper managed-to-native) UnityEngine.MeshFilter:set_sharedMesh (UnityEngine.Mesh)
at SpriteMesh.CreateMesh () [0x00000] in <filename unknown>:0
at SpriteMesh.get_mesh () [0x00000] in <filename unknown>:0
at SpriteRoot.Delete () [0x00000] in <filename unknown>:0
at SpriteBase.Delete () [0x00000] in <filename unknown>:0
at UIListItemContainer.Delete () [0x00000] in <filename unknown>:0
at UIScrollList.RemoveItem (Int32 index, Boolean destroy, Boolean doEasing) [0x00000] in <filename unknown>:0
at UIScrollList.RemoveItem (IUIListObject item, Boolean destroy, Boolean doEasing) [0x00000] in <filename unknown>:0
at UIScrollList.RemoveItem (IUIListObject item, Boolean destroy) [0x00000] in <filename unknown>:0
at ApplicationLauncher.RemoveModApplication (.ApplicationLauncherButton button) [0x00000] in <filename unknown>:0
at RealChute.SettingsWindow.OnDestroy () [0x00000] in <filename unknown>:0

NullReferenceException: Object reference not set to an instance of an object
at Clouds.Clouds.Update () [0x00000] in <filename unknown>:0

But the last thing to happen before the file ends is this:


Exception thrown during Rentry Simulation at (wrapper managed-to-native) object:__icall_wrapper_mono_array_new_specific (intptr,int)
at System.Array.Resize[AbsoluteVector] (MuMech.AbsoluteVector[]& array, Int32 length, Int32 newSize) [0x00000] in <filename unknown>:0
at System.Array.Resize[AbsoluteVector] (MuMech.AbsoluteVector[]& array, Int32 newSize) [0x00000] in <filename unknown>:0
at System.Collections.Generic.List`1[MuMech.AbsoluteVector].set_Capacity (Int32 value) [0x00000] in <filename unknown>:0
at System.Collections.Generic.List`1[MuMech.AbsoluteVector].GrowIfNeeded (Int32 newCount) [0x00000] in <filename unknown>:0
at System.Collections.Generic.List`1[MuMech.AbsoluteVector].Add (AbsoluteVector item) [0x00000] in <filename unknown>:0
at MuMech.ReentrySimulation.RecordTrajectory () [0x00000] in <filename unknown>:0
at MuMech.ReentrySimulation.RunSimulation () [0x00000] in <filename unknown>:0 Out of memory

(Filename: /BuildAgent/work/d63dfc6385190b60/artifacts/LinuxStandalonePlayerGenerated/UnityEngineDebug.cpp Line: 49)

I'm not certain but it looks like MchJeb was trying to resize an array, maybe it was trying to make it bigger than 32bit, wrapped around to 0 and died.

Link to comment
Share on other sites

As for causes, how much physical RAM do you have? It looks like 8GB, so KSP alone oughtn't to crash unless it really starts chewing up memory like crazy, but are you running anything else RAM-hungry?

Yea 8gb, and the only things running were KSP, the terminal window with htop, and a nemo window open to the KSP directory.

I'm not certain but it looks like MchJeb was trying to resize an array, maybe it was trying to make it bigger than 32bit, wrapped around to 0 and died.

I did notice that at the very end, 'out of memory' sure looks like the culprit. Not even sure what MJ was doing, I was at the space center scene, and clicked the button to go back to the main menu when it all went to hell :)

Link to comment
Share on other sites

So I've been playing for a couple weeks with minimal issues from my latest problem, the game freezing and making my HD go wild, but it hit again last night out of the blue. I was actually closing the game and as soon as I tried to go to the main menu, it started. I sat and watched and listened to my HD crank non-stop for minutes and kept trying to alt-tab or ctrl-alt-backspace to get out of it and I was actually able to alt-tab after about 10 minutes and grab some screenshots. I'll include the logfile as well if anyone wants to take a look, I'm not sure what to even look for.

The first shot is a normal game memory usage situation:

http://i.imgur.com/1q15LAn.png?1

And here is what happened when it locked up and started cranking to my HD:

http://i.imgur.com/b8TWpmm.png?1

and HERE is the logfile.

This was the first time I was actually able to do anything except a hard shutdown when this happens. I'm terrified each time it does happen because it killed one HD with this problem when I had to pull the laptop battery when the HD wouldn't stop cranking :(

Your hard disk is cranking because you ran out of memory and it is going to the swap. What I find interesting are all those KSP.x86_64 processes, I don't see any more than one when I have looked.

Re. the hard drive being killed, most any computer these days will shut down if you press and hold the power button for 5-10 seconds.

Link to comment
Share on other sites

Your hard disk is cranking because you ran out of memory and it is going to the swap. What I find interesting are all those KSP.x86_64 processes, I don't see any more than one when I have looked.

Re. the hard drive being killed, most any computer these days will shut down if you press and hold the power button for 5-10 seconds.

That's exactly what killed my HD. I heard it go "Ka-Chunk" when it shut down mid-crank and after that, nothing but beeping errors when I tried to boot up, which is exactly the same thing that happened here, the only exception being, my new HD hasn't died yet!

I usually hover around 3.5gb usage, but something definitely happened that caused the memory to skyrocket and then start swapping and cranking the HD.

As for all the .x64_86 processes, that is how I've always seen it displayed in Mint, can anyone else chime in on this issue?

Link to comment
Share on other sites

As for all the .x64_86 processes, that is how I've always seen it displayed in Mint, can anyone else chime in on this issue?
Definitely seems like a bug in whatever program you're using to monitor processes. Maybe try a different one.
Link to comment
Share on other sites

Definitely seems like a bug in whatever program you're using to monitor processes. Maybe try a different one.

htop

I tried just plain ol 'top' and it didn't report multiple processes like htop did...but still that doesn't really have anything to do with my issue, all this happened way before I found htop (recommended here in this thread)

Link to comment
Share on other sites

In advance, sorry for the useless post:

I just want to chime in in this thread that seems mainly about compatibility issues some are having: I for one is running KSP (0.90 for the time being) just fine on Linux Mint 17. Once i had installed an up to date driver from NVIDIA, the game worked out of the box just as well as it worked under windows 7.

Link to comment
Share on other sites

  • 2 weeks later...

Does anyone know how to get it so that ksp only has one Icon on the unity launcher? It's a minor issue but one I would greatly apreciate a fix. ksp.desktop:


[Desktop Entry]
Comment=Kerbal Space Program
Terminal=false
Name=Kerbal Space Program
Exec=ksp
Type=Application
Icon=/home/[redacted]/KSP_linux/KSP_Data/Resources/UnityPlayer.png

ksp is just a script to run KSP.x86_64 with some optimizations

pic (the one without the rectangles is the one that sticks around after I close ksp):

2XfNDNP.png

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...