Re: linux-c7 and opengl apps?

2018-10-06 Thread Johannes Lundberg
On Sat, Oct 6, 2018 at 1:39 PM Greg V  wrote:

>
>
> On Fri, Oct 5, 2018 at 11:21 PM, Theron  wrote:
> > % /compat/linux/opt/VirtualGL/bin/glxinfo | grep OpenGL
> > libGL error: MESA-LOADER: failed to retrieve device information
>
> Do you have linsysfs mounted?
>
> Try reading /compat/linux/sys/class/drm/card0/device/uevent.
>
> Mesa won't retrieve device information without linsysfs.
> I wrote the linsysfs patch that exposed the info there so that recent
> Mesa would work :)
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=222375
> (Wow, that was a year ago… interesting note from there: you might
> need to set LIBGL_DRI3_DISABLE=1 for Linux apps)
>


Thank you Greg!  LIBGL_DRI3_DISABLE=1 was it for me! Now I can run OpenGL
apps with linux-c7 :)


>
> Also, what's with the "/opt/VirtualGL"? Are you using mesa from
> linux-c7 or something… weird?
>
> > This problem has existed forever.  I am not sure it is actually a
> > fault in Linux emulation, as these very same symptoms ("failed to
> > retrieve device information" message, console freeze) existed back in
> > FreeBSDDesktop/freebsd-base-graphics days when attempting to run
> > purely FreeBSD OpenGL apps.  At the time the workaround was a patch
> > to Mesa's GPU detection; the underlying kernel problem wasn't
> > addressed.
>
> There was a somewhat related issue (but not the same one, FreeBSD and
> Linux versions of mesa/libdrm use different mechanisms to get device
> info).
> Mostly affected Wayland-EGL clients — they would try to access
> /dev/dri/card408 instead of /dev/dri/card0, fail to get info and fall
> back to software rendering.
> I fixed it a while ago:
>
> https://gitlab.freedesktop.org/mesa/mesa/commit/db8519a369261cdedda50852facc45616d4eba28
>
> But I never saw console freezes when Mesa couldn't properly detect the
> GPU o_0
>
> ___
> freebsd-current@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
>
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: linux-c7 and opengl apps?

2018-10-06 Thread Greg V



On Fri, Oct 5, 2018 at 11:21 PM, Theron  wrote:

% /compat/linux/opt/VirtualGL/bin/glxinfo | grep OpenGL
libGL error: MESA-LOADER: failed to retrieve device information


Do you have linsysfs mounted?

Try reading /compat/linux/sys/class/drm/card0/device/uevent.

Mesa won't retrieve device information without linsysfs.
I wrote the linsysfs patch that exposed the info there so that recent 
Mesa would work :)

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=222375
(Wow, that was a year ago… interesting note from there: you might 
need to set LIBGL_DRI3_DISABLE=1 for Linux apps)


Also, what's with the "/opt/VirtualGL"? Are you using mesa from 
linux-c7 or something… weird?


This problem has existed forever.  I am not sure it is actually a 
fault in Linux emulation, as these very same symptoms ("failed to 
retrieve device information" message, console freeze) existed back in 
FreeBSDDesktop/freebsd-base-graphics days when attempting to run 
purely FreeBSD OpenGL apps.  At the time the workaround was a patch 
to Mesa's GPU detection; the underlying kernel problem wasn't 
addressed.


There was a somewhat related issue (but not the same one, FreeBSD and 
Linux versions of mesa/libdrm use different mechanisms to get device 
info).
Mostly affected Wayland-EGL clients — they would try to access 
/dev/dri/card408 instead of /dev/dri/card0, fail to get info and fall 
back to software rendering.
I fixed it a while ago: 
https://gitlab.freedesktop.org/mesa/mesa/commit/db8519a369261cdedda50852facc45616d4eba28


But I never saw console freezes when Mesa couldn't properly detect the 
GPU o_0


___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: linux-c7 and opengl apps?

2018-10-05 Thread Chuck Tuffli
On Wed, Oct 3, 2018 at 2:39 AM Johannes Lundberg  wrote:

> Hi
>
> Have anyone successfully run opengl apps with linux-c7?
>
> Linux opengl apps works great with linux-c6 on gpu < kabylake but
> linux-c6-dri does not include support for kabylake gpus.
> Linux glxinfo in c7 show support for hardware rendering on kabylake but any
> attempt to run an opengl app results in application seg fault or other
> crash (I believe this is also the case with skylake gpus on linux-c7).
>
> Is there any way to run gdb on linux apps/core dumps?
>

I have a patch to generate core dumps that a Linux gdb can decode. It has
limited testing, but I'm happy to rebase + share it with you.

--chuck
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: linux-c7 and opengl apps?

2018-10-05 Thread Theron

On 10/3/18 5:36 AM, Johannes Lundberg wrote:

Hi

Have anyone successfully run opengl apps with linux-c7?

Linux opengl apps works great with linux-c6 on gpu < kabylake but
linux-c6-dri does not include support for kabylake gpus.
Linux glxinfo in c7 show support for hardware rendering on kabylake but any
attempt to run an opengl app results in application seg fault or other
crash (I believe this is also the case with skylake gpus on linux-c7).

Is there any way to run gdb on linux apps/core dumps?

/Johannes
___

On an Intel Skylake graphics system it has never worked:
% /compat/linux/opt/VirtualGL/bin/glxinfo | grep OpenGL
libGL error: MESA-LOADER: failed to retrieve device information
libGL error: Version 4 or later of flush extension not found
libGL error: failed to load driver: i915
libGL error: MESA-LOADER: failed to retrieve device information
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Unknown Intel Chipset
OpenGL version string: 1.3 Mesa 17.0.1

Running any Linux OpenGL app which attempts to do actual rendering 
results in an indefinite freeze of the console: graphical output is 
frozen, and system does not respond to keyboard (Ctrl-Alt-Del or 
Ctrl-Alt-F1).  However, the system continues to run (tested with ssh).  
Sometimes, after several minutes, the console recovers, the OpenGL user 
segfaults, and the system returns to normal (until the next attempt to 
use an OpenGL Linux app).


This problem has existed forever.  I am not sure it is actually a fault 
in Linux emulation, as these very same symptoms ("failed to retrieve 
device information" message, console freeze) existed back in 
FreeBSDDesktop/freebsd-base-graphics days when attempting to run purely 
FreeBSD OpenGL apps.  At the time the workaround was a patch to Mesa's 
GPU detection; the underlying kernel problem wasn't addressed.


Where would I begin to investigate the problem, in order to fix it 
and/or to decide who's bug it is?  Unless there is something simpler to 
try, I may have to dig up those old Mesa patches and see whether a 
non-Linux binary can be made to trigger the same symptom.


By design, is it considered acceptable that any member of the "video" 
group has permission to destroy functionality of the graphics 
subsystem?  Is this a bug in the general case, or an accepted technical 
limitation?


Copying to x11@.

Theron
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: linux-c7 and opengl apps?

2018-10-05 Thread blubee blubeeme
On Fri, Oct 5, 2018 at 11:50 PM Greg V  wrote:

>
>
> On Wed, Oct 3, 2018 at 12:36 PM, Johannes Lundberg 
> wrote:
> > Hi
> >
> > Have anyone successfully run opengl apps with linux-c7?
> >
> > Linux opengl apps works great with linux-c6 on gpu < kabylake but
> > linux-c6-dri does not include support for kabylake gpus.
> > Linux glxinfo in c7 show support for hardware rendering on kabylake
> > but any
> > attempt to run an opengl app results in application seg fault or other
> > crash (I believe this is also the case with skylake gpus on linux-c7).
>
> On AMD Polaris: everything used to work in an ubuntu 16.04 chroot
> (currently having "can't open display :0" with that, probably
> forgetting something).
>
> Trying Unigine Heaven with c7, segfaults right now. glxinfo shows
> everything correctly though.
>
> > Is there any way to run gdb on linux apps/core dumps?
>
> There was a BSDCan talk that mentioned some gdb solutions:
>
> https://www.youtube.com/watch?v=9N3NrPeCJpk
>
> https://www.bsdcan.org/2018/schedule/attachments/473_linuxulator-notes-bsdcan2018.txt
>
> ___
> freebsd-current@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
>
In the video, you guys run into issues w/ debugging core dumps. While this
doesn't make any sense, you guys are free to write your own Linux core dump
disassembler.

Core dumps are created this way:
https://github.com/torvalds/linux/blob/master/fs/binfmt_elf.c#L97

The elf format is documented online. Once that's done you have all the
registers, heap, stack, data and you can play from there.

Writing a disassembler should be childs play, shouldn't it?

Best
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: linux-c7 and opengl apps?

2018-10-05 Thread Greg V




On Wed, Oct 3, 2018 at 12:36 PM, Johannes Lundberg  
wrote:

Hi

Have anyone successfully run opengl apps with linux-c7?

Linux opengl apps works great with linux-c6 on gpu < kabylake but
linux-c6-dri does not include support for kabylake gpus.
Linux glxinfo in c7 show support for hardware rendering on kabylake 
but any

attempt to run an opengl app results in application seg fault or other
crash (I believe this is also the case with skylake gpus on linux-c7).


On AMD Polaris: everything used to work in an ubuntu 16.04 chroot 
(currently having "can't open display :0" with that, probably 
forgetting something).


Trying Unigine Heaven with c7, segfaults right now. glxinfo shows 
everything correctly though.



Is there any way to run gdb on linux apps/core dumps?


There was a BSDCan talk that mentioned some gdb solutions:

https://www.youtube.com/watch?v=9N3NrPeCJpk
https://www.bsdcan.org/2018/schedule/attachments/473_linuxulator-notes-bsdcan2018.txt

___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: linux-c7 and opengl apps?

2018-10-05 Thread Tijl Coosemans
On Wed, 3 Oct 2018 10:36:51 +0100 Johannes Lundberg  wrote:
> Have anyone successfully run opengl apps with linux-c7?
> 
> Linux opengl apps works great with linux-c6 on gpu < kabylake but
> linux-c6-dri does not include support for kabylake gpus.
> Linux glxinfo in c7 show support for hardware rendering on kabylake but any
> attempt to run an opengl app results in application seg fault or other
> crash (I believe this is also the case with skylake gpus on linux-c7).

The only non-nvidia hardware I have is an old r300 card and that works
under linux c7 emulation.  Do you have linsysfs mounted on
/compat/linux/sys?
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: linux-c7 and opengl apps?

2018-10-03 Thread blubee blubeeme
On Wed, Oct 3, 2018 at 5:40 PM Johannes Lundberg  wrote:

> Hi
>
> Have anyone successfully run opengl apps with linux-c7?
>
> Linux opengl apps works great with linux-c6 on gpu < kabylake but
> linux-c6-dri does not include support for kabylake gpus.
> Linux glxinfo in c7 show support for hardware rendering on kabylake but any
> attempt to run an opengl app results in application seg fault or other
> crash (I believe this is also the case with skylake gpus on linux-c7).
>
> Is there any way to run gdb on linux apps/core dumps?
>
> /Johannes
> ___
> freebsd-current@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
>

Highly unlikely since the Linux kernel memory model is pretty different
than FreeBSD especially concerning graphics.

Linux kernel graphics will have to use dma regions or the low kernel memory
while most other stuff hangs out in the high kernel memory.

Since the graphics drivers have to have contiguous memory regions that
should not be swapped out, if linuxkpi doesn't manage these complexities
you'll continue to random failures especially around sleep to wake, context
switching and power management.

It can be fixed though, you'll just need to port the entire Linux memory
architecture to FreeBSD and that's as it stands right now.

Don't look into rma, numa, hhm, huge pages and all the other lovely memory
features that is currently mainline or about to get merged into mainline.

Good luck with that though.

Best,
Owen
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


linux-c7 and opengl apps?

2018-10-03 Thread Johannes Lundberg
Hi

Have anyone successfully run opengl apps with linux-c7?

Linux opengl apps works great with linux-c6 on gpu < kabylake but
linux-c6-dri does not include support for kabylake gpus.
Linux glxinfo in c7 show support for hardware rendering on kabylake but any
attempt to run an opengl app results in application seg fault or other
crash (I believe this is also the case with skylake gpus on linux-c7).

Is there any way to run gdb on linux apps/core dumps?

/Johannes
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"