llvm-mingw icon indicating copy to clipboard operation
llvm-mingw copied to clipboard

enable NVPTX

Open ghost opened this issue 10 months ago • 5 comments

Otherwise it's not possible to compile ffmpeg with --enable-cuda-llvm, I don't like to compile this with the distro clang, they're too old.

ghost avatar Sep 05 '23 22:09 ghost

What would be required for that?

longnguyen2004 avatar Oct 24 '23 04:10 longnguyen2004

It seems that simply adding NVPTX to https://github.com/mstorsjo/llvm-mingw/blob/3becea478fab0145f5b6dc9c84736f4a3d3bb65f/build-llvm.sh#L311 This is indeed a problem, if NVPTX support is not enabled, it is not possible to compile FFmpeg with CUDA filter support using llvm-mingw, unless nvcc is explicitly specified as another clang.

Andarwinux avatar Dec 08 '23 17:12 Andarwinux

I merged https://github.com/mstorsjo/llvm-mingw/pull/385 now, so this should be fixed in future builds (including nightly builds).

FWIW, earlier, one of my main concerns was that the GitHub Actions based builds were getting painfully close to the timeout of 6 hour per build step (it would mostly still run in less time than that, but more often than I would have wanted, builds would time out and would have to be restarted), and any case of enabling more things would make builds time out even more often. But since a few weeks, GitHub Actions have upgraded the runners to much more beefy ones (4 cores instead of 2, and 16 GB of RAM instead of 8), so the builds run much more smoothly now.

I also checked how much longer the build takes overall; a build with all of clang-tools-extra and lldb enabled now, with NVPTX enabled, takes around 5% more CPU time to build. The number of files to build increases from 5763 to 5804, which sounds like little, but apparently those files still take a fair amount of CPU to build if the total amount of work needed to build increases by 5%.

mstorsjo avatar Dec 12 '23 11:12 mstorsjo

Personally, I'd consider dropping ARM support to offset the build time bloat caused by NVPTX. Microsoft has already dropped arm32.

Andarwinux avatar Dec 12 '23 13:12 Andarwinux

Personally, I'd consider dropping ARM support to offset the build time bloat caused by NVPTX. Microsoft has already dropped arm32.

I wouldn't quite go so far to drop support for it here, we do have users of llvm-mingw who actively use it in arm32 environments AFAIK - Windows 10 IoT is ARM32, not ARM64 - CC @kleisauke (if I remember correctly).

But anyway, the point is moot, the build time increase is quite tolerable, and supporting ARM32 is something I quite intentionally spend extra effort on even if is being phased out from upcoming OSes - it did exist quite visibly for a number of OS releases. (It's also quite relevant for being able to build e.g. Wine for ARM32.)

mstorsjo avatar Dec 12 '23 13:12 mstorsjo

A prerelease with LLVM 18.1.0 RC 1 is out now, at https://github.com/mstorsjo/llvm-mingw/releases/tag/20240130, where this issue should be fixed.

mstorsjo avatar Jan 30 '24 20:01 mstorsjo

I wouldn't quite go so far to drop support for it here, we do have users of llvm-mingw who actively use it in arm32 environments AFAIK - Windows 10 IoT is ARM32, not ARM64 - CC @kleisauke (if I remember correctly).

The libvips Windows binaries, as available in the https://github.com/libvips/build-win64-mxe repo, still continues to build ARM32 binaries on a best-effort basis. Testing these binaries is done manually on a Raspberry Pi 3B running Windows 10 IoT Core.

The maintenance burden is doable; however, I'm considering discontinuing support for ARM32 in the near future, see e.g. work-in-progress commit https://github.com/libvips/build-win64-mxe/commit/ce17ea891ab167ad0ed680cbf6f8bfcb59041020.

kleisauke avatar Feb 04 '24 16:02 kleisauke