Setting TF-X Affinity to One CPU (Linux)

Discussion in 'ToEE Front-End X' started by PracticalKat, Jan 27, 2018.

Remove all ads!
  1. PracticalKat

    PracticalKat Member

    Joined:
    Jan 1, 2018
    Messages:
    11
    Likes Received:
    1
    I have TFE-X working fine under Linux on my laptop. I have 5 cores and all of them run together when I start Co8 from the front-end. The laptop overheats and shuts down after 5 minutes.

    I have solved the same problem for Icewind Dale 2 by making the process run on one core using a script with taskset I found on the internet. Having tried this with TFE-X it does not work, probably because TFE-X is just a launcher and so Co8 runs as usual on all cores (have checked the system monitor).

    Is there code I can tweak "under the hood" to fix this? Thanks!
     
  2. PracticalKat

    PracticalKat Member

    Joined:
    Jan 1, 2018
    Messages:
    11
    Likes Received:
    1
    PS I have tried using wine to load toee.exe directly in the script, but I get a black screen for an instant and then it disappears. The last line on the terminal that I can see is "fixme:win:EnumDisplayDevicesW ((null),0,0x33f6b4,0x00000000), stub!"
     
  3. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,029
    Likes Received:
    42
    Agetian's the only one here with any real practical knowledge of TFE-X's workings with Linux/Wine, but unfortunately he's not around much anymore. TFE-X is open source though, so if you're savvy enough you can examine the code yourself and see if you can tweak anything to your needs.
     
    Last edited: Jan 29, 2018
  4. PracticalKat

    PracticalKat Member

    Joined:
    Jan 1, 2018
    Messages:
    11
    Likes Received:
    1
    OK, thanks. I'll have a go at checking the code when I have some time, but Java is not my thing...

     
  5. PracticalKat

    PracticalKat Member

    Joined:
    Jan 1, 2018
    Messages:
    11
    Likes Received:
    1
    I've had another go at solving the problem. I hope these notes will help someone else.

    Since I can't set core affinity I've been looking at ways to slow cores down. The method I'm outlining below has tested out on games under WINE other than TFE-X. These instructions have been tested under Ubuntu 16.04, but should probably work on other Debian / Ubuntu systems.

    1. Install package cpufrequtils
    2. Run cpufreq-info for information on available cpus and the speed they are set to run at (there are preset profiles)
    3. Remember, cpus are numbered internally from 0. So if you have two cpus, they are 0 and 1.
    4. Remember to run this as root! If you want to set set the maximum frequency of cpu 0 to 1.5GHz, you'd run:
    cpufreq-set --cpu 0 --max 1.5GHz
    5. If you want to limit all cpus then you need to run this command for each one.
    6. Then all processes will run at this reduced speed!
    7. I think this resets when you log out and in again.

    This works on Icewind Dale 2, but for some reason launching the CO8 modpack from TFE-X doesn't seem to be affected.
     
Our Host!