Running Maya Linux in Optimus Laptops

Autodesk Maya runs in Linux systems as a charm, fast and stable, you may have experiment it if working in some of the large studios which uses Maya Linux extensively, so let’s say you are used to Linux and decide to install Maya at home but if your computer has an NVidia Optimus GPU, and all modern laptops has this kind of card, you are going to get in troubles because NVidia hasn’t released a proper driver for Optimus GPUs in Linux and it seems they haven’t plans to release it, so what to do?

What is an Optimus GPU?

Optimus cards are actually a dual GPU, one card( INTEL) is welded in the motherboard and connect directly to the screen, this card is very limited, just able for 2D drawing and basic 3D features, not valid for using Maya,  specially it can´t support Viewport 2.0,  then there is another card( NVIDIA), a more powerful GPU which handles all the heavy 3D stuff, it is supposed this card auto activates when the system detect the application you are using needs demanding 3D features. The idea of a dual GPU is nice, because you save battery power by using only the basic card when running 2D applications or system menus and heavy 3D features are enabled by applications or games which needs it saving your battery and besides keeping the laptop temperature lower, all of this happens in Windows system but not in Linux because the lack of a proper driver by NVidia.

optmusPipeline

Making it work

There are two different strategies for making Optimus work in Linux, the simplest one is deactivating the INTEL card in BIOS so the system is forced to use the NVIDIA card always at the expense of your battery power, sadly only a few hi-end laptops allows to setup this feature in BIOS.

The other way is using a software bridge between both cards, at the beginning there was only BumbleBee, an independent software project which uses VirtualGL or Primus to communicate both GPUs,  there is a performance penalty when using these libraries and besides it doesn’t work with all applications, sadly Maya is one of them, in our tests using BunbleBee Maya launches with Viewport 2.0 but it crash by simple interactions with the keyboard, so no way.

Luckily in the middle 2016 NVidia itself fixed partially its Linux drivers to can do the switch between both cards in a fast way by using what is called NVIDIA-PRIME capabilities, this mechanism has a few limitations and needs an special configuration of your system to work which sadly it isn’t explained clearly in NVidia docs.

Installing NVIDIA-PRIME

We have been able to install NVIDIA-PRIME in an Optimus laptop with CentOS7 following this excellent guide by Ezequiel Mastrasso,

guide to install NVIDIA-PRIME in Centos 7

Some comments about our own experience with installation if this can help to someone:

In step 2 of the guide Ezequiel says a Xorg with ABI 24 is needed but according to NVidia ABI 23 is supported and actually our system is using elrepo kernel 4.19 which features Xorg ABI 23.

In step 18 of the guide our system turned black screen, but rebooting and skipping directly to step 19 did the trick, the rest of the guide worked perfectly for us.

Actually our system is a dual boot Windows 10 /Centos 7, this didn’t affect in anything the installation of NVidia-PRIME.

Finally before starting the Optimus setup we recommend to install and run nvidia-detect by elrepo, this little utility will shows up the exact NVidia driver your system needs and also check compatibility with your current Xorg server and displays its ABI number.

In our tests using this setup Maya Viewport 2.0 works perfect and Unigine benchmark seems not having any noticeable performance loss by using NVidia-PRIME .

Nevertheless, as Ezequiel mention this configuration is pretty sensitive to system changes, for example in our case NVidia-PRIME mechanism got broken just by installing the mesa-lib-GLU library, but luckily reinstalling the Nvidia driver again fixed it instantly, anyway it is a good idea to make a system backup when you manage to get it working just in case.

Hope this article helps you to enjoy Maya linux and of course Pulldownit plugin in your brand new Optimus laptop!

mayaRunningwithOptimus

 

 

Advertisements

Alembic Caching of PDI scenes in Maya

Alembic caching is a popular format to exchange animated assets between applications,  indeed Alembic is supported by most 3D platforms today.

Besides Alembic is an efficient method  to extract  raw animation data from meshes so by  caching the object you get rid of any computation applied to the mesh in this way complex scenes and animations can be exported as an Alembic file, and then re-imported into Maya to improve playback performance.

Pulldownit supports Alembic caching in Maya and 3ds Max, in the tutorial below Esteban Cuesta shows us how to cache a PDI simulation with Alembic in the way  we store one single mesh per fracture object.

Important to mention Alembic doesn’t save shaders applied to the mesh, but only a reference to them so to can see  the materials applied to the mesh  they must be present in the scene before loading the alembic file.

go to Alembic Caching in Maya docs

 

Tips & Tricks: Damaging without collapsing

