Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How do I allow a chroot to use only 1 processor?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64
View previous topic :: View next topic  
Author Message
Eidi
Tux's lil' helper
Tux's lil' helper


Joined: 02 Sep 2004
Posts: 82
Location: Arizona

PostPosted: Sat Mar 18, 2006 9:34 pm    Post subject: How do I allow a chroot to use only 1 processor? Reply with quote

I'm really not sure how to ask this, or even if I'm saying it right, but I have an Athlon 64 X2, and I'm wondering if I can set up a chroot to use only 1 of the 2 processors in it.

The reason being is that a game I play has issues with a multiple processor system, which I can run fine under Cedega. And I was just thinking about how to make it only use 1 processor... So, yeah.

This is probably an odd request, purposefully gimping your system, but I'm wondering if it can be done while the main install is able to use both cores.

Thanks in advance for any help.
Back to top
View user's profile Send private message
Aries-Belgium
l33t
l33t


Joined: 08 Jul 2005
Posts: 730
Location: Willebroek, Belgium

PostPosted: Sat Mar 18, 2006 11:21 pm    Post subject: Reply with quote

It's a long shot, but you could disable smp in the kernel of the chroot ...
I think the second core isn't recognized then, but I'm not sure ...
_________________
Ep2.nl | Developers Community
Back to top
View user's profile Send private message
Eidi
Tux's lil' helper
Tux's lil' helper


Joined: 02 Sep 2004
Posts: 82
Location: Arizona

PostPosted: Sun Mar 19, 2006 3:12 am    Post subject: Reply with quote

I think the chroot uses your currently running kernel, I don't think it has a kernel all for itself.

I know virtual machines like VMWare and Xen uses a new kernel for each machine, I may have to do that if it's unable to be done via a chroot... But can they make use of NVidia 3D acceleration?

I could be wrong, but I don't think a new kernel is used for a chroot.
Back to top
View user's profile Send private message
Aries-Belgium
l33t
l33t


Joined: 08 Jul 2005
Posts: 730
Location: Willebroek, Belgium

PostPosted: Sun Mar 19, 2006 3:43 am    Post subject: Reply with quote

Yeah, you're right.

Can I ask, why exactly you need a chroot to play a game?

Vmware uses a virtual vmware adapater, so I don't know it has opengl support and stuff ...
_________________
Ep2.nl | Developers Community
Back to top
View user's profile Send private message
alistair
Retired Dev
Retired Dev


Joined: 15 Jul 2005
Posts: 869

PostPosted: Sun Mar 19, 2006 3:48 am    Post subject: Reply with quote

I have no experience with this but couldn't you set the processor affinity at runtime or before.

So if the exe is located in the chroot then you set a processor. This is the hard bit as I dont know if you can find out where a processes exe is located (especially with respect to the the real /)
_________________
______________
Help the gentoo-java project. Visit Gentoo Java Project

what good are admin powers if you don't abuse them for personal gain - mark_alec
Back to top
View user's profile Send private message
Eidi
Tux's lil' helper
Tux's lil' helper


Joined: 02 Sep 2004
Posts: 82
Location: Arizona

PostPosted: Sun Mar 19, 2006 4:32 am    Post subject: Reply with quote

I might try VMWare if it supports that, but I honestly have no clue.

If I started Cedega with a processor affinity at runtime, would any child processes also have that processor affinity? It might work that way. I dunno how to do a processor affinity though.

I dunno if I need a chroot or not, I was just thinking it might be better to play games in 32-bit mode instead of 64, but I dunno if that'll change anything or not, honestly.
Back to top
View user's profile Send private message
niallm
n00b
n00b


Joined: 05 Jul 2004
Posts: 3

PostPosted: Mon Mar 20, 2006 5:07 pm    Post subject: Reply with quote

You can specify how many processors you want each virtual machine to have with Xen so this might be of some use to you. Might be hard to get the direct hardware acceleration for the nvidia card working with xen.

Dont think VMware would work well for this at all if the game needs 3d acceleration as last time I looked anyway vmware just presents the card as a standard VGA card.
Back to top
View user's profile Send private message
tcfelker
n00b
n00b


Joined: 24 Jun 2003
Posts: 46

PostPosted: Tue Mar 21, 2006 12:16 am    Post subject: Reply with quote

Code:

emerge schedtool

schedtool -a 1 -e command


Anything you put for command, and all of its children, will be forced to run on the first CPU. Use -a 2 to force to the second CPU or -a 3 to force for both (it's a bitmask). The game may still detect the system as SMP, but if the problems simply come from race conditions exacerbated by having multiple CPUs, this should help.

Don't waste your time with the kernel inside the chroot, that will have no effect, as processes inside the chroot are still using the same kernel as outside.
Back to top
View user's profile Send private message
Eidi
Tux's lil' helper
Tux's lil' helper


Joined: 02 Sep 2004
Posts: 82
Location: Arizona

PostPosted: Tue Mar 21, 2006 8:32 pm    Post subject: Reply with quote

Ah, thank you very much. Seems like it works, woot!

Thanks again!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64 All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum