Re: [opensource-dev] Mac viewer and Apple maintained opensource libraries

2017-02-01 Thread Geir Nøklebye
Oz Linden said:

> If you've got a fix, we'd love to see it.

There is no quick fix except rewriting the renderer to use the 
NSOpenGLProfileVersion3_2Core profile or even Metal (which would also be a 
first step to also run on iOS).

In Kokua we have managed to delay the crash from happening within 30 secs to 2 
minutes in many scenes to 10+ minutes to not happening at all in the same 
scenes. This was done through a series of steps:

1. The simplest and most surprising was adding an Apple OpenGL header to 
llglshaderheaders.h namely 

2. Enabling all extensions the viewer logged as not available except 
GL_ARB_occlusion_query2 which we can’t get to

3. Not include llerror.h in llwindow

4. Eliminate all autoreleasepool statements from the code (which you have to do 
to compile the viewer with Xcode 8 anyway)

5. Advice users with NVIDIA cards and 512 Mb or less graphics memory to lower 
the texture memory setting in graphics preferences to 384 Mb. (this extends the 
delay before crash some in many scenes.)

6. Fixed the gamme used by the system from 1.8 to 2.2 which has been the system 
default since macOS 10.6

7. Cleaned up font loading and use the Menlo system font as fixed width font. 

8. Deployment target of 10.9 and now 10.10. - Which reminds me that some of the 
libraries for the 64.bit viewer builds have a 10.11 deployment target while the 
viewer has 10.9. This is NOT good!


The viewer still crash in the occlusion code, but not as often as without these 
changes. 
___
Policies and (un)subscribe information available here:
http://wiki.secondlife.com/wiki/OpenSource-Dev
Please read the policies before posting to keep unmoderated posting privileges

Re: [opensource-dev] Mac viewer and Apple maintained opensource libraries

2017-02-01 Thread Geir Nøklebye
Whirly Fizzle said:

> Switching over to using the Nvidia web drivers fixes the frequent crashing 
> but some systems suffer poorer viewer performance with the Nvidia web drivers.

You can use the so called NVIDIA web driver as it gives the current viewer code 
access to the direct hardware address of the extension, but this viewer does 
not support Metal, which is why you see reduced system performance at a typical 
loss of 7-10 fps at a minimum (what you actually see is performance loss in 
compositing the desktop that the viewer runs windowed in.)

Also this driver is made for the Mac Pro (trash can models) and they just 
“happen to work” for the time being. 
___
Policies and (un)subscribe information available here:
http://wiki.secondlife.com/wiki/OpenSource-Dev
Please read the policies before posting to keep unmoderated posting privileges

Re: [opensource-dev] Mac viewer and Apple maintained opensource libraries

2017-02-01 Thread Geir Nøklebye
Cinder said

> It's not a viewer bug, it?s an issue with Apple's Nvidia driver. (also note, 
> that it doesn?t happen with Radeon or Nvidia?s own driver, just Apple?s and 
> happens to hundreds upon hundreds of games available on Steam.)

Apple Software Engineering has acknowledged that such crashes will happen but 
it is in status “will not fix” because this is expected behavior. (I have this 
as an open acknowledged Radar)

in llopenglview-objc.mm there is a NSOpenGLPixelFormatAttribute attrs[] 
statement where there is a comment in the code that 10.7 and 10.8 don’t care 
about defining a profile or not.

But from 10.11 it cares A LOT!

Unless you define a profile of NSOpenGLProfileVersion3_2Core the system will 
force you to the NSOpenGLProfileVersionLegacy, which will not give you access 
to extensions such as GL_ARB_occlusion_query2.

Before 10.11 you could work around it by going directly to the hardware address 
of the extension (which the current viewer code does), but from 10.11 there is 
NO WAY of getting to it unless you have used NSOpenGLProfileVersion3_2Core and 
rewritten the renderer for it. 

The reason for this that from 10.11 Apple started compositing the macOS desktop 
with Metal, and this change made it necessary to very tightly control access to 
the GPU without disaster striking. 

Already at the WWDC where 10.10 was introduced Apple strongly urged developers 
to rewrite their code to use the NSOpenGLProfileVersion3_2Core profile. If you 
use this profile, the viewer will not compile. 
___
Policies and (un)subscribe information available here:
http://wiki.secondlife.com/wiki/OpenSource-Dev
Please read the policies before posting to keep unmoderated posting privileges

Re: [opensource-dev] Mac viewer and Apple maintained opensource libraries

2017-02-01 Thread Geir Nøklebye
Dahlia Trimble said:

> It's probably considered bad practice for code to use an ARB extension 
> without first checking to see if it's available.

All the viewers already detect and log this, and you will find it at asa  log 
entry like:

2017-02-01T08:08:30Z INFO: #RenderInitinitExtensions: Couldn't initialize 
GL_ARB_occlusion_query2


