Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 04 Oct 2016 16:14:25 +0300
From:      Arto Pekkanen <isoa@kapsi.fi>
To:        Scott Bennett <bennett@sdf.org>
Cc:        freebsd-x11@freebsd.org
Subject:   Re: NVidia + run X apps from jail
Message-ID:  <5a3f7caa7037ec3455c8a23100ce01f5@kapsi.fi>
In-Reply-To: <201610032211.u93MBHwA024530@sdf.org>
References:  <20161003021517.GB92917@pf-bsd.local> <201610030717.u937HJ3Q018671@sdf.org> <cccd3de7be9a2910e78d0c07ea58ee68@kapsi.fi> <201610032211.u93MBHwA024530@sdf.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Scott Bennett kirjoitti 04.10.2016 01:11:
>> The problem is more complicated than that.
>> 
>> A FreeBSD jail fully prevents applications from accessing the graphics
>> device. This means you must run the X-server outside of the jail, and
>> then have the X applications connect to it from within the jail.
>> 
>> The applications cannot access the direct rendering capabilities of 
>> the
>> GPU, because the GPU device is not available inside the jail (is 
>> outside
>> the jail or in another computer entirely). This means that OpenGL
>> applications cannot work UNLESS the GPU specific OpenGL library 
>> supports
>> AIGLX. AIGLX allows sending OpenGL data over X11 client server
>> connection, so that the graphics are rendered indirectly by the server
>> instead of the application using the GPU directly. I know that the 
>> Open
>> Source drivers such as i915 and radeon support AIGLX, but I am not 
>> sure
>> if nVidia supports it. Read more on AIGLX here:
>> https://en.wikipedia.org/wiki/AIGLX
> 
>      Well, if he uses a driver whose only support for the hardware is 
> VESA,
> I doubt it can help.  If he uses a driver that fully supports the 
> hardware,
> then other options may open up.

Yes, but it is trivial to verify which nvidia-driver-* package supports 
the GPU or not. Do that first, after that go with what I said.

>> To verify whether nVidia supports AIGLX, ie. OpenGL over X11 network
>> connection, you should try installing the nvidia-driver package inside
>> the jail where you run the applications. The nvidia-driver package
>> provides nVidia specific libGL, which might be required to have
>> compatible AIGLX implementation in both server and client end.
>> 
>> If installing nvidia-driver inside the jail does not enable OpenGL
>> applications to run, then I assume the proprietary nVidia driver does
>> not support AIGLX.
>> 
>> And regardless if you get AIGLX working or not, it is a suboptimal
>> solution to remote or indirect rendering of OpenGL. The better way is 
>> to
>> use VirtualGL:
>> http://www.virtualgl.org/About/Introduction
>> 
>> I've used VirtualGL to run OpenGL applications from a headless server 
>> on
>> a laptop with a GPU, full hardware acceleration. I won't be acting as
>> your technical support, but I just suggest you read the manuals, 
>> google
>> a bit and do your own research on this.
>> 
>      All that is interesting, but again, he needs to install the 
> correct
> driver, not the current nvidia-driver, which doesn't support his 
> graphics
> card (except as VESA).
> 

No, this is not only interesting BUT very crucial. Unless he does extra 
setup he won't be able to run OpenGL applications remotely with 
tolerable framerate or at all. Even if he install a proper driver at the 
X-server rig, it does not guarantee any success in running OpenGL 
application inside the jail, unless the things I mentioned are taken 
into account. Go try running OpenGL application inside a FreeBSD jail 
yourself before trying to sound so smug.

-- 
Arto Pekkanen



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5a3f7caa7037ec3455c8a23100ce01f5>