How to run Jupyter Notebook on GPU for Julia?

Viewed 206

I'm working with quite a large dataset to plot some graphs with Julia on Jupyter notebook on my laptop. But while plotting it's taking too much time to load and my laptop starts lagging. So, I thought if I run the code on GPU it might lessen the lagging. But I couldn't find any clear instructions on the net about set up Jupyter Notebook on GPU for running Julia. I'm working on Windows 10 and I have a dedicated GPU on my laptop with the following specifications:

***NVIDIA GeForce 940MX
Driver version: 27.21.14.5241
Driver date:    9/23/2020
DirectX version:    12 (FL 11.0)
Physical location:  PCI bus 1, device 0, function 0
Utilization 0%
Dedicated GPU memory    0.0/4.0 GB
Shared GPU memory   0.0/3.9 GB
GPU Memory  0.0/7.9 GB***

Can anyone please help me to run Jupyter Notebook with GPU for Julia?

1 Answers

There are two separate issues here:

  • rendering the plot with GPU
  • showing the plot in the web browser.

Regarding the first issue there is GLMakie.jl that is using OpenGL (and hence can use GPU) for image rendering. Another option is to use Julia's GPU libraries such as CuArrays and render the plot yourself using Array operations on GPU. There are many tutorial how to do it - they mostly use JuliaSet for illustration - e.g. https://nextjournal.com/sdanisch/julia-gpu-programming

The second issue is actually showing the plot in Jupyter notebook. Jupyter itself is a headless process and the actual visualization is happening in the web browser. Nvidia has "GPU affinity" setting that allows you to select which hardware is using by a particular application when plotting on screen. You can find the appropriate setting in NVidia Control Panel. See the picture below. However, for most cases I do not expect it to increase your performance because most of the job is an actual image rendering.

enter image description here

Hope this answers your question.

Related