CUDA with MinGW How to get CUDA running under MinGW?

Actually I’d prefer if nVidia supported their toolchain and drivers in the new Windows subsystem for Linux (WSL). But I am not sure what technical obstacles might prevent this from happening.

It will be nice to have a CUDA support for the new Windows subsystem for Linux (WSL). Actually, the systems cannot find a GPU card for both of the WSL or the vitualbox.

The WSL may be an option for some, but its not really comparable to what MSYS2 and MinGW are. We really need an easy way to develop with Cuda for native Windows. And Visual Studio is cumbersome, gigantic in disk use, takes hours to set up and requires endless updates, and is more difficult to use in batch operation (i.e. CI usage). MSYS2 and MinGW solves all this. Just that its lacking Cuda support is a problem.

with vs2017, you can install only cmdline compiler without IDE itself

Yes, I have installed Visual Studio with cmdline before. But its just not the same thing. MSYS2 can natively compile more than a thousand of the well-known libraries and toolkits for native Windows with 32 and 64bit target. The compiler is a 100MB download and 5 minute installation, no strings attached. You can install numerous compilers side by side, i.e. to test newer compilers. You get a decent bash shell for scripting, alongside python and perl. A full-blown development environment is set up in minutes. And finally, cross-platform development is simplified with MinGW compared to Visual Studio.

Of course everyone has their own preferences. Visual Studio has a nice graphical debugger, and many people like the IDE. But setting up continuous intergation with MSYS2 is so much less hazzle compared to Visual Studio. And bugs in gcc are so much more frequently fixed! It would be just great if more commercial frameworks adopted support.

FYI, if it’s helpful: https://axfelix.github.io/

would be thrilled to see gcc/mingw-gcc support on windows nvcc.

the dependency on VS creates a lot of challenges and extra works for software deployment, making automated building/testing and continuous integration (such as travis-ci) slow and inefficient. it also prevents the software from utilizing many of the open-source libraries, such as zlib (one has to manually build/add to path - can do it myself, but hard to instruct all users to do the same) and many other widely used libraries that are tightly integrated with msys2/cygwin64.

on Linux, nvcc has already been calling gcc on the host, not sure what makes it so different on Windows.

3 Likes

Any progress on introducing nvcc into the mingw environment?

2 Likes

2007-2021, 14 years already.
We got nothing changed.
This is just pure laziness and arrogant.
Think about why people giving you m-fingers, Nvidia.

Yeah, I don’t want to write my codes with windows visual whatever, you don’t want to do that, too. But this is the reality. We all have to eat shits forever. I hate this world, I hate windows, I hate nvidia. But do you know what I hate the most? C++. That’s one bad ugly bitch.

I believe nvidia won’t support mingw forever and I understand that. I think it’s too much to ask. In fact I feel sorry for the developers in Nvidia. Imagine if you have to write GPU compiler supports C/C++. That’s the real nightmare.

Maybe you don’t agree with me, but I think I know where did it all go wrong. Some gurus out there should invent better C. Not a monster. Now we all have to pay. I always think Nvidia/AMD people sould implement whatever language suits their hardware. If it’s simple enough, I’ll learn. So they can support more platform and make their platform better.

But hey, every body wants them to support C++11, C++14, C++17…they really don’t have the time, I believe.

not sure where you theory come form.
it has nothing todo with c/c++, Nvidia already providing GCC support on Linux version of CUDA/NVCC for years.
Mingw is basically GCC ported to Windows, not much difference, therefore Nvidia should be able to use most of existing code with minimal modification to support it, but they chose not to.

“I always think Nvidia/AMD people sould implement whatever language suits their hardware.”
dude you are in the forum that talking about CUDA, which IS the language Nvidia got for their hardware.

1 Like

I mean, do we really need C++ syntax to implement GPU code? Of course, it’s cool or convenient but it’s limited after all. Even though they implement full C++, we have to write GPU specific codes anyway.

So I thought if they chose much simpler language as basis of their own, it would take less time to implement their compiler so that they could use their resources for the other things. The other things like, supporting MinGW?

You said they’re lazy and arrogant but I imagine that they were too busy to improve their compiler to support “more C++ feature” type of things, and was arrogant. So I guess it too much to ask them to do the both.

That’s what I thought when I wrote the comment above. Just saying, but I’m not a badass geek who writing a rendering pipeline for huge game engine or anything. Maybe I just don’t understand the situation around core users after all.

But the question is, which makes you happier as a user of cuda ultimately? Nvidia is arrogant but has extra time to take care of our, kind of wired unix like enviroment on Windows or they take the time to improve compiler to let us use latest C++ syntax sugar.

As a casual user, I’d be happy if they spent more time for the other things rather than adopt their compiler to one of the most complicated programming language ever made. That’s why I think they should choose something other than C++ for their compiler. Maybe I’m wrong but I just thought so as a user.

Hi,
2023 it is. Is there a way now to use Cuda with mingw under windows? I have this project that is compiled using mingw64 and I am trying to integrate cuda code with it. However, since cuda files are compiled using nvcc that uses cl.exe , I am getting linking errors and I have been stuck on the problems for days . Is there a way out of this?

2 Likes

The only toolchain provided/supported by NVIDIA for native development on windows uses cl.exe

In the future, you can check the current CUDA windows install guide to find supported toolchains.