There is no code path that that will handle this extension missing apart from 
logging it, so the viewer crash in the lloctree portion of the code where this 
extension is used, specifically in the LLOcclusionCullingGroup. You will often 
see it accompanied with the EARLY-FAIL occlusion state (defined in 
llvieweroctree.h)

The viewers logs other missing extensions too, which we have fixed in Kokua. 
___
Policies and (un)subscribe information available here:
http://wiki.secondlife.com/wiki/OpenSource-Dev
Please read the policies before posting to keep unmoderated posting privileges


Re: [opensource-dev] Mac viewer and Apple maintained opensource libraries

2017-02-01 Thread Whirly Fizzle
As Cinder said, that crash appears to be caused by a problem with the Apple 
Nvidia drivers shipped with El Capitan & Sierra.

Switching over to using the Nvidia web drivers fixes the frequent crashing but 
some systems suffer poorer viewer performance with the Nvidia web drivers.


The LL bug report for this crash is https://jira.secondlife.com/browse/BUG-10302

Firestorm bug report: http://jira.phoenixviewer.com/browse/FIRE-16821

[FIRE-16821] [BUG-10302] [Mac El Capitan] Firestorm crash 
...
jira.phoenixviewer.com
Firestorm; FIRE-16821 [BUG-10302] [Mac El Capitan] Firestorm 
crash/incompatibility with Mac OS 10.11 Beta (15A234d), 15A282a - GM release & 
10.11.0 full release.





From: opensource-dev-boun...@lists.secondlife.com 
 on behalf of Oz Linden (Scott 
Lawrence) 
Sent: 01 February 2017 21:15
To: opensource-dev@lists.secondlife.com
Subject: Re: [opensource-dev] Mac viewer and Apple maintained opensource 
libraries

On 2017-02-01 15:24 , Geir Nøklebye wrote:

When will be see the crash in the occlusion code being fixed due to the fact 
that GL_ARB_occlusion_query2 is not available in the OpenGL Legacy Profile the 
renderer currently is forced to when the viewer is running on macOS 10.11 or 
higher?


If you've got a fix, we'd love to see it.

--
OZ LINDEN | Engineering Director, Second Life
email or hangouts: o...@lindenlab.com | Real Life: 
Scott Lawrence
LINDEN LAB | Create Virtual Experiences
___
Policies and (un)subscribe information available here:
http://wiki.secondlife.com/wiki/OpenSource-Dev
Please read the policies before posting to keep unmoderated posting privileges

Re: [opensource-dev] Mac viewer and Apple maintained opensource libraries

2017-02-01 Thread Oz Linden (Scott Lawrence)

On 2017-02-01 15:24 , Geir Nøklebye wrote:

When will be see the crash in the occlusion code being fixed due to the fact 
that GL_ARB_occlusion_query2 is not available in the OpenGL Legacy Profile the 
renderer currently is forced to when the viewer is running on macOS 10.11 or 
higher?

If you've got a fix, we'd love to see it.

--
OZ LINDEN | Engineering Director, Second Life
email or hangouts: o...@lindenlab.com  | Real 
Life: Scott Lawrence

LINDEN LAB | Create Virtual Experiences 
___
Policies and (un)subscribe information available here:
http://wiki.secondlife.com/wiki/OpenSource-Dev
Please read the policies before posting to keep unmoderated posting privileges

Re: [opensource-dev] Mac viewer and Apple maintained opensource libraries

2017-02-01 Thread Cinder Roxley
On February 1, 2017 at 2:24:56 PM, Geir Nøklebye (geir.nokle...@dayturn.com 
 ) wrote:

 
Cinder said

>For what it?s worth, Apple did warn developers to stop using it and switch to 
>Cocoa?s crypto frameworks or ship their own. 

…and that is the core of the state of the macOS version of the viewer(s). 
Deprecated code all over. 

Umm, the viewer does ship with its own OpenSSL which is exactly what Apple 
recommends.

When will be see the crash in the occlusion code being fixed due to the fact 
that GL_ARB_occlusion_query2 is not available in the OpenGL Legacy Profile the 
renderer currently is forced to when the viewer is running on macOS 10.11 or 
higher?

The viewer doesn’t ever call GL_ARB_occlusion_query2 on OSX.

Event: GPU Reset
Date/Time: Wed Feb 1 21:17:26 2017

Tailspin: /Library/Logs/DiagnosticReports/gpuRestart2017-02-01-211726.tailspin
GPUSubmission Trace ID: 0
OS Version: Mac OS X Version 10.12.3 (Build 16D32)
Graphics Hardware: NVIDIA GeForce GTX 660M


NVDA(Graphics): Channel exception! Exception type = 0x1f Access Violation Error 
(MMU Error 2)
Channel Info: [44, 0x14, 0x12, 0x136555]
Version Info: [com.apple.GeForce, 10.1.4, 0x7d780b0a, 18894120, 
355.10.05.15f03, 1]
MMU Error: FAULT_PTE at 0x5063c


