Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Metal Editor

Discussion in '5.6 Beta' started by Mantas-Puida, Jan 11, 2017.

  1. Mantas-Puida

    Mantas-Puida

    Unity Technologies

    Joined:
    Nov 13, 2008
    Posts:
    1,857
    Maybe you already noticed that on latest macOS versions Unity 5.6 now supports running Unity Editor on Metal graphics API. It's currently enabled by default for newly created projects, but disabled for pre-existing projects.
    We would like to ask you to give it a chance and enable it in your projects, by navigating to Player Settings Rendering section and checking "Metal Editor Support" checkbox.

    This will make Unity Editor to follow your graphics API selection for iOS and macOS standalone targets and unlock fast shader iteration for targeting Metal API right in Editor. It's also recommended to keep "Metal API Validation" enabled, as it will give you early warnings about shader issues.

    Best experience should be expected with macOS Sierra, oldest supported version is 10.11.6.
    Feedback is very welcome!

    Thanks!
     
    MrEsquire and samnarain like this.
  2. samnarain

    samnarain

    Joined:
    Jul 6, 2015
    Posts:
    99
    I've actually used the forced method by terminal. I am very happy with performance boost. There are some minor warnings from Editor extensions that are only logged in console that do not appear in regular mode. Currently on El Capitan.
     
  3. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,423
    I posted about my experience with this using Sierra, a GTX970 and the latest nvidia web drivers a while ago on one of the other metal threads. I will repost that message below because althought he compute side is working great for me, it did leave me with some editor issues......

    Ah I'm having so much fun with this - I've always sung the praises of Unity for planning to make compute shaders work well beyond their HLSL DX11 origins and now its arrived for metal they have not disappointed - excellent work!

    So far I got Fluidity (from the asset store) working with just some minimal changes to non-compute shaders (change pragma target 5.0 to 4.5). And a similar fluid simulation that scrawk posted to his now sadly defunct blog some years ago. And my modified version of his work that uses 3d textures instead of compute buffers. And the worlds most basic compute-shader based particle system which I wrote myself. And a version of the particles that uses the fluid sim to control their velocity. And a version that renders meshes instead of points using DrawMeshInstancedIndirect (based on example code in the 5.6b manual). Great stuff!

    The editor is very stable for me in metal mode now I've upgraded to Sierra, although so far two things seem fairly consistently broken for me in the editor in this mode - the color picker is broken and only shows grey, and various things (eg materials, lights, ambient light settings) that make use of it seem to default to using a rather red colour. And I have no text cursor when I click on, for example, inspector value boxes to change them. Thats with the latest Sierra & Nvidia Webdriver with a GTX 970 as per my previous posts.
     
  4. Mantas-Puida

    Mantas-Puida

    Unity Technologies

    Joined:
    Nov 13, 2008
    Posts:
    1,857
    Nice to hear that you see performance improvements. Thanks!
     
  5. Mantas-Puida

    Mantas-Puida

    Unity Technologies

    Joined:
    Nov 13, 2008
    Posts:
    1,857
    Thank you for feedback, could you please bugreport your editor issues?
    P.S. what is your full hw setup? GTX 970 sounds quite unusual..
     
  6. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,423
    The older design of Mac Pro - there are quite a lot of graphics cards that can be added to these classic tower Mac Pro's. Nvidia do a driver that works up to 9 series cards, and so I was able to put a GTX970 in my Mac Pro Early 2008 (Mac Pro 3,1).

    Unfortunately the last couple of Unity 5.6 betas didnt work very well in metal mode with this setup on El Capitan, and my version of the Mac Pro doesnt support Sierra. I had to borrow a later Mac Pro (model 5,1 I think) to try it with Sierra and thats where I got the much better results with Unity, but with the bugs I mentioned above. And I just had to give that Mac Pro back. But I may have found a workaround that will allow me to use Sierra on my older Mac Pro, so I will try that when I can and then hopefully be able to file a bug report.

    I understand that this is hardly the most common sort of Mac setup out there, and I dont expect it to be a testing priority. However I recommend that you perhaps at some point try the Unity metal stuff on some kind of mac that can run the web version of nvidias driver, because those drivers are probably not only used on setups as obscure as mine. You can probably run it on Macs with more common nvidia GPU's but I have no experience of that and the nvidia driver site doesnt accurately list all the different cards that really work with these drivers. Anyway, here is a site which lists all versions of nvidia macOS drivers that are available (they are hard to search for on nvidias own site) - I was using the very latest one at the bottom of the page, 367.15.10.25f02 for macOS 10.12.2.

    http://www.macvidcards.com/drivers.html
     
  7. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,238
    I've just upgraded to 12.2.2 from an older version, so I was able to try out Metal support. In my initial tests, most things work nicely, however I do get some shader warnings for legacy shaders and light intensity doesn't work the same in this case (it has to be turned down or else things are overbrightened a lot).

    Not sure if it's meant to be 100% compatible with older shaders or not.

    --Eric
     
  8. Gametyme

    Gametyme

    Joined:
    May 7, 2014
    Posts:
    565
    Working good for me as well, after upgrading to 12.2.2.
     
  9. Mantas-Puida

    Mantas-Puida

    Unity Technologies

    Joined:
    Nov 13, 2008
    Posts:
    1,857
    Thank you for the details! It's something we want to keep on our radar. Unfortunately we can't improve support for El Capitan much, because Apple is not shipping updates for prior macOS versions. That's why we recommend to use Sierra for desktop Metal use cases.
     
  10. Mantas-Puida

    Mantas-Puida

    Unity Technologies

    Joined:
    Nov 13, 2008
    Posts:
    1,857
    Thanks for giving it a chance. Could you please report both issues as two separate bugs?
     
  11. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,238
    It turns out that if I import the prefabs with the appropriate shaders etc. into a new project, the issues go away. So I'm not sure it's really worth bothering with a bug report after all...everything's working well now, nice work!

    --Eric
     
  12. samnarain

    samnarain

    Joined:
    Jul 6, 2015
    Posts:
    99
    I noticed some artifacts in Scene View using the metal option (which are not in Game View), especially with shaders using cubemaps. They sometimes appear, and sometimes not. I think that shaders imported from 5.5.0b3 might be the reason.
     
  13. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    2,727
    Running Sierra on a MBP 2012 (650m gpu):
    play and animation playback give higher FPS but more uneven framerate
    interaction is laggy, especially from idle to orbit #874112
    profiler and/or animation window shows pieces of curves in the GUI below #874109
     
  14. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,423
    No problem. I quite understand the lack of El Capitan support, and will attempt to get myself a permanent setup I can use with Sierra at some point.

    I've not been able to borrow the Mac Pro that I can run Sierra on again yet, but I was able to get access to it for 10 minutes and have been able to further narrow down the circumstances where there is no text cursor in input boxes and where the colorpicker is completely broken in the editor when in Metal mode with a GTX970 using nvidia web drivers. It only does it when Color Space is set to Linear. If I switch to gamma the colorpicker works properly and the cursor is visible.

    The above was determined using latest Sierra 10.12.3, updated nvidia driver for that version of Sierra, and latest Unity beta that came out today (5.6.0b5).
     
  15. _Luthien_

    _Luthien_

    Joined:
    Apr 24, 2015
    Posts:
    49
    Hi,

    I am hoping to get TerrainComposer2 to work on the mac. That asset uses GPU computing in the editor, and has so far only worked on Windows. The developer (Nathaniel) was first aiming to implement a software workaround to use on the mac, but of course the Unity editor supporting metal was a much better option.

    Unfortunately I haven't had any success so far, but it might be that I am overlooking something.
    What I've been trying with the various beta versions (b3 - b6) so far is simply create a new project with only the TC2 asset included; then add the required TC2 stamp package and switch the player to use the Metal Editor support. Then I create a terrain which shows up OK.
    The problem is, however, that the TC2 window that is supposed to contain the asset's UI remains completely black, apart from three menu options File - Options - Help

    View attachment 216255

    The File menu allows loading in a demo scene from the stamp package, of which a few seem to work (though the TC2 window remains black), but a few others cause the Editor to become unstable: all the windows start to flicker and the only remedy is to restart the editor.

    I can't say if this is caused by the TC2 plugin's gpu code somehow not playing fair with whatever has been implemented in Unity Beta for metal support until now, or that it is simply a Unity beta issue alone.

    Nathaniel has offered to help out trying to get it to work on my mac, but so far he doesn't seem to have had the time to do so. I wonder if anyone else might have an idea what else I could try and look into?
    If I can help by supplying log files or crash reports let me know.

    Specs: 2012 macbook pro, 2.3 Ghz i7, 16Gb
    Graphics: NVIDIA GeForce GT 650M 1024 MB
    Mac os Sierra 10.12.2

    Latest test with Unity 5.6.b6, Terraincomposer2 (v2.21)
     
  16. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Are you using OSX or Nvidia Drivers?
     
    _Luthien_ likes this.
  17. Bradamante

    Bradamante

    Joined:
    Sep 27, 2012
    Posts:
    300
    Some people (including me) are running "Hackintoshes" aka "CustoMacs". One benefit is that you can run native installations of Windows and OS X, which is why I often see software developers running these kind of setups. Part lists like this are often an entry point for people. I also often see digital video types around websites like this.

    OS X supports some NVidia graphics cards natively, so you don't even need a custom driver. That includes a lot of cards from the GTX 600 and 700 series. For the 900 series people use NVidias web drivers, for the 1000 series there are no drivers yet, last time I checked. With ATI cards the situation is a bit more hacky.

    I am aware of course that non-official setups like this are troublesome to support for Unity. It's a niche of a niche. If you look at lists like this however, there is a vibrant community out there for this stuff. Personally, my machine at home is a slightly outdated CustoMac with a GTX 760 and El Capitan - I never had any problems using Unity that would stem from my exotic hardware setup. Can't comment on 5.6b though.
     
    Last edited: Feb 15, 2017
  18. GeekCats

    GeekCats

    Joined:
    Jul 31, 2014
    Posts:
    58
    Hi,

    Unfortunately it did not work on my MacBook Pro. It follows the screen of how the editor is.
    Screen Shot 2017-02-15 at 9.32.42 PM.png Screen Shot 2017-02-15 at 9.39.50 PM.png
     
  19. _Luthien_

    _Luthien_

    Joined:
    Apr 24, 2015
    Posts:
    49
    Hi MrEsquire,
    The driver seems to be supplied by the system (mac os sierra 10.12.2), as Bradamante also says. There don't seem to be any other ones available.
    However, there is a separate CUDA driver that regularly receives an update. It is now at 8.0.63.

    Last week I did some tests together with the TC2 developer. This gave some interesting results: the reason that TC2 window is nearly completely black is because the window coordinates are calculated differently in Mac OS. By changing the offset of those drawing coordinates we were able to make the contents visible again, though for it to work well: adapt to changes in the window size, etcetera, he'll need to make some changes to the plugin.

    Apart from that coordination issue there is also the problem that after a while, the window contents start to flicker erratically and the editor becomes unresponsive. Restarting the editor fixes this, though temporarily.
    Last week's test was with the beta8, that still had that freezing issue.

    I'll try again tonight with the updated CUDA driver and beta9.



    PS - I found this drawing coordinates issue also interesting because I've been having problems with another terrain plugin (Erosion Brush) that look like they stem from a drawing coordinates issue as well: though there the problem is that the mouse pointer is not aligned with the position of the brush in the editor window. When the mouse is in the bottom right corner, the brush behaves as if it is in the center of the window.
     
  20. GeekCats

    GeekCats

    Joined:
    Jul 31, 2014
    Posts:
    58
    With 5.6.0 Beta 9, the editor works better! A little faster, BUT in some scenes, it's frozen! Not only the Unity, but macOS!!!
     
  21. aetfi

    aetfi

    Unity Technologies

    Joined:
    Jun 5, 2014
    Posts:
    43
    In beta 10, there will be some CopyTexture, Nvidia and generic buffer/ComputeBuffer handling related improvements for Metal Editor. There's one larger buffer handling change in the works yet, but it'll arrive sometime after beta 10.

    Usually if the UI hangs for any reason, it should be still possible to SSH remotely to the machine, in this case please check if any of the following things reveal possible issues. Or file a bugreport with a repro test project, with details about OS version/drivers used. :)

    remote login via SSH:
    sudo dmesg (shows kernel messages, it might be flooding some errors repeatedly and the original cause is already lost)
    ~/Library/Logs/Unity/Editor.log messages, shader errors, etc
     
    GeekCats and elbows like this.
  22. GeekCats

    GeekCats

    Joined:
    Jul 31, 2014
    Posts:
    58
    Beta 10. Metal editor still with problem. How can I help? Can I send a log or some other else?

    metalB10.jpg
     
  23. aetfi

    aetfi

    Unity Technologies

    Joined:
    Jun 5, 2014
    Posts:
    43
    It's hard to say without a filed bug report that has a sample project to repro against, but..

    It's been known that AMD GPU drivers after 10.12.1 macOS release have several chances
    for showing artifacts on Metal Editor, some related to Scene view, some on Game view.

    I think most of them are fixed in macOS 10.12.4 public beta 2 or later

    EDIT:
    Forgot to mention that Intel has had it's own share of bugs, most of them should be fixed in 10.12.4 public betas but we're aware of few things with Intel side that haven't been fixed yet, but sample projects to repro issues will definitely help in the future too, thanks!
     
    Last edited: Mar 10, 2017
    MrEsquire likes this.
unityunity