-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FR] Container GPU passthrough #7
Comments
I will try these out and see how far I get. |
This is most promising. https://hub.docker.com/r/damanikjosh/virtualgl-turbovnc |
Sorry for the mega delay. Meant to look at this over the weekend, but was swamped with other stuff. I think https://github.com/linuxserver/docker-kasm/blob/master/Dockerfile has a lot of really useful NVidia Docker bits that I plan to learn from and adapt the current Dockerfiles for my containers. Basically I think I missed including the NVidia Toolkit package https://github.com/NVIDIA/nvidia-container-toolkit and its dependencies. Hoping I can poke this later after work. |
Though on this topic, I am beginning to investigate alternative noVNC solutions since the one I use has been deprecated. I might also just fork it and maintain it, but we'll see. |
Okay got it running. |
|
Peek.2024-04-02.15-02.mp4 |
TurboVNC / TigreVNC seems to be able to fit the bill |
Thanks a ton for the work on this so far! It's looking super smooth for the slicing view now. Feel free to send a pull request if you'd like and I'm happy to review and merge 😄 .
Neither of those provide a web browser package though, correct? Ideally that's something we'd probably like to retain for the repos. Thanks again for the work on this! |
Not sure if I can do a PR against your re-pro it will be all new I think. https://github.com/damanikjosh/virtualgl-turbovnc-docker/blob/main/Dockerfile uses a base
so its very bloated being based on ubuntu. however its got all the same bits, instead of openbox it uses some other DM (lbuntu), but has VNC and novnc, (my video you can see its all in a browser) I will fork this and see what I can do. but this will only work nvidia GPU's obviously. |
https://gist.github.com/vajonam/d1e713bcfd47e03f27549258ef53690e <- WIP but works for the most part, I have added some of your code. I think should be able to submit a PR. Standby not too different after all, ubunut/debian still a bit bloated. |
still need to add back |
okay I have working version with supervisor etc, some fine tuning is needed for passing environment variables. look for a PR shortly. this should work regardless of nvidia, but worst case you might have 2 dockerfiles one nvidia gpu and one for cpu. |
Added #15 to address this. |
Thanks for the work so far. I just pulled the latest commit(s) and I am unable to run this via CLI (for unraid and similar I am making sure the templates match up and trying to figure out the migration path for this set of changes). My guess is this is due to the supervisord.conf changes
Command I am running FWIW:
Playing with this a bit more on my end, but once it's ready for review, let me know and I can take a pass :). |
this is the environment variables I am passing
think you were missing VNC_RESOLUTION, It should default if not set, not sure why that is not happening will have a look. Be sure to add all the environment variables, you should be able to pass them as
just added an export to make sure its defaulted if not mentioned. |
I am assuming that you have a nvidia GPU on your installation. I haven't tested this without. but the image is nvidia image and needs nvidia-docker2 from what I understand. |
@helfrichmichael did you get it running after the export of the param, not sure why I forgot that.. anyhow. I had a couple of questions / suggestions.
|
Yep, once the param was exported, it worked just fine (I also had tried passing it as a command line env prior to this FWIW). For Supeslicer and the other slicers, I am happy to replicate this over to those once I've reviewed and merged the code unless you have capacity to update those -- no pressure either way, but this work should be a great base to work from for GPU passthrough on these apps.. Ideally for now I think keeping them separate would be ideal just to prevent having to provide migration paths for those on existing unraid templates etc (I find it's a bit nuanced to do template updates TBH). The only other thing I am curious about is figuring out a way to allow automatic VNC resizing as this has been immensely useful for me when I go from device to device (I have a Mimo Vue touchscreen on my desktop in the garage for the printers that is fairly low res for easy presses). I haven't looked into how noVNC accomplished this, but if we can solve for either autoresizing or a static size that would be amazing. Thanks again @vajonam , really appreciate your help and dedication on this effort. |
Excellent.
Agreed.
I am not sure I understand, but what it looks like it auto resized the window, sadly the right panel on prusaslicer isn't resize able might have to move to a modern view
Yeah no problem you're welcome. For the most part this was driven by need, I had some complex files a few MB that the software rendered just couldn't do when it came to 3D. This makes it awesome! The previous solution was good for the simple stuff. To disable VirtualGL run by setting |
Oh wait. I'm just opening the wrong VNC file I think (we should adjust the default file for the HTTP server probably if we can). http://localhost:8080/vnc_lite.html?resize=true seemed to render it flawlessly! I am having an issue opening the vnc.html file so I need to look at that. I am going to try to review this after work so I can give this a stamp of approval. This is awesome to see so far along! |
To account for this, I will likely make the following PR: Dockerfile:
vncresize.html:
|
@vajonam just pushed to Docker. Successfully set it up on my unraid server with an RTX 3070. It's not picking up the GPU though it seems so I need to dive into this a bit more. Variables I set: NVIDIA_VISIBLE_DEVICES=all I'll keep poking at this when I have some time. |
You might be missing some permissions on the host system, around device permissions. there is tool called |
Does nvidia-smi -l show this line on the host?
|
Just pulled your latest mage, and works nicely in my environment. |
Sadly, no. I see "No running processes found" for all of the entities. In binhex-plexpass for example, I see the GPU passthrough just fine, etc. I can try to poke this more after work probably. |
This is virtualGL passthru not GPU regular passthough which is bit different. Let me know what you find. |
this is what I am using in my docker compose maybe you need to pass the
|
These are important.
|
Confirmed VGL_DISPLAY=egl doesn't change the behavior on my end for the nvidia-smi output or the docker container. Regarding |
Yes. you need it on the host to ensure the devices have the right permissions to access to the card. All it does in this case is set up permissions on the cards and make sure the user under which the docker daemon is running can access the cards. |
Assuming you set |
Hmmm that might add complexity for unraid since I can't find that as a supported approach and I believe it spins up an X server if I'm not mistaken? I'll have to look into this after work.
Correct, I have set both of those on my template. |
There is no need with an X server on the host, it just uses EGL (virutalGL) to use the card to render it on the VNC based X server. |
I got some time just now to play with this a bit more and the solution to my problems wasn't enabling anything further with VirtualGL/vglserver. In-fact it was just adding Amazing work @vajonam! |
Feel free to re-open this if anyone is experiencing issues, but I believe this is good to go 🥳 . |
Can you rebuild with Prusa 2.8.0 please?
…On Sun, May 19, 2024 at 12:41 AM Mike Helfrich ***@***.***> wrote:
Feel free to re-open this if anyone is experiencing issues, but I believe
this is good to go 🥳 .
—
Reply to this email directly, view it on GitHub
<#7 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABFHNLPYBUW253LXOOLKVTZDAUOLAVCNFSM6AAAAAAQ7VZ67CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJZGA4TQMZWGA>
.
You are receiving this because you were assigned.Message ID:
***@***.***>
|
@vajonam PrusaSlicer no longer offer a tarball build, only AppImage, so it'd require a significant rework of projects such as this one. |
Well that is a pain! Just when we got this figured out.. okay I will do some research on how to use the appimage inside the container. |
I can take a look tonight, I've done this with other containers before using the extracted app. Should have time this evening after work. |
|
Glad to hear it's working now! There's a few nuances I'm trying to sort with a few windows being blank, but I'm looking into that in #17. |
As per our conversation on Prusa3D Forum enable 3D acceleration with GPU passthrough.
The text was updated successfully, but these errors were encountered: