Black Lives Matter. Please consider donating to Campaign Zero's mission of ending police violence in America.
https://www.joincampaignzero.org

Can I choose which GPU is used to create the images?

The code I’m using is similar to the last cell in this notebook, except for the fig.show() part, and it’s looped:

https://chart-studio.plotly.com/~florin.andrei/3/import-requests-import-json-import-os-im/#/

So I run this sequence:

fig = px.choropleth_mapbox()
fig.update_layout()
fig.write_image(filename)

…hundreds of times in a loop, distributed over several worker processes (one for each CPU). All CPU cores are used, which is good. Nothing is displayed, everything goes direct to disk, I make a bunch of files, then I generate a video with ffmpeg.

My laptop is an Acer Predator Helios 300, which has two GPUs, Intel and NVidia. While the code is rendering the images, I see the Intel GPU being used; there’s zero load on the Nvidia GPU. I suspect the NVidia chip would go faster.

Looks like the orca processes use the GPU.

Is there a way in the code to force using a certain GPU if the system has more than one?

Quick hack - I’ve found orca.exe on my system and then used the NVIDIA Control Panel to force it to use the GeForce GPU.

It’s a little faster, but the main bottleneck is still the CPU.