简体   繁体   English

如何在 GPU 上为 Julia 运行 Jupyter Notebook?

[英]How to run Jupyter Notebook on GPU for Julia?

I'm working with quite a large dataset to plot some graphs with Julia on Jupyter notebook on my laptop.我正在使用相当大的数据集 plot 一些图表 Julia 在我的笔记本电脑上的 Jupyter 笔记本上。 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.所以,我想如果我在 GPU 上运行代码,它可能会减少滞后。 But I couldn't find any clear instructions on the net about set up Jupyter Notebook on GPU for running Julia.但是我在网上找不到任何关于在 GPU 上设置 Jupyter Notebook 以运行 Julia 的明确说明。 I'm working on Windows 10 and I have a dedicated GPU on my laptop with the following specifications:我正在研究 Windows 10,我的笔记本电脑上有一个专用的 GPU,规格如下:

***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?谁能帮我用 GPU 为 Julia 运行 Jupyter Notebook?

There are two separate issues here:这里有两个单独的问题:

  • rendering the plot with GPU用 GPU 渲染 plot
  • showing the plot in the web browser.在 web 浏览器中显示 plot。

Regarding the first issue there is GLMakie.jl that is using OpenGL (and hence can use GPU) for image rendering.关于第一个问题, GLMakie.jl使用 OpenGL(因此可以使用 GPU)进行图像渲染。 Another option is to use Julia's GPU libraries such as CuArrays and render the plot yourself using Array operations on GPU.另一种选择是使用 Julia 的 GPU 库(例如CuArrays并使用 GPU 上的数组操作自己渲染 plot。 There are many tutorial how to do it - they mostly use JuliaSet for illustration - eg https://nextjournal.com/sdanisch/julia-gpu-programming有很多教程如何做到这一点 - 他们主要使用 JuliaSet 进行说明 - 例如https://nextjournal.com/sdanisch/julia-gpu-programming

The second issue is actually showing the plot in Jupyter notebook.第二个问题实际上是在 Jupyter 笔记本中显示 plot。 Jupyter itself is a headless process and the actual visualization is happening in the web browser. Jupyter 本身是一个无头进程,实际可视化发生在 web 浏览器中。 Nvidia has "GPU affinity" setting that allows you to select which hardware is using by a particular application when plotting on screen. Nvidia 具有“GPU 亲和力”设置,允许您在屏幕上绘图时使用特定应用程序使用的硬件 select。 You can find the appropriate setting in NVidia Control Panel.您可以在 NVidia 控制面板中找到相应的设置。 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.但是,在大多数情况下,我不希望它提高您的性能,因为大部分工作是实际的图像渲染。

在此处输入图像描述

Hope this answers your question.希望这能回答你的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM