Is running Rhino+Grasshopper on cloud supported?

Hi all.

Currently we have a machine active 24/7 to process data from a web service.
There are multiple instances of Rhino+Grasshopper open all the time.
When the webserver send a new job, it is processed in some seconds and a data packet is sent back to the webserver.

We need to transfer this whole machine workload on the cloud, for stability, management, backup and other reasons.
In the case of virtual machine with dedicated hardware, the OS should have exclusive access of the whole GPU. (not a generic VM where the GPU is a tiny fraction, shared with other users)

Is this supported?

From Rhino - System Requirements I see:

  • Rhino needs a OpenGL-capable GPU
  • Windows 10/11 is supported but any version of Windows Server is not supported

How to proceed?
How to run Rhino+Grasshopper 24/7 on a cloud server, in a way that is “supported” by McNeel? (aka in a normal and expected environment)

That would require core hr billing (compute)

I didn’t know those details, thanks!

For a single machine with 8 core/thread and running 24/7 it’s already 19.2$/day. 7k/year.

We’d like to start Rhino+Grasshopper only when needed, but the opening/loading time of Rhino+Grasshopper and the .gh definition is more than the execution of the code itself, which is averagely some seconds.

Probably the actual execution time for us is about half an hour every day, but fragmented in many small tasks during the day.

There are any way to solve this problem?
There is a way to “pause” the time counter but keep everything loaded, ready to execute?

My understanding is that it will idle until needed. @andyopayne is the primary contact for Compute if you can’t find what you need in the docs.

Ok, nice!

I’m totally new with Rhino Compute.

Currently our code is “just” 7 .gh scripts, which use no plugins but countless c# components.
From the opening of the .gh file to Rhino+Grasshopper fully loaded i’ts about 10 seconds, but often the processing time is just a second or two.
We can’t afford to waste time, as this is a live webservice.
Currently the whole process is slowed down only by the data transfer to the physical machine, but then Grasshopper is already running so there is no additional loading time.

From the documentation I read I should structure the definition as it’s being used by Hops, is this correct?
I’m using c# components to also capture bitmaps from the viewport and then write .png and .txt files on the SSD… is this possible inside Hops or Rhino Compute?
Can Rhino Compute pre-load a Grasshopper definition, to start and oncoming task without delay?
Does this matter for the actual computation time billed?

@andyopayne @AndyPayne

Hi Riccardo. You have a lot of questions. Let me see if I can answer them, but if I miss some, please let me know. First, you mention that you want the solution computation time to be fast, but that billing is also an issue and you want the service to shut down when not needed. Those two things are a bit in opposition to one another. Let me see if I can explain how the Rhino.Compute startup/shut down process works.

Rhino.Compute has two different processes (ie. executable files). The top layer is called Rhino.Compute.exe and this is a simple process that primarily stays up all the time listening for incoming HTTP requests. Note, you are not billed (by McNeel) when the Rhino.Compute.exe is running. If it receives one, it handles authentication via an API key. If the request is valid, then it handles spinning up one or more child processes called Compute.Geometry.exe. When the Compute.Geometry.exe processes start, that’s when you start getting billed by us using the core-hour billing formula. The startup time can take a bit of time because it’s having to launch Rhino and Grasshopper and load any other plugins you might have… plus you might be starting 2, 3, or 4 of these instances so it can take a bit of time to start up. But once these child processes are running, each time a request is received, it’s passed along to the child to process and the solution is started. There’s no way to “preload” a GH definition, but whenever you send a new GH definition via Hops to Rhino.Compute, that definition is stored in memory and an ID is sent back to Hops as part of the response. Then when you send different values from Hops for a different solution, then it just has to pass along the ID for the original definition (instead of the actual definition each time) and then Rhino.Compute will just go and find that definition and load the values and perform the solve.

Now, let’s say you’re done using the Rhino.Compute service. If it’s been 1 hour (the default), the child processes will send a request back to the parent layer to see how much time has elapsed since it last received a valid request. It sends back a time span value and if that is longer than the idle span time that’s been registered with the child process, then it will handle shutting itself down. Now the default idle span value is 1 hour, but you can configure that to be whatever you want. It could be 2 minutes (if you really wanted to shut things down right after each request), or you could set it to be something extremely long if you wanted to keep the service running indefinitely. Now, there are a couple of things to keep in mind. Each time you shut the child process down, you’re going to lose the “cache” that has been built up by Rhino.Compute. That includes the cache that stores all of the results. You see, Rhino.Compute stores the input values and the results on each solution. If it detects the same inputs that it has already solved, then it will just return the solution for that and bypass performing the full computation. This potentially can save you a lot of time… and you could even script this setup ahead of time if you wanted all of the permutations to be pre-computed. Then, when a user asks for a given input state, the response time should be very fast. However, if you shut down the child processes, then that cache gets erased. The second thing to consider is the startup time when you want to solve a solution the next time. As I stated above, the startup time can take some time because it’s starting up Rhino and GH in the background. So, while setting a short idle span value might save you some core-hour billing time, you might incur some time delays when the next user sends a request and has to wait for the child processes to get spun back up.

As for your question about writing out bitmaps… You have to remember that in Rhino.Compute there is no document or viewport. You can tell it to instantiate a new Rhino document each time a request is received, but there’s no really viewport (it’s a headless document). So, right now, taking screenshots of a viewport is not possible. You could potentially try to script a rendering to start and write the bitmap to a byte array and send that back to your front end… but I haven’t really tested that and it would take some decent scripting chops to pull off. As for your GPU requirement, I think that would be up to you and whatever VM service you contracted with. I don’t think Rhino.Compute has any sort of GPU requirement, so I don’t think there would be anything from our end that would effect that.

Lastly, my recommendation would be to start small and local. What I mean is, start by testing out Hops. When you install Hops, a new instance of Rhino.Compute will get started automatically each time you start Grasshopper. You can build out your workflow by testing Hops locally and there’s no costs when you testing things locally. Once you have your workflow tested and working locally, then you could setup a VM and point Hops to send your definitions to the VM instead of your local instance. That’s just my suggestions.

Here are some links to help you get more familiar:

I will test Hops for this, surely!


That’s a crucial feature for us. Damn!

I guess even Hops alone won’t be able to take screenshots? I’ll test this.
(Indeed, currently I wait for grasshopper preview to show in current Rhino viewport and then capture the bitmap…)


It never happens, data is .stl from 3d scan data, each and every is different everytime.


Currently my 7 .gh definition load and write .stl , .png and .txt on the SSD, and call each-other in a sequence/order that is not fixed.
Having all the code in a single .gh is impossible for me, un-maintenable, too complex.
The total workflow will use about 8-9 executions of either of the .gh scripts on average, but the total execution time is under 10 seconds, rarely more. If every .gh require a full loading of Rhino and Grasshopper we should change the website from “live results” to “we will send a mail when computed” … :see_no_evil_monkey:


Thank you for the exhaustive answer!
I’m not sure Rhino Compute is fitted for what we need in this moment, but I’ll save this post ready for future projects!


Back to my main question: if the “virtual machine” have a dedicated GPU, and it’s running on Windows 11, is that a supported environment for a normal Rhino 8 execution?

Per the system requirements its not a supported env. Can it be done? I believe so, but not something we’ve tested/support.

You should definitely not try to put everything into a single GH definition. In fact, the more you break it up the better as it will help you in troubleshooting. You can call Hops components inside other Hops definitions so you can nest functionality as needed. You can have one main definition that has the 8 or 9 executions and each one of those points to a separate Hops definition (if that makes sense).

Also, you don’t need to have Rhino startup each time it gets a request. This would only happen if you made it shut down the child after a short idlespan. If you told the child to stay “up” then the only wait time would be whatever time it takes to do the actual solve plus the transit time to send the data back to your front end. You would have to wait on the very first request that it received, to startup the children… but you could script that to start whenever someone logged onto your site, but before they actually made their first official request… or if you new someone was going to need the service at 9:00AM every morning, you could send a request at 8:55AM just to wake up the children and make sure they’re running whenever the first request happened. If you send a request to the /activechildren endpoint, this will tell the parent layer to startup all of the children so that’s an easy way to start them up when needed.

Ok.
If it’s not directly “supported” from McNeel, do you know VM services where users experienced proper/valid Rhino behavior?
Talking GPU-wise, we don’t need great performance, just correct display on viewport to then take the screenshot…

I see:

  • Microsoft Azure, give dedicated GPU with Windows 11.
  • Windows 365 instead give “GPU tiers” , which maybe have problems (?)
  • V2 Cloud have “GPU acceleration” …
  • etc …

Do you know if any is valid enough for a “normal” Rhino experience?


Ok.
But is that a different context from what you said before?
I need to take screenshots of the viewports.

Also, customers might login in the platform and load some file half an hour later, then idle for 40 minutes and load some more… and the service is online for very wide timezones (US/EU), we can’t pin-point accurately a time where on or off the “parent” process…

That is correct. We currently don’t support any sort of view capture when running headless. Our display architecture will need a bit of a rewrite to be able to initialize things like OpenGL or Direct3D for a completely windowless application.

We are hoping to be able to better support virtualized environments in the future as we are transitioning to Direct3D for the low level display. OpenGL has always been a bit of a problem child in these types of setups.