# brainstorming optimus support development...

## adramalech707

Okay so still waiting for my m11x r3 to show up, but in the meantime I am going to be motivated into testing out how to get optimus working with Linux especially with gentoo-source kernel.  The main thing I see that need to be done:

1. Since you need to install Intel hd3000 driver and the Nvidia gt540m driver then the problem is how to know when to switch and how to go about it.  Thus creating a module that can have access to the ACPI 4.0 functions, xorg functions, and lm_sensors can then be able to acknowledge when it needs to switch from integrated to Nvidia card.  

2. The next is how to deal with X.org server.  Do you just randomly take it down and bring it back up after switching cards.  I don't think that is possible while in the middle of loading into l4d2 in steam, etc...  therefore there will need to be a somewhat of buffer between it like branching off the X.org server somehow to get it running on the nvidia card, then killing the intel one.  

3.  Lastly is creating a front-end GUI or a CLI based library that can take parameters which create rules and control/modify existing rules for when to switch which programs don't switch...etc..

4.  Then just add it to like vixie-cron to be loaded at default rules and then it should be good.

This is just a brainstorm I doubt it will be as simple as this.  However, the overall idea should be close to this.  I might even think creating a module and dealling with it as a module would be good aswell.  The limits of this idea would become unlimited as soon as more support and developing becomes normal.  I would call it like lib-optimus or nv-optimus etc...

Any suggestion/questions/comments/pointers would be awesome.   :Cool:   I would just like a second opinion to say if I am crazy to even try wasting my time on this or would this be a somewhat good idea to try and develop to allow the entire community to benefit?

----------

## Letharion

Interesting project, I've been having similar ideas myself, but thought it's so much work for someone not initiated in X, kernel development, etc.

As feedback, I think I've read somewhere (phoronix?), that X, the way it works today, can not switch GPU while running. Might be interesting to look at doing this with wayland?

----------

## Gusar

Optimus is not about switching graphic cards, so what you're describing here is not Optimus. The problems with Optimus are elsewhere. The newest on that is this message by Dave Airlie from March: http://lists.freedesktop.org/archives/xorg/2011-March/052720.html, where he says he got something working, but it's not in a releasable state yet.

Then there's this other crazy trick that appeared no longer than three days ago: http://www.martin-juhl.dk/2011/05/optimus-on-linux-problem-solved/

----------

## adramalech707

Thanks for the tips.  I didn't think Wayland was going to be supported mainstream yet?  

I guess I need to have to probably coordinate with the xorg guys and get on the bandwagon of what actually would need to switched around.  Right now I see xorg as good, but Wayland is the future.  I don't know how far off Wayland is from actually be the end all cure all.

----------

## fafhrd

I have an m11xr3. I received it in June, got Gentoo mostly working, realized that Optimus was a clusterf***, and put windows 7 on it ... that lasted for about 2 months.  :Wink: 

In August, I got Gentoo back on, pretty sure that at least opengl accel and CUDA could work ala bumblee project or the gentoo linux wiki on the topic. I really wanted to get my external monitors to work, though (the m11x has HDMI and DisplayPort). After some work, I actually got it to work! http://www.youtube.com/watch?v=b-huJF-cXnI

I plan on getting a blog post and some instructions up -- but have hope! Optimus is still a clusterf***, but it can me made to mostly work.

My solution works great if you use a tiling window manager. It's probably not going to be too great if you use GNOME or KDE and expect windows to span across the external monitors and the laptop screen.

----------

