Ask Slashdot: Can Linux Run a GPU-Computing Application Written For Windows? 117
dryriver writes:
I have been told that Linux can run Windows software using Wine or perhaps a VM. What happens if that Windows software is a GPU-computing application -- accessing the GPU through HLSL/GLSL/CUDA/OpenCL or similar interfaces?
Can Wine or other solutions run that software at a decent speed under Linux? Or is GPU-computing software written for the Windows platform unsuitable for use -- emulated or otherwise -- under Linux?
This sounds like one of those cases where there's a theoretical answer and then your own real-world experiences. So leave your best answers in the comments. Can Linux run a GPU-computing application that's written for Windows?
Re: no (Score:5, Insightful)
You can absolutely run it if a VM is an accepted solution. The things you have to do:
1. Use a processor that supports virtualization
2. Have a second GPU for the host (in a server, usually the Melanox GPU).
3. Use a hypervisor that can pass through PCI ports and pass in the nVidia Cuda enabled GPU (like an nVidia Tesla M60 card)
4. Run your application in the VM
The real question is: why does the underlying system have to be Linux? Do you want to Hypervise it for HA? Without knowing the why's behind your request, it's hard to say whether you can or not. Is it absolutely possible? Yes. Is it the best approach? Maybe. Is it the most efficient approach for your high-spec'd application? Probably not.
Re: (Score:2)
I've been toying with the idea of moving my windows desktop to a VM inside a hypervisor. People have done passthrough on their gaming rigs but still take a 10-20% performance hit on the GPU.
Re: no (Score:3)
I don't think a good hypervisor gives you the same drawback. You should get near-real performance on pass through devices now.
If you don't need double precision... (Score:5, Informative)
Alternatively if you need double precision or don't mind spending 5-10 times the cost of a gamer card you can purchase a Tesla GPU since the nVidia driver for these works fine in a VM without patching.
Re: (Score:3)
Install Windows in VirtualBox or VMware, Configure the virtual machine for 3D and let it rip.
As for Wine, Wine is always win-some-lose-some. If the application will run under Wine, then it should have access to most of the Windows APIs of interest.
Finally, for CUDA, you would either need a second card or you would need an NVidia Grid solution which installs NVidia on the hypervisor and then again on the VM. It's insanely expensive.
Re: no (Score:2)
That's what I meant, using the CUDA GPU for Open-CL or GPGPU type applications. In this case you need the second GPU so the system doesn't hold the GPU, freeing it up for the hypervisor.
Re: (Score:1)
If a VM is the accepted solution, the answer is still "No Linux cannot run a gpu computing application written for Windows."
A VM running Windows running the gpu application is still Windows running the gpu application.
graphics card not accessible in Virtual Box (Score:2)
Re: (Score:3)
Don't use VirtualBox.
For starters it doesn't support GPU pass-through. If you try to use the VirtualBox Guest Additions video driver then you'll be limited to DirectX 9 and OpenGL 2.1 (but only if you enable OpenGL through registry settings).
If you pay money for VMware Workstation for Linux/MacOS/Windows then you'll be upgraded to DirectX 10 and OpenGL 3.3 but, as far as I know, still no GPU pass-through support.
Maybe (Score:2, Insightful)
Maybe.
Re: Maybe (Score:2)
Just try it. How hard could it be?
Re: (Score:2)
I tried it. It works (for some values of "works") but the question is wrong. I had Rage working in Wine on Linux *with* CUDA support using someone's special wine-cuda wrapper hack, and it worked amazingly well, for all of 2 weeks then never worked again. I won't bore you with the sad technical details but the take away is that the real question that should be asked here is "Can Linux run a GPU-Computing application written for Windows without Nvidia's permission?"
References:
the code [github.com]
back when it worked [steampowered.com]
yes (Score:5, Informative)
PCI express passthrough is the term to search for.
A good writeup:
https://www.reddit.com/r/pcmasterrace/comments/2z0evz/gpu_passthrough_or_how_to_play_any_game_at_near/
Re: (Score:1)
What are you talking about? The original post literally asked "Can Wine or other solutions run that software at a decent speed under Linux? Or is GPU-computing software written for the Windows platform unsuitable for use -- emulated or otherwise -- under Linux?"
And the answer is KVM and Xen works far better than wine when GPU's are involved, and can achieve almost native result compare to Windows when you have a decent motherboard and CPU that supports full visualization features. A lot of people are playin
Re: (Score:2)
What are you talking about? The original post literally asked "Can Wine or other solutions run that software at a decent speed under Linux? Or is GPU-computing software written for the Windows platform unsuitable for use -- emulated or otherwise -- under Linux?"
If someone is trying to build up cheap compute boxes for an application already written, they may be looking to build it without having to buy a licence. Wine would satisfy this, a VM with Windows installed wouldn't.
Re: (Score:2)
Re: (Score:2)
PCI express passthrough is the term to search for.
A good writeup:
https://www.reddit.com/r/pcmasterrace/comments/2z0evz/gpu_passthrough_or_how_to_play_any_game_at_near/
Sure answered my question, I have two different Nvidia cards (GTX-570/760) did wonder if they would work together under VT-D (Linux Mint-Cinn), looks like they will. Now it's just a matter of DirectX.
It worked for F@H (Score:5, Informative)
It used to be there was no Linux Folding@Home application. But there was a way to run the Windows CUDA application on Linux, and I did for a couple of years.
Here's a guide for that: http://www.overclockers.com/de... [overclockers.com]
But how fast? (Score:5, Interesting)
Even if it runs under something like WINE, how fast does it run?
I would assume that if you need something that uses CUDA, performance is important.
Depends if it is CPU or GPU bound... (Score:1)
If it is GPU bound, then wine is perfectly fast enough for acting as a 'windows i/o emulation layer' to pump the data to the cards (barring any serious regressions, wine is at worse usually 2-3x as slow as windows, due to the extra API overhead. But in some cases is faster due to filesystem, memory or i/o subsystem, etc.) In that case, so long as the wine API can pass through all the GPU programs needed and pull the results back to the windows apps, it should work exactly the same as on Windows, but with th
Re: (Score:2)
Re: (Score:2)
W-I-N-E
Re: (Score:1)
The performance
Re: (Score:2)
WINE is the software. This is asking if you can hit the hardware for a task where the hardware is where your real work is happening.
Blender? (Score:1)
Re: Blender? (Score:1)
I don't know Maya, but I know enough about Blender to know that's not a skill I'll ever have.
Type the word "obtuse" on a Dvorak keyboard with all the key caps ripped off, and you'll have a word that begins to describe that interface.
Re: Blender? (Score:1)
Rxygo.
Re: (Score:2)
You can get Maya for Linux
Re: (Score:1)
Re: (Score:2)
I was just trying to say that if you want to run Maya you don't need Windows emulation.
Re: (Score:1)
Re: (Score:2)
Re: (Score:1)
Re: (Score:2)
Please tell me you're not trying to run Blender when you got Maya? :(
Blender vs Maya = Etch-a-Sketch vs Picasso
Who cares (Score:3, Insightful)
Run Windows. I never have used wine. Linus himself said if you need to run win32 then run host OS. Linus used XP for PowerPoint.
How would you feel if I asked you if I could run Ubuntu on Windows 10? I could but why? It's a geek toy. At work your job is to put ideology aside and to make your bosses happy by keeping it up.
Will running Windows Server really be that horrible for 1 server?
But if I did have to run Linux I could try KMS with GPU pass thru but you risk downsides on now 2 platforms and bugs for now KMs, Linux, and windows and a performance hit. That won't guarantee higher uptime.
Re: (Score:2)
Maybe it's more like porting Linux apps to Windows using Cygwin. I have both Linux and Cygwin. Cygwin is for applications that are both portable and have need to access files also regularly accessed on the Windows side. Bothering with two operating systems (virtual or real) or cross OS file shares might be more effort than necessary. I rarely boot Linux and don't need to bother setting up file sharing. YMMV.
Re: (Score:2)
Re: (Score:2)
At work your job is to put ideology aside and to make your bosses happy
Bosses often don't know tech. Programmers often don't know business. Programmers who just wait for their bosses to tell them how and what to do are crappy employees who make the company lopsided toward the business side. The best employees push for their ideals, but also know when to back down.
and lets not forget (Score:2)
Will running Windows Server really be that horrible for 1 server?
It may, it really depends. If you are running a system that must be compliant (PCI, NISPOM/JFAN, FedRAMP, etc..) it absolutely may be horrible. You not only need that 1 Windows server, but all of the supporting infrastructure to make it compliant. That 1 server is now 2 or 3, and you need manpower and time to go with it.
So if you can run Windows, I agree with GP. Where I work, the vendor would either port or we wouldn't run it.
Re: (Score:2)
We have to used WIndows at my last job because of compliance. Only Windows has auditing and logging to support what you described. Group Policy can do desktop lockdowns and make things much easy to administer.
Also the vendor wont support you and the app to the vendor is out of compliance if it does not run on Windows. It is irresponsible to use an OS that is unsupported or do a VM with bugs on 3 platforms (VM, Linux, and Windows) because on Slashdot someone says its sux.
You must be lucky. Most companies if
Re: (Score:2)
Linux has had auditing and compliance since RH3.0. Today it's called auditd, but started as LAUS. Your ignorance != honesty. I built the first networks outside of a military base certified for classified processing under NISPOM and JFAN/3 standards. At the time I built those networks, Windows could run stand alone only.
WIndows required more infrastructure and hands on management than Linux even years later when Windows could finally be certified for Network operations in those environments.
Re: (Score:2)
"we can convince more companies to provide"
"We" in this case happens to be 1% of the PC market. Good luck with that convincing part.
Re: (Score:2)
> We" in this case happens to be 1% of the PC market.
Servers are PCs too. The vast majority of the internet is hosted on Linux. Compared to linux, Windows is hardly used at all in the server world.
Re: (Score:1)
I do.
If I could run the CAD software I use for work on linux I would literally jump for joy.
Re: (Score:2)
How would you feel if I asked you if I could run Ubuntu on Windows 10? I could but why?
Uuuh, you do realize that Microsoft enables Ubuntu to be run in-process in Windows 10? It's called "Windows Subsystem for Linux."
https://msdn.microsoft.com/en-... [microsoft.com]
As to "why", it's because lots of open-source tools are designed to only run on Linux, and Microsoft wanted to make those tools available to Windows users too.
Re: (Score:2, Funny)
Will running Windows Server really be that horrible for 1 server?
Yeah, this is clearly coming from someone that has never used it. ;)
Re: (Score:1)
Linus used XP for PowerPoint.
Citation needed.
It's a geek toy.
Depending on the application, WINE can give almost native performance, where almost means a negligible difference. There is professional software (CAD applications) released with WINE compatibility.
Re: (Score:2)
There's also professional scientific software written in dotnet that is tested against mono so that it can be run on linux. That turns a single licence from a hotseat in front of a MS Windows workstation to something you can run on a noisy and fast server then let the user get to it from their desktop machine via X Windows. No need for a dusty computer in the corner used for an hour a week but a different person each time.
Re: (Score:2)
Will running Windows Server really be that horrible for 1 server?
Yes.
Christ, why does this need to be explained to a person on Slashdot? By avoiding Windows, you're avoiding licensing costs, reducing your attack surface, and removing an element that might otherwise disrupt homogeny in the infrastructure.
Finding solutions that help avoid Windows is something of a badge of pride amongst the Slashdot crowd. Back in the day - like, 10 years ago, people would tinker and do that kind of thing just for the sake of doing it!
Or, at least, they used to. What's changed? Did you look at Windows 10 and say "oh, everything about this is good, let's just stop resisting Microsoft now"? Did you wake up one morning and say "oh, I'm old now, time to stop tinkering and just be a goddamn curmudgeon to anyone who attempts something extraordinary"?
I saw this discussion and I looked forward to reading ideas and solutions about what's out there and what's possible, instead of being a hardass son of a bitch and saying "you're wasting your time".
What changed for me was Gnome 3 and WIndows 7. Next System D. It seems MS is going the way Linux should have been and Linux is getting worse each release. Back in 2009 was the highlight of Linux with Gnome 2 and Init. It just is not as good while aero came out for Windows and now Ubuntu.
I am not a MS fanboy. More like I gave up on FOSS ever competing outside of a few geeks. At the end of the day it makes no sense to run a win32 program on something not designed for Windows because back in 1998 oh boy Linux
I wouldn't (Score:3)
Just like I wouldn't go the other way and do a Linux computation program on Windows. Thing is if you are talking about something that needs the GPU for acceleration, you are talking about something doing some heavy hitting math. The reason you bother with a GPU is because whatever you are doing is too slow just running on a CPU. Otherwise why bother? It is more work and restricts systems that can run it.
Well any emulation/virtualization/whatever will slow things down. How much varies, but even in the best case scenario, there's a performance penalty. Why pay that? Just run it in the OS it wants to run in on the iron. That'll get you the best performance.
Not only that but generally speaking technical and engineering software is not the best written, most stable stuff in the world. You are likely to find it quirky even when you run it in the environment it wants. Introducing more variables is just going to make problems more likely and your life more difficult.
If GPU-bound, CPU virtualization doesn't matter (Score:2, Troll)
> Just run it in the OS it wants to run in on the iron.
Sometimes that certainly makes sense. Sometimes that would be really inconvenient and provide no benefit at all.
> Well any emulation/virtualization/whatever will slow things down. How much varies, but even in the best case scenario, there's a performance penalty.
That's not true. There is no measurable performance penalty for any application that's waiting on hardware such as the GPU or waiting on an external resource, typically over the network.
Depends (Score:2)
can you? yes. (Score:2)
Windows on a chip (Score:2)
Re: (Score:2)
I can see why they might have renamed that.
Can you jump a sinking ship if you had to? (Score:1)
Depends on which library you use (Score:2)
You need to plan for it in advance.
Re: (Score:2)
There are cross platform libraries that work equally well on Linux and Windows.
OpenCV isn't one of them and it's not even OpenCV's fault. Try opening a USB-based stereo camera with OpenCV under Linux and you get an error best summarised as "the USB bus doesn't have enough bandwidth to open the device." This is wrong because the same stereo camera devices work just fine with OpenCV under Windows and MacOS.
seeing the video card from a virtual box (Score:1)
What about docker? (Score:2)
Re: (Score:1)
While it'd be cool if you could do that, I don't believe that it's possible in Docker.
The docker host needs to run the same OS as what the container was created on.....e.g. only Linux containers run on Linux hosts (although I think MS may be working on changing that) and only Windows containers run on Windows hosts.
Possibilities (Score:1)
Re: (Score:3)
Given nearly all the worlds fastest computers are Linux-based CUDA machines, you're full of it.
Re: (Score:2)
Grow some balls and post as yourself and I'll bother to answer why you're so wrong.