microsoft / Windows-Containers

Welcome to our Windows Containers GitHub community! Ask questions, report bugs, and suggest features -- let's work together.
MIT License
380 stars 60 forks source link

Support 3rd Party Vendor Specific Graphics APIs #504

Open sikhness opened 1 month ago

sikhness commented 1 month ago

Currently GPU Acceleration within Windows Containers only allow for DirectX and frameworks built on top of it. Please allow for a way for us to leverage 3rd party Vendor specific frameworks (such as AMD AMF, ROCM, CUDA, and etc) to truly allow for GPU accelerated workloads.

fady-azmy-msft commented 1 month ago

Thanks for the request @sikhness. I want to understand a bit more the use case behind this request, what sort of apps / tools are you trying to use that requires 3rd party vendor frameworks?

sikhness commented 1 month ago

Hi @fady-azmy-msft! It would be useful for anything that requires video encoding/decoding capabilities such as a Media Server like Plex. Currently they can only use DirectX based encoding/decoding capabilities, but AMD, Intel and Nvidia offer AMF, QuickSync and NVENC respectively that many applications do use. In fact, not many applications use DirectX for this.

The same applies for AI based GPU workloads such as Ollama and AnythingLLM. None of these along with many others use DirectML (which is supported by Windows Containers), but they do use third party frameworks to use GPU acceleration such as AMD's ROCM and Nvidia's CUDA.

There's also some work done in the past by some people trying to get Unreal Engine Containers working on Windows with vendor specific graphics drivers, but it seems very convoluted and I was never able to get it working.

ntrappe-msft commented 4 weeks ago

Creating a thread internally to discuss this feature request: 🔖 51837974

doctorpangloss commented 4 days ago

All of these APIs are supported, I think you can close this ticket.

Vendor specific frameworks (such as AMD AMF, ROCM, CUDA, and etc) to truly allow for GPU accelerated workloads.

Please visit "Enabling vendor-specific graphics APIs in Windows containers"

https://github.com/UnrealContainers/unrealcontainers.github.io/blob/23778bdd91c3c57a3a7258ca7e9201dd84d0510f/collections/_posts/2021-07-23-enabling-vendor-specific-graphics-apis-in-windows-containers.md

Good luck out there!

sikhness commented 4 days ago

@doctorpangloss , it states in the article that you posted (which I also posted in my previous reply) that this is an unofficial way and isn't actually supported by Microsoft. Furthermore, it is 3 years out of date, and I personally was not able to get it working (I did try and it was very involved).

I'm asking for an official method of having this working similar to how DirectX just works or at least officially documented on how to get it working if it involves any extra steps and such.

doctorpangloss commented 4 days ago

and I personally was not able to get it working (I did try and it was very involved).

what specifically are you trying to do? I run CUDA and AMF workloads using the exactly described steps in GPU enabled Windows containers all the time.

doctorpangloss commented 4 days ago

maybe start with FROM their-docker-image and docker run -it --device class/...theguid they talk about... and see for yourself, it will all work fine

sikhness commented 4 days ago

Thanks for the info @doctorpangloss, do you happen to have a working Dockerfile or compose file for AMF that you've configured and are able to share?

doctorpangloss commented 4 days ago

any of the results from here will work https://github.com/search?q=xcopy+%2Fy+C%3A%5CWindows%5CSystem32%5Cavicap32.dll+C%3A%5CGatheredDlls%5C&type=code

https://github.com/realAYAYA/UnrealEngine-ToonLit/blob/ffb49957289bf414554c32303c75bfc50aca537c/UnrealEngine/Engine/Extras/Containers/Dockerfiles/windows/runtime/Dockerfile