You are not logged in.

#1 2017-10-10 10:32:40

pabulum
Member
From: Britanny
Registered: 2017-08-13
Posts: 18

[SOLVED] How to launch Steam Wine games with cpu affinity with dmenu?

Hello,

I don't know if I'm posting in the right place or if I should be multi-posting but perhaps this whole thing can prove useful.

note 1: I'm using i3-wm and have set up nvidia-xrun correctly for my hybrid graphics laptop.
note 2: I know dmenu is a single and different question but I'm also having a hard time understanding the PATH idea.

Here is what I need your help for:

-First: launching steam.exe with dmenu

-Last: launching a game with fixed taskset or schedtool arguments with dmenu (through steam / without calling the game.exe directly)

(is it possible to have steam running in the igpu / first tty and the game in the xrun session?)

Sorry for my english and thank you for your help.

Edit: Solved in #11 . Almost full credit goes to 29jm

Last edited by pabulum (2017-10-10 20:23:31)

Offline

#2 2017-10-10 11:48:59

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] How to launch Steam Wine games with cpu affinity with dmenu?

Dmenu doesn't launch programs, did you mean dmenu_run?

You need to create a script the launches the game (and includes your taskset/schedtool requirements) and put it somewhere in your PATH for it to be picked up my dmenu_run.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2017-10-10 12:41:07

pabulum
Member
From: Britanny
Registered: 2017-08-13
Posts: 18

Re: [SOLVED] How to launch Steam Wine games with cpu affinity with dmenu?

Thank you, I did a successful test with

/usr/bin/teststeam
#!/bin/sh
cd ~/.wine/drive_c/Steam
wine Steam.exe

Now the question is: how do I run a game through Steam.exe the same way?
I mean, not with

wine game.exe

but with its AppID? This way steam would know I'm playing the game and would be able to sync my savegames.
(I'm also interested to learn how to do that with steam for linux since I can't create a desktop shortcut for obscure reasons)

Offline

#4 2017-10-10 12:46:59

Omar007
Member
Registered: 2015-04-09
Posts: 368

Re: [SOLVED] How to launch Steam Wine games with cpu affinity with dmenu?

https://developer.valvesoftware.com/wik … rameters_3
Specifically: -applaunch <appId>

I do not know if the same argument also works on the Linux Steam client, never tried/used it.

Last edited by Omar007 (2017-10-10 12:50:16)

Offline

#5 2017-10-10 13:12:13

pabulum
Member
From: Britanny
Registered: 2017-08-13
Posts: 18

Re: [SOLVED] How to launch Steam Wine games with cpu affinity with dmenu?

Thank you, it will help.

Maybe I've misspoken because I want to use some schedtool arguments for a game.exe, not for Steam.exe .
And I can't imagine Steam.exe giving shedtool commands to linux through wine. But maybe it can?

I hope you can see what I mean or what I don't understand.

Offline

#6 2017-10-10 14:07:22

pabulum
Member
From: Britanny
Registered: 2017-08-13
Posts: 18

Re: [SOLVED] How to launch Steam Wine games with cpu affinity with dmenu?

A solution would be to catch the game.exe's PID when it launches then e.g.:

taskset -cp 0 <game.exe's PID>

But how do I catch it? (Sorry for the double post)

Last edited by pabulum (2017-10-10 14:08:15)

Offline

#7 2017-10-10 14:45:51

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] How to launch Steam Wine games with cpu affinity with dmenu?

You shouldn't put files in /usr/bin that aren't being tracked by pacman.

Either put them in /usr/local/bin or somewhere in your home folder that's in your PATH - I use ~/bin which is added to PATH by my shell config.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#8 2017-10-10 14:52:59

pabulum
Member
From: Britanny
Registered: 2017-08-13
Posts: 18

Re: [SOLVED] How to launch Steam Wine games with cpu affinity with dmenu?

With:

/usr/local/bin/witcher3 (thanks, got it)
#!/bin/sh
cd /PathToTheWitcher3exeFolder/
wine witcher3.exe &
sleep 1
taskset -cp 0 $!

I can get witcher3.exe to run on 1 core.
But Steam.exe doesn't see it running and that is The problem.

Offline

#9 2017-10-10 15:29:48

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] How to launch Steam Wine games with cpu affinity with dmenu?

Does replacing...

cd /PathToTheWitcher3exeFolder/
wine witcher3.exe &

with...

wine /path/to/Steam.exe --applaunch <witcher3appid> &

not do what you want?


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#10 2017-10-10 16:45:12

pabulum
Member
From: Britanny
Registered: 2017-08-13
Posts: 18

Re: [SOLVED] How to launch Steam Wine games with cpu affinity with dmenu?

It doesn't (even launch the game) but I've created a desktop shortcut from steam then wrote this one:

/usr/local/bin/witcher3
#!/bin/sh
Exec=env WINEPREFIX="/home/username/.wine" /usr/bin/wine C:\\\\windows\\\\command\\\\start.exe steam://rungameid/292030 &
sleep 1
taskset -cp 0 $!

Wich does make the game running from steam but doesn't set the affinity.

Offline

#11 2017-10-10 19:59:49

pabulum
Member
From: Britanny
Registered: 2017-08-13
Posts: 18

Re: [SOLVED] How to launch Steam Wine games with cpu affinity with dmenu?

Problem solved:

#!/bin/sh
Exec=env WINEPREFIX="/home/username/.wine" /usr/bin/wine C:\\\\windows\\\\command\\\\start.exe steam://rungameid/292030 &
sleep 5
taskset -cp 0 $(pgrep witcher3.exe)

Next step:

taskset -cp 1-7 <everything else>

Offline

#12 2017-10-11 10:55:30

pabulum
Member
From: Britanny
Registered: 2017-08-13
Posts: 18

Re: [SOLVED] How to launch Steam Wine games with cpu affinity with dmenu?

pabulum wrote:

Next step:

taskset -cp 1-7 <everything else>

Also solved by adding

isolcpus=0

at the end of the options line in /boot/loader/entries/arch.conf

But it is recommended to isolate any thread you want but 0 because there is stuff stuck on this one.

Offline

Board footer

Powered by FluxBB