X11 in a jail with NVidia hard­ware

Just be­fore christ­mas I de­cided I will spend the “im­mense” amount of 40 EUR for a graph­ic card for a sys­tem which was without one. The sys­tem is sup­posed to re­place my dy­ing home-​server. I already moved everything, ex­cept my Desktop-​in-​a-​Jail (ac­tu­ally it is my home-​cinema-​jail).

The old sys­tem had a Radeon 9200SE, and it was enough for what I used it for. Now… for a few bucks you can get a lot more horsepower today. After look­ing around a little bit I de­cided to buy a NVidia card. I made this de­cision be­cause it looks like I can get bet­ter driver sup­port for it. So I got a Ge­Force GT 520 with 1 GB of RAM (I doubt I will be able to use that much RAM) and without a fan.

With the Radeon 9200SE I was not able to get the 3D stuff ac­tiv­ated (at least in the jail, I did not try without), Xorg com­plains about a miss­ing ag­p­gart mod­ule but I have AGP in the ker­nel (no /​dev/​agpgart out­side the jail). I did not spend time to in­vest­ig­ate this, as the main pur­pose – play­ing movies – worked. Now with the NVidia card I de­cided to give the 3D part a try again.

After adding the NVidia device entries to the jail, and a little bit of fight­ing with the Xorg-​HAL in­ter­ac­tion, I got a work­ing desktop. The biggest prob­lem to veri­fy that 3D is work­ing was, that I did not had xdri­info in­stalled. After in­stalling it, I no­ticed that it does not work with the NVidia driver.  🙁  Next stop nvidia-​settings: runs great, dis­plays a nice FreeBSD+NVidia logo, and … tells me that OpenGL is con­figured. Hmmm… OK, but I want to see it!

As I de­cided to switch from Gnome to KDE 4 at  the same time (I was us­ing KDE when it was at V 0.x, switched to Gnome as it looked nicer to me, and now I switch back after read­ing all the stuff in the net that KDE 4 is “bet­ter” than Gnome 3), I was a little bit out of know­ledge how to see the 3D stuff in ac­tion. So I quickly went to the set­tings and searched for some­thing which looks like it may use 3D. To my sur­prise, it was already us­ing 3D stuff. Nice. I fully real­ized how nice, when play­ing a video and us­ing Alt-​Tab to switch win­dows: the video was play­ing full speed scaled down in the window-​switcher-​thumbnail-​view.

That was too easy. I am happy about it.

Now that I have a work­ing setup of X11-​in-​a-​jail for Radeon and Ge­Force cards, I want to cleanup my changes to the ker­nel and the con­fig files (devfs.rules) and have a look to get this com­mit­ted. A big part of this work is prob­ably writ­ing doc­u­ment­a­tion (most prob­ably in the wiki).

I still want to see some fancy 3D stuff now. I tried to in­stall x11-​clocks/​glclock, but the build fails with an un­defined ref­er­ence to „glPoly­gonOff­se­tEXT“. 🙁 Any re­com­mend­a­tion for a fancy 3D dis­play? My pri­or­ity is on “fancy/​nice” with as less vi­ol­ence as pos­sible. Most prob­ably I will look at it once and then dein­stall it again, so it should be avail­able in the Ports Col­lec­tion (or in­cluded in KDE 4).

Sol­ar­is 10 up­date 9: the not so nice things about it

I up­dated some work­sta­tions of the cli­ent to Sol­ar­is 10 up­date 9. Upon in­stalling my xorg.conf (dual-​screen setup) I had to no­tice that it does not work any­more. The prob­lem is, that the NVidia driver does not con­tain sup­port for the graph­ic card we use.

Nor­mally this is not a big deal, this can hap­pen… but in this case this is about SUN Ul­tra 20 work­sta­tions with SUN provided NVidia Quat­tro FX (NV37GL) cards. Ok, they are not the most re­cent ones, they where bought 4 – 5 years ago, but still, they just work as needed here and the cur­rent Sol­ar­is re­lease has no out-​of-​the-​box sup­port for them. I would ex­pect this to work already in a fresh in­stall (yes, I was not able to get the nv driver to work with two screens on this graph­ic card, it seems the nv driver has not sup­port for this).

Solu­tion for me: down­load the old driver from NVidia and in­teg­rate it in­to Jump­start (but still, some hours are lost be­cause of first try­ing to get a work­ing dual-​screen setup with the nv driver be­fore tak­ing an old NVidia driver and us­ing it like be­fore in xorg.conf).

An­oth­er glitch a co-​worker dis­covered is that StarOf­fice is not in­cluded any­more. That is again some­thing which will cause some loss of time. I will have to have a look how to handle it. Prob­ably it is best to in­stall it on the serv­er and mount it via NFS on the work­sta­tions. I will see soon if this is can be done (in­stall­a­tion of OO in­to a spe­cif­ic place which can be shared) or not.

A desktop en­vir­on­ment in a jail.

