zelikos / davincibox

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

Can't initialize OpenGL #114

Closed mtwb47 closed 2 months ago

mtwb47 commented 3 months ago

Describe the bug

When I run the setup script, I get a slew of Permission denied errors. I have attached the output where the errors occurred error.txt .

Installation method used

To Reproduce

Steps to reproduce the behavior:

  1. run setup script per instructions
  2. see errors
  3. Resolve does install, but will not run. It says that it cannot find openGL.

Expected behavior

Successful installation.

Screenshots

If applicable, add screenshots to help explain your problem.

System information (please complete the following)

Additional context I believe that outside of the permission denied issue I'm also having the same issue as #83 but the steps taken there do not work for me.

Screenshot_20240814_202714

zelikos commented 3 months ago

Yeah, those permission denied errors happen even for successful installations; those shouldn't be the cause of this issue.

Just to be sure: do you have nvidia-container-toolkit and lshw installed? The latter is needed if you use setup.sh, but not for manual setup; the former is a hard requirement for Nvidia GPUs.

mtwb47 commented 3 months ago

I do have both

IDK how much help I will be on testing this anymore, as I've (through blood sweat and tears) installed Resolve natively on openSUSE now.

DaoistNeko commented 2 months ago

Solution

Problem: The root cause of this issue is that davincibox comes with drivers pre-installed. This is unnecessary, so we will be removing them. Another part of the issue is that when opencl is installed, DaVinci Resolve will default to it and not detect cuda even if it shows up in nvidia-smi (my guess is that because programs first look through distrobox before looking through the host, and since DaVinci found something that satisfies it on the distrobox, it doesn't actually check the host for cuda). Once these are removed, assuming you use the --nvidia argument, it will simply use the drivers installed on the host.

In theory, this solution should apply to #117 and #96 as well.

steps to fix

1) First we need to edit the container provided Zelikos and remove the files causing problems. podman run ghcr.io/zelikos/davincibox dnf remove -y --noautoremove akmod-nvidia nvidia-modprobe nvidia-persistenced nvidia-setting xorg-x11-drv-nvidia-cuda xorg-x11-drv-nvidia-cuda-libs xorg-x11-drv-nvidia-kmodsrc xorg-x11-drv-nvidia-libs xorg-x11-drv-nvidia-power intel-opencl rocm-opencl opencl-filesystem intel-opencl-clang

2) Now we need to find the container ID for the container we just created. podman container list -a

3) This next step will finalize the changes and create a commit ID. This is the ID of the image we will create from the container we just edited. podman commit CONTAINERID

4) From here on, you can follow the manual steps in the README, but replace ghcr.io/zelikos/davincibox:latest with your commit ID. Like so: distrobox create -i COMMITID -n davincibox --nvidia /path/to/DaVinci_Resolve_version_Linux.run --appimage-extract (if you havn't already done this) distrobox enter davincibox -- setup-davinci squashfs-root/AppRun distrobox

You're done!

Now when you enter DaVinci resolve, go to preferences, and click on "Memory and GPU", you should see something kind of like this:

image

Note

You can find the squashfs-root in your home directory. This is from extracting DaVinci resolve, but you can delete this once you've successfully installed DaVinci.

PS

I'm so happy I finally figured out what was actually the problem. It's the first time I've ever touched containers so I ended up going down many rabbit holes that were unrelated. So this ended up taking a lot of time. Despite the hiccup, I have also come to appreciate the convenience that this script provides.

zelikos commented 2 months ago

@DaoistNeko Thanks for taking the time to investigate this so thoroughly. I don't have an NVIDIA GPU so troubleshooting anything NVIDIA is basically impossible on my end.

My guess here is that, maybe when the switch from nvidia-container-runtime to nvidia-container-toolkit happened a while ago, it also resulted in the host drivers being able to be passed through to the container, which I don't believe was the case before. So if davincibox can work without including the NVIDIA drivers, and if doing so fixes a number of issues, that's great to know. This is a big change that would need wider testing, though.

As for the OpenCL drivers, we're already checking for the GPU driver being used, so updating the setup scripts to conditionally install them for Intel and AMD shouldn't be difficult. That, or providing a davincibox-nvidia variant in the future that omits them (or the inverse, davincibox-opencl that includes them).

cc @Zeglius since you do a lot to integrate davincibox in Bazzite and I don't want to break things there (again)

DaoistNeko commented 2 months ago

No problem, I'm just happy to get DaVinci up and running. Since the fix is simple enough (no extra dependencies) and documented, you can take however long you need to implement it.

Zeglius commented 2 months ago

Can confirm,DaoistNeko fix seems to work for me.

This is a screenshot made after manual installation with https://github.com/zelikos/davincibox/issues/114#issuecomment-2350719661 steps. image

However using the normal installation procedure I get the same error https://github.com/zelikos/davincibox/issues/114#issue-2467049315

Zeglius commented 2 months ago

Also seems removing dependencies after setting the container up (including running the setup-davinci) and afterwards restarting the container works as well.

Update: seems simply restarting the container, running the dnf command to uninstall the Nvidia dependencies mentioned in the fix , and restarting the container again is enough.

Probably this fix can be done in the setup.sh

DaoistNeko commented 2 months ago

Yes, and I was able to remove all opencl packages while davincibox was running and have everything work fine without a restart. I just had trouble with making changes to the nvidia drivers, and when I made the guide I combined the steps for simplicity.

zelikos commented 2 months ago

The NVIDIA driver issues should be fixed as of #121; if this issue persists after upgrading, feel free to re-open.