This crash happens in Cool VL Viewer, Singularity, Alchemy, Firestorm, Kokua, 
SecondLife release and all dev versions including Second Life Project Alex Ivy
You probably never get it reported because the Google Breakpad reports don’t 
catch it. 

That has been reported and the crash reporter doesn’t catch it because it’s a 
driver crash not the viewer.

It’s not a viewer bug, it’s an issue with Apple’s Nvidia driver. (also note, 
that it doesn’t happen with Radeon or Nvidia’s own driver, just Apple’s and 
happens to hundreds upon hundreds of games available on Steam.)

-- 
Cinder Roxley
Sent with Airmail

___
Policies and (un)subscribe information available here:
http://wiki.secondlife.com/wiki/OpenSource-Dev
Please read the policies before posting to keep unmoderated posting privileges

Re: [opensource-dev] Mac viewer and Apple maintained opensource libraries

2017-02-01 Thread Dahlia Trimble
It's probably considered bad practice for code to use an ARB extension
without first checking to see if it's available.

On Wed, Feb 1, 2017 at 12:24 PM, Geir Nøklebye 
wrote:

> Cinder said
>
> >For what it?s worth, Apple did warn developers to stop using it and
> switch to Cocoa?s crypto frameworks or ship their own.
>
> …and that is the core of the state of the macOS version of the viewer(s).
> Deprecated code all over.
>
> When will be see the crash in the occlusion code being fixed due to the
> fact that GL_ARB_occlusion_query2 is not available in the OpenGL Legacy
> Profile the renderer currently is forced to when the viewer is running on
> macOS 10.11 or higher?
>
> Event:   GPU Reset
> Date/Time:   Wed Feb  1 21:17:26 2017
>
> Tailspin:/Library/Logs/DiagnosticReports/
> gpuRestart2017-02-01-211726.tailspin
> GPUSubmission Trace ID: 0
> OS Version:  Mac OS X Version 10.12.3 (Build 16D32)
> Graphics Hardware:   NVIDIA GeForce GTX 660M
>
>
> NVDA(Graphics): Channel exception! Exception type = 0x1f Access Violation
> Error (MMU Error 2)
> Channel Info: [44, 0x14, 0x12, 0x136555]
> Version Info: [com.apple.GeForce, 10.1.4, 0x7d780b0a, 18894120,
> 355.10.05.15f03, 1]
> MMU Error: FAULT_PTE at 0x5063c
>
>
> This crash happens in Cool VL Viewer, Singularity, Alchemy, Firestorm,
> Kokua, SecondLife release and all dev versions including Second Life
> Project Alex Ivy
> You probably never get it reported because the  Google Breakpad reports
> don’t catch it.
>
> ___
> Policies and (un)subscribe information available here:
> http://wiki.secondlife.com/wiki/OpenSource-Dev
> Please read the policies before posting to keep unmoderated posting
> privileges
>
___
Policies and (un)subscribe information available here:
http://wiki.secondlife.com/wiki/OpenSource-Dev
Please read the policies before posting to keep unmoderated posting privileges

Re: [opensource-dev] Mac viewer and Apple maintained opensource libraries

2017-02-01 Thread Geir Nøklebye
Cinder said

>For what it?s worth, Apple did warn developers to stop using it and switch to 
>Cocoa?s crypto frameworks or ship their own.  

…and that is the core of the state of the macOS version of the viewer(s). 
Deprecated code all over. 

When will be see the crash in the occlusion code being fixed due to the fact 
that GL_ARB_occlusion_query2 is not available in the OpenGL Legacy Profile the 
renderer currently is forced to when the viewer is running on macOS 10.11 or 
higher?

Event:   GPU Reset
Date/Time:   Wed Feb  1 21:17:26 2017

Tailspin:
/Library/Logs/DiagnosticReports/gpuRestart2017-02-01-211726.tailspin
GPUSubmission Trace ID: 0
OS Version:  Mac OS X Version 10.12.3 (Build 16D32)
Graphics Hardware:   NVIDIA GeForce GTX 660M


NVDA(Graphics): Channel exception! Exception type = 0x1f Access Violation Error 
(MMU Error 2)
Channel Info: [44, 0x14, 0x12, 0x136555]
Version Info: [com.apple.GeForce, 10.1.4, 0x7d780b0a, 18894120, 
355.10.05.15f03, 1]
MMU Error: FAULT_PTE at 0x5063c


This crash happens in Cool VL Viewer, Singularity, Alchemy, Firestorm, Kokua, 
SecondLife release and all dev versions including Second Life Project Alex Ivy
You probably never get it reported because the  Google Breakpad reports don’t 
catch it. 

___
Policies and (un)subscribe information available here:
http://wiki.secondlife.com/wiki/OpenSource-Dev
Please read the policies before posting to keep unmoderated posting privileges