When doing a destruction shot many times you want large structures like buildings to be destroyed partially while standing or you may want a dynamics object to be damaged only in the impact areas while maintaining its overall shape and trajectory. Let’s review the different options you count in Pulldownit plugin to break objects in localized areas only.

First you have to generate more density of fragments in the areas more likely to break using local shatter style, this will increase the quality of the destruction, after that create a fracture body for the object, there are two different cases:

Case of a static object, like a wall or building; after creating a fracture body for the object:

  • Set the fracture body as Static.
  • Set Activation->Breaks upon Impact.

Play the simulation, if there are still fragments which moves and you want them to stand,

  • In Advanced fractures set the fragments you don’t want to move to static.

Play the simulation modifying Hardness value until you get the level of damage you want.

wallBrokenV3Text

 

Case of a moving object, like a flying stone, airplane or whatever object is moving through the scene and eventually collides and breaks; after creating a fracture body for the object:

  • Set Clusterize parameter to 0.0
  • Change to Local Propagation scheme.
  • Set Hardness to 10.0

Play the simulation modifying Hardness value until you get the level of damage you want.

stoneBroken

Export PDI dynamics from Maya to UE4

In this excellent tutorial Esteban Cuesta shows us how to destroy a pile of tubes using Pulldownit in Maya and then export it to Unreal Engine 4, but not only this, he also teaches us how to trigger the destruction in UE4 when a bullet hits the model during the game. Exporting broken models and dynamics to UE4 works with either Pro version and free version of Pulldownit, just follow the tutorial to learn how to add quality destruction effects into your game.

 

thank you Esteban for the amazing tutorial

 

Tips & Tricks: Using Hidden Objects As Barriers

When planning to destroy large buildings or structures you usually want some parts to stand, however other objects may eventually collide with them, that’s why those parts should be set as static bodies in dynamics, sadly if these static parts have complex shapes,  that will increase significantly the computation time despite they doesn’t move. For example in the image bellow we want to destroy only the main tower on the right but when falling it will surely collide with the rest of the castle so we must set the whole thing in dynamics.

castilloinit

A way to speed up the simulation in cases like this is using simple objects as barriers, so flying fragments cannot pass through them. The idea is those barriers separate the real geometry from the fragments, you can use simple shapes as boxes or cylinders to enclose the area where fragments can move, taking care they approximate the shape behind in case the real geometry is very close to the barrier. In our example we can surround all standing parts with simple boxes and some cylinders,

castillobarriers

Modifying  the barriers shape if necessary to approximate correctly the geometry behind, the important thing is keeping always the low poly count. It doesn’t mind if the barriers interpenetrate each other as they are static objects.

At this point you have just to set the barriers as static bodies , you can even hide them from the viewport and PDi will take them in account for collisions anyway. After the barriers are hidden the result can be better than using the real geometry as you are avoiding its complexity and for sure you will save important computation time. See the image at the bottom once the barriers are hidden for our example.

castillobarriersdynamics

castillodynamics

 

Tips & Tricks: Setting Initial States for rigid bodies

When working with groups of objects many times you would like the objects appearing in scene scattered over the ground here and there or starting at random positions, this is done very easily wiht Pulldownit by setting initial states for rigid bodies. This is the procedure:

logsArrayV2

Lets say you start with a grid of objects you have created by cloning a single one using the duplicate tool of your 3D Platform.

Now you have to select all of them and create a dynamic rigid body for each object and then open the Dynamics properties window and set an initial velocity of (4,4,4) also set random values of (200,200,200), make the same for the initial angular velocities if you want random orientations aswell.

initialVelocityWindow

Now set your time range to about 10 frames  and play the simulation, you can also disable gravity if you prefer.

logsArrayRandomV2

Ok, perfect, at the last frame all the objects has modified  quite a few  its initial position and orientation, now we have just to set this configuration as the initial state for the rigid bodies, for doing this, you have to bake keys for the simulation if you havent done it yet and after that click on Delete All Pdi bodies in the Manage Pdi World Window.

Now select all objects and move the slider to the last frame of the simulation, follow by deleting all keys for the objects, and you are done.

From here you can start a new simulation to drop the objects and scatter them over the ground, for this just set a dynamic rigid body for each object as before, open Pdi Simulation Options and enable Use Grid as Ground , make sure gravity is enabled this time, now set the extend of the simulation to 200 frames or so and launch it.

logsScatteredV2

Nice, at frame 200 you get your objects stacked in a natural way, now you can set this configuration again as the intitial state of rigid bodies as we did before.