89luca89 / distrobox

Use any linux distribution inside your terminal. Enable both backward and forward compatibility with software and freedom to use whatever distribution you’re more comfortable with. Mirror available at: https://gitlab.com/89luca89/distrobox
https://distrobox.it/
GNU General Public License v3.0
9.83k stars 401 forks source link

[Error] Same error for entering container with --nvidia flag with closed issue #1234

Closed pathquester closed 4 months ago

pathquester commented 6 months ago

Describe the bug I am running into the same issue with: https://github.com/89luca89/distrobox/issues/1095 which was closed and as you commented was supposed to work with latest git version, however it doesn't work for me.

To Reproduce When trying to enter the container created with --nvidia, it fails with the following errors:

 + for nvidia_lib in ${NVIDIA_LIBS}
++ printf %s /run/host/usr/lib/x86_64-linux-gnu/nvidia/current/libnvidia-ml.so
++ sed 's|/run/host/usr/lib/x86_64-linux-gnu/|/usr/lib64/|g'
++ sed 's|/run/host/usr/lib/i386-linux-gnu/|/usr/lib/|g'
++ sed 's|/run/host/usr/lib64/|/usr/lib64/|g'
++ sed 's|/run/host/usr/lib32/|/usr/lib/|g'
+ dest_file=/usr/lib64/nvidia/current/libnvidia-ml.so
+ '[' -e /usr/lib64/nvidia/current/libnvidia-ml.so ']'
+ type=file
+ '[' -L /run/host/usr/lib/x86_64-linux-gnu/nvidia/current/libnvidia-ml.so ']'
+ type=link
+ '[' link = link ']'
++ dirname /usr/lib64/nvidia/current/libnvidia-ml.so
+ mkdir -p /usr/lib64/nvidia/current
+ cp -d /run/host/usr/lib/x86_64-linux-gnu/nvidia/current/libnvidia-ml.so /usr/lib64/nvidia/current/libnvidia-ml.so
cp: cannot create symbolic link '/usr/lib64/nvidia/current/libnvidia-ml.so': Read-only file system
+ '[' 1 -ne 0 ']'
Error: An error occurred
+ printf 'Error: An error occurred\n'

Expected behavior No errors.

Desktop (please complete the following information): podman podman version 4.3.1 distrobox version: 1.6.0.1 Debian bookworm Git

Additional context It was created with distrobox create --nvidia --name arch-nvidia --image docker.io/library/archlinux:latest on Debian bookworm.

89luca89 commented 6 months ago

@pathquester seeing your log, you're not using the git version of distrobox The new version will do a checksum match that is missing in your log

pathquester commented 6 months ago

@89luca89 I am not sure why that is missing since I did git clone and then ./install. The debian image works fine by the way, it's just the arch image that has this issue.

pathquester commented 6 months ago

@89luca89 I see what happened, the log excerpt that I pasted is indeed from the version I was using before I saw your comment on the original issue to try the latest git version. If you open the logs.txt that I attached though, you will see that I was using the git version during my second test and that the same issue is present.

89luca89 commented 6 months ago

Aaah got it! Thanks!

Can you do an ls -laH /usr/lib/x86_64-linux-gnu/nvidia/current/libnvidia-ml.so on the host?

It seems like, we correctly mount /usr/lib/x86_64-linux-gnu/nvidia/ into /usr/lib64/nvidia, in readonly mode But that file seems to be non-existent on the guest side

Maybe it's a broken link? Can you show that?

pathquester commented 6 months ago

-rw-r--r-- 1 root root 1827448 Oct 25 23:21 /usr/lib/x86_64-linux-gnu/nvidia/current/libnvidia-ml.so

89luca89 commented 6 months ago

so it's a proper file, not a symlink

it's strange because in the log, at line 54957, it correctly mounts /run/host/usr/lib/x86_64-linux-gnu/nvidia onto /usr/lib64/nvidia, this should include current and subsequent files

Line 69391 returns that the file is a symlink actually

89luca89 commented 6 months ago

image

On a fresh debian bookworm VM with nvidia-drivers installed via apt, this works correclty

pathquester commented 6 months ago

@89luca89 Ah, strange. I am not sure where is the difference.

89luca89 commented 6 months ago

Could it be related on some broken nvidia driver install? maybe a reinstall of the driver?

Anyway I don't think this is Distrobox related tbh

pathquester commented 6 months ago

@89luca89 The strange thing is that a debian image works flawlessly, the issue is only with arch.

89luca89 commented 6 months ago

Probably because with debian-to-debian it doesn't need to translate paths, and if there are absolute links or stuff like this, it works correctly ootb

Anyway I couldn't reproduce this on debian bookworm, testing and unstable, and also on ubuntu, so I think there must be something else specific to your setup/system :man_shrugging:

89luca89 commented 4 months ago

Closing as this seems non-reproducible