zelikos / davincibox

Container for DaVinci Resolve installation and runtime dependencies on Linux
Apache License 2.0
224 stars 10 forks source link

refactor!: Split into `davincibox` and `davincibox-opencl` #121

Closed zelikos closed 2 months ago

zelikos commented 2 months ago

Based on findings in https://github.com/zelikos/davincibox/issues/114#issuecomment-2350719661 it seems that having the akmod-nvidia and CUDA packages installed into the container actually cause problems, and through nvidia-container-toolkit the container actually uses the host NVIDIA drivers just fine.

This PR splits davincibox into two builds: davincibox that contains only DaVinci Resolve dependencies and no drivers, for use on NVIDIA GPUs with nvidia-container-toolkit, and davincibox-opencl for AMD & Intel with their respective compute packages (intel-compute-runtime and rocm-opencl).

In theory, this will likely resolve #96 #114 and #117 and may help with #40

zelikos commented 2 months ago

The new builds from this PR can be tested by following the manual setup instructions as normal, but replacing the latest tag with pr-121:

NVIDIA:

distrobox create -i ghcr.io/zelikos/davincibox:pr-121 -n davincibox --nvidia

AMD & Intel:

distrobox create -i ghcr.io/zelikos/davincibox-opencl:pr-121 -n davincibox

The AMD side with davincibox-opencl is working as expected on my end.

cc @DaoistNeko and @Zeglius if either of you could test the NVIDIA image

Zeglius commented 2 months ago

Seems is not working. Nothing happens by using the app shortcut. Manually launching from distrobox I get this image

zelikos commented 2 months ago

Re-added mesa-libOpenCL to the main dependencies, since I notice now that it wasn't on the list removed in https://github.com/zelikos/davincibox/issues/114#issuecomment-2350719661. I wonder if we could keep intel-compute-runtime in too, and maybe we only had to omit ROCm from the main container for NVIDIA to work...?

Zeglius commented 2 months ago

Re-added mesa-libOpenCL to the main dependencies, since I notice now that it wasn't on the list removed in #114 (comment). I wonder if we could keep intel-compute-runtime in too, and maybe we only had to omit ROCm from the main container for NVIDIA to work...?

Installed mesa-libOpenCL in the container, seems that makes it work.

By adding intel-compute-runtime however, I get the "cant start GPU" error. image

zelikos commented 2 months ago

Re-added mesa-libOpenCL to the main dependencies, since I notice now that it wasn't on the list removed in #114 (comment). I wonder if we could keep intel-compute-runtime in too, and maybe we only had to omit ROCm from the main container for NVIDIA to work...?

Installed mesa-libOpenCL in the container, seems that makes it work.

By adding intel-compute-runtime however, I get the "cant start GPU" error. image

To clarify, with just mesa-libOpenCL added, Resolve starts as normal, and it detects CUDA just fine too?

Beryesa commented 2 months ago

I have an amd apu with dedicated Nvidia graphics (laptop) may I help with testing or

zelikos commented 2 months ago

I have an amd apu with dedicated Nvidia graphics (laptop) may I help with testing or

* would testing on amd igpu help/work at all

* Do you know either PRIME/offload is not fundamentally broken?
  Thanks :3

Multi-GPU laptop setups like yours are a known issue that may or may not work; you're welcome to try testing this PR anyway, and the changes here might also actually help, but ultimately that type of setup would be a separate issue than what this PR is intended solve.

Zeglius commented 2 months ago

Re-added mesa-libOpenCL to the main dependencies, since I notice now that it wasn't on the list removed in #114 (comment). I wonder if we could keep intel-compute-runtime in too, and maybe we only had to omit ROCm from the main container for NVIDIA to work...?

Installed mesa-libOpenCL in the container, seems that makes it work. By adding intel-compute-runtime however, I get the "cant start GPU" error. image

To clarify, with just mesa-libOpenCL added, Resolve starts as normal, and it detects CUDA just fine too?

mesa-libOpenCL + all the other dependencies from the PR's container image (ghcr.io/zelikos/davincibox:pr-121) yep.

zelikos commented 2 months ago

Re-added mesa-libOpenCL to the main dependencies, since I notice now that it wasn't on the list removed in #114 (comment). I wonder if we could keep intel-compute-runtime in too, and maybe we only had to omit ROCm from the main container for NVIDIA to work...?

Installed mesa-libOpenCL in the container, seems that makes it work. By adding intel-compute-runtime however, I get the "cant start GPU" error. image

To clarify, with just mesa-libOpenCL added, Resolve starts as normal, and it detects CUDA just fine too?

mesa-libOpenCL + all the other dependencies from the PR's container image (ghcr.io/zelikos/davincibox:pr-121) yep.

Right, that's what I meant, sorry for being unclear. Thanks for confirming

zelikos commented 2 months ago

Gonna go ahead and merge since I've confirmed the AMD side works, and it sounds like NVIDIA on Bazzite works too.

svyatoclav commented 1 month ago

I'm on Artix Linux wayland desktop with distrobox on podman (also tested docker) with GTX 1080 Ti, latest 560.35 NVIDIA drivers both on host and Fedora 40 container and manually installed last build of davincibox:latest --nvidia -n davincibox (2024-10-19) + DaVinci Resolve Studio 18.1.2

Errors Your GPU memory is full. Try reducing the timeline resolution or the number of correctors. and The GPU failed to perform image processing because of an error. Error code: 999. only fixed with env __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia from https://github.com/zelikos/davincibox/issues/40

My exec now looks like: Exec=distrobox-enter -n davincibox -- bash -cl "export __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia QT_QPA_PLATFORM=xcb && /opt/resolve/bin/resolve %u"

btw IDK but there is very weird color shift effect in Distrobox Fedora container in programs interfaces (not only Resolve). Anyone knows why? 20241018-220038_swappy 20241019-010154_swappy 20241018-214430_swappy

zelikos commented 1 month ago

@svyatoclav Please use the issue tracker for reporting issues. Reporting issues on closed pull requests is not helpful