Yeah! Fi­nally I got time to fin­ish my work to put a desktop en­vir­on­ment (in this case GNOME) in­to a jail. At least I have a proof of concept (I write this with fire­fox run­ning in my “deskjail”). No, I don’t do this for ad­di­tion­al se­cur­ity (there’s more se­cur­ity than in a non-​jailed setup, but less se­cur­ity than in an or­din­ary jail, as you have to al­low ac­cess to a lot more devices than in an or­din­ary jail), I do this for ad­di­tion­al flex­ib­il­ity: Mov­ing my desktop is now only the in­stall of FreeBSD on a new ma­chine and rsyncing the jail over to it. As the ma­chine will also be a host of sev­er­al jails where I have some com­mon users with the same UID in each jail, I don’t pol­lute the jail-​host with the desktop stuff and I have everything nicely sep­ar­ated.

Without a ker­nel patch and good devfs rules you will not get Xorg up and run­ning in a jail (at least I didn’t man­aged to let it re­cog­nize my graph­ic card without the ker­nel patch). Now I have to beef up the patch a little bit and ask for re­view (it weak­ens up the se­cur­ity a little bit like the sy­sctl security.jail.sysvipc_allowed=1 or security.jail.allow_raw_sockets=1).

But first I have to fin­ish the move of all my ser­vices I use at home to the jail-​host now.

Text why pro­pri­et­ary or no hard­ware docs hurt the man­u­fac­turer

I stumbled about a text which de­scribes why it is be­ne­fi­cial to dis­close hard­ware pro­gram­ming docs and why it doesn’t help in keep­ing this in­form­a­tion away from the com­pet­i­tion. I don’t re­peat it here, so go and read it.

It’s a little bit old (last mod­i­fied in 2003), but IMO still up-​to-​date. If someone ap­proaches a com­pany for hard­ware docs, please provide this link to them!

Un­for­tu­nately it fails to men­tion that it would even be nice to get docs for ob­sol­ete or not sup­por­ted any­more hard­ware (if your com­pet­i­tion learns even stuff from your hard­ware which is 3 – 4 gen­er­a­tions old, it is not really a com­pet­i­tion and you most prob­ably are lead­ing be­cause of in­nov­a­tion, if not you either are too ex­pens­ive and open­ing the docs would be a reas­on to buy re­gard­less, or your soft­ware de­vel­op­ment is not good enough and open­ing the docs would al­low users to fix this prob­lem them­selves). This could be a first step for a com­pany to “test the wa­ter”. It would be an in­vest­ment without any money in re­turn (the com­pany doesn’t sell such hard­ware any­more), but it would show the com­pany how it af­fects their im­age, how much they have to in­vest and what they can get in re­turn (when people do cre­at­ive things with your ob­sol­ete hard­ware you haven’t ima­gined be­fore, you can bet they can do the same with your cur­rent hard­ware too… you may get an en­tirely new mar­ket “for free”).

If you ap­ply some more thoughts about this top­ic and for ex­ample graph­ic cards, you even no­tice that any in­form­a­tion the com­pet­i­tion may get by look­ing at freely avail­able hard­ware docs for graph­ic cards (in­stead of re­verse en­gin­eer­ing it), can only be used 2 – 3 in­nov­a­tion cycles later. This is caused by the short turn around times between new graph­ic cards. When a new graph­ic card hits the mar­ket, a de­vel­op­ment team already works at the second next gen­er­a­tion (and the next gen­er­a­tion is most prob­ably not only in fea­ture freeze but at the bug fix­ing and per­form­ance en­hance­ment step). Now, how much value does the com­pet­i­tion gain from this? I would say only the money needed for the re­verse en­gin­eer­ing. At the same time you gain money from hard­ware sales from those people which use (the res­ult of) your hard­ware docs. And the com­pet­i­tion is re­quired to open their docs too (see be­low for the “com­puter freaks” part), so you can safe the money for the re­verse en­gin­eer­ing later too.

For sound­cards this is a little bit dif­fer­ent. There you don’t have such short cycles, but cur­rently there you have a pub­lished stand­ard (HDA) and you have Cre­at­ive with no docs at all on the oth­er side. Hey, Cre­at­ive, if you stumble upon this, what about kick­ing Mi­crosoft in the ass by provid­ing your hard­ware doc­u­ment­a­tion to any­one and be­ne­fit­ing from a lot of people which are pissed off be­cause their shiny Creative-​gear doesn’t work on Vista? I’m sure a lot of people are will­ing to spend their free time to find a way to make your hard­ware useable on Vista (and on oth­er OS“) without get­ting money from you. And I’m sure people will find a way to get stuff out of your hard­ware which makes your eyes fall out of your head (and in­creases hard­ware sales). Oh… yes… hey, VIA, what about the docs for your soundgear too? There’s no mar­ket for selling hard­ware docs, but a huge mar­ket to sell sound hard­ware. And those people which play around with non-​mainstream soft­ware are those people (com­puter freaks) which re­com­mend hard­ware to people (mom, dad, neigh­bors, friends) which don’t play around but just use main­stream soft­ware. Those “or­din­ary” people may not de­pend on your hard­ware docs, but the com­puter freaks will more likely re­com­mend stuff which works not only on the main­stream stuff (just in case someone wants to try some non-​mainstream stuff).

The same (com­puter freaks re­com­mend­ing hard­ware) is true for cable TV /​ satel­lite TV /​ … stuff.