VMware 上的 cuda 程序
我写了一个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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我曾经面临过类似的任务。我最终做的是在启用持久模式的 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.
不幸的是,虚拟机模拟图形设备,因此您无法访问真实的 GPU。这是因为虚拟化处理访问同一设备的多个虚拟机的方式 - 它提供了一个中间层来共享真实设备。
可以真正访问硬件,但前提是您拥有正确的软件和硬件组合,请参阅 SLI 多操作系统网站 了解详细信息。
因此,您可能对虚拟化路线不走运 - 如果您确实无法在 Windows 中运行您的应用程序,那么您将受到以下限制:
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:
我刚刚在 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.
从 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
使用 rCUDA 将虚拟 GPU 添加到您的 VM。
Use rCUDA to add a virtual GPU to your VM.