VMware 上的 cuda 程序

发布于 2024-08-21 15:53:23 字数 152 浏览 7 评论 0原文

我写了一个cuda程序,我正在ubuntu上作为虚拟机测试它。原因是我有Windows 7,我不想安装ubuntu作为辅助操作系统,并且我需要使用linux操作系统进行测试。 我的问题是:虚拟机会限制GPU资源吗?那么,如果我在主操作系统下运行我的 cuda 代码会比在虚拟机上运行更快吗?

i wrote a cuda program and i am testing it on ubuntu as a virtual machine. the reason for this is i have windows 7, i don't want to install ubuntu as a secondary operating system, and i need to use a linux operating system for testing.
my question is: will the virtual machine limit the gpu resources? So will my cuda code be faster if i run it under my primary operating system than running it on a virtual machine?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

烟沫凡尘 2024-08-28 15:53:23

我曾经面临过类似的任务。我最终做的是在启用持久模式的 8GB 拇指驱动器上安装 Ubuntu。

这给了我 4GB 来安装 CUDA 和我需要的其他一切。

拥有一个可启动的 USB 记忆棒会非常有用。我建议阅读

另外,如果您正在寻找,此链接有一些非常有趣的材料对于其他发行版。

I faced a similar task once. What I ended up doing was installing Ubuntu on a 8GB thumb drive with persistent mode enabled.

That gave me 4GB to install CUDA and everything else I needed.

Having a bootable USB stick around can be very useful. I recommend reading this.

Also, this link has some very interesting material if you're looking for other distros.

情何以堪。 2024-08-28 15:53:23

不幸的是,虚拟机模拟图形设备,因此您无法访问真实的 GPU。这是因为虚拟化处理访问同一设备的多个虚拟机的方式 - 它提供了一个中间层来共享真实设备。

可以真正访问硬件,但前提是您拥有正确的软件和硬件组合,请参阅 SLI 多操作系统网站 了解详细信息。

因此,您可能对虚拟化路线不走运 - 如果您确实无法在 Windows 中运行您的应用程序,那么您将受到以下限制:

  1. 不现实:安装 Linux
  2. 不现实:同时安装 Linux(不是一个选项)
  3. 启动进入Live CD,您可以使用 CUDA 准备一个磁盘映像,并在每次
  4. 安装该映像时安装(或请求/借用)一个单独的 Linux 盒子并远程访问它

Unfortunately the virtual machine simulates a graphics device and as such you won't have access to the real GPU. This is because of the way the virtualisation handles multiple VMs accessing the same device - it provides a layer in between to share the real device.

It is possible to get true access to the hardware, but only if you have the right combination of software and hardware, see the SLI Multi-OS site for details.

So you're probably out of luck with the virtualisation route - if you really can't run your app in Windows then you're limited to the following:

  1. Unrealistic: Install Linux instead
  2. Unrealistic: Install Linux alongside (not an option)
  3. Boot into a live CD, you could prepare a disk image with CUDA and mount the image each time
  4. Setup (or beg/borrow) a separate box with Linux and access it remotely
酒与心事 2024-08-28 15:53:23

我刚刚在 NVIDIA 的 GPU 技术会议上听到一位名叫 Xiaohui Cui(橡树岭国家实验室)的研究员的演讲。除此之外,他还描述了使用 gVirtuS 来从虚拟机访问 GPU。他没有创建 gVirtuS,但将其描述为开源“虚拟 cuda”驱动程序。请参阅以下链接:
http://osl.uniparthenope.it/projects/gvirtus/

我没有尝试过 gVirtuS,但听起来它可能会做你想做的事。

I just heard a talk at NVIDIA's GPU technology conference by a researcher named Xiaohui Cui (Oak Ridge National Laboratory). Among other things, he described accessing GPUs from Virtual machines using something called gVirtuS. He did not create gVirtuS, but described it as an opensource "virtual cuda" driver. See following link:
http://osl.uniparthenope.it/projects/gvirtus/

I have not tried gVirtuS, but sounds like it might do what you want.

七月上 2024-08-28 15:53:23

从 CUDA 3.1 开始,它的虚拟化功能并不生动,因此唯一可用的方法是直接在目标 HW+SW 上运行 CUDA 程序

As of CUDA 3.1 it's virtualization capabilities are not vivid, so the only usable approach is to run CUDA programs directly on the target HW+SW

梦过后 2024-08-28 15:53:23

使用 rCUDA 将虚拟 GPU 添加到您的 VM。

Use rCUDA to add a virtual GPU to your VM.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文