-
Notifications
You must be signed in to change notification settings - Fork 440
Properly pass configSearchPaths to a Driver constructor #847
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
Conversation
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
…variable We have to adjust XDG_DATA_DIRS variable to make nvidia-container-toolkit happy and find necessary configuration files. Actually, XDG_DATA_DIRS environment variable value we provided with is already correct (it's getting prepared for us in https://github.com/canonical/mesa-2404/blob/main/scripts/bin/gpu-2404-provider-wrapper.in and https://git.launchpad.net/~canonical-kernel-snaps/canonical-kernel-snaps/+git/kernel-snaps-u24.04/tree/hooks/kernel-gpu-2404-provider-mangler?h=pc-components) but for some reason nvidia-container-toolkit library expects these path to be relative to driver root, which leads to a situation when driver root is getting appended twice to a path and files can not be found. One possible (and clean) solution would be to explicitly specify config files seach path with nvcdi.WithConfigSearchPaths() but it doesn't work because of a bug NVIDIA/nvidia-container-toolkit#847. So the easiest way I found is to adjust XDG_DATA_DIRS variable in that weird way so when nvidia-container-toolkit prepend driverRoot to it a final path became valid and everything works. Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
…variable We have to adjust XDG_DATA_DIRS variable to make nvidia-container-toolkit happy and find necessary configuration files. Actually, XDG_DATA_DIRS environment variable value we provided with is already correct (it's getting prepared for us in https://github.com/canonical/mesa-2404/blob/main/scripts/bin/gpu-2404-provider-wrapper.in and https://git.launchpad.net/~canonical-kernel-snaps/canonical-kernel-snaps/+git/kernel-snaps-u24.04/tree/hooks/kernel-gpu-2404-provider-mangler?h=pc-components) but for some reason nvidia-container-toolkit library expects these path to be relative to driver root, which leads to a situation when driver root is getting appended twice to a path and files can not be found. One possible (and clean) solution would be to explicitly specify config files seach path with nvcdi.WithConfigSearchPaths() but it doesn't work because of a bug NVIDIA/nvidia-container-toolkit#847. So the easiest way I found is to adjust XDG_DATA_DIRS variable in that weird way so when nvidia-container-toolkit prepend driverRoot to it a final path became valid and everything works. Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
…variable (#679) We have to adjust XDG_DATA_DIRS variable to make nvidia-container-toolkit happy and find necessary configuration files. Actually, XDG_DATA_DIRS environment variable value we provided with is already correct (it's getting prepared for us in https://github.com/canonical/mesa-2404/blob/main/scripts/bin/gpu-2404-provider-wrapper.in and https://git.launchpad.net/~canonical-kernel-snaps/canonical-kernel-snaps/+git/kernel-snaps-u24.04/tree/hooks/kernel-gpu-2404-provider-mangler?h=pc-components) but for some reason nvidia-container-toolkit library expects these path to be relative to driver root, which leads to a situation when driver root is getting appended twice to a path and files can not be found. One possible (and clean) solution would be to explicitly specify config files search path with nvcdi.WithConfigSearchPaths() but it doesn't work because of a bug NVIDIA/nvidia-container-toolkit#847. So the easiest way I found is to adjust XDG_DATA_DIRS variable in that weird way so when nvidia-container-toolkit prepend driverRoot to it a final path became valid and everything works. This is to fix an issue with delivering some of the nvidia files that CDI does by default, which are the config files for things like Vulkan and EGL The files are included in the kernels user components, so it just seems like LXD is excluding passing them through via CDI. Please don't consider this an exhaustive list of files, necessarily, but examples are: ``` /usr/share/glvnd/egl_vendor.d/10_nvidia.json /usr/share/glvnd/egl_vendor.d/50_mesa.json /usr/share/vulkan/icd.d/nvidia_icd.json /usr/share/vulkan/implicit_layer.d/nvidia_layers.json /usr/share/egl/egl_external_platform.d/15_nvidia_gbm.json /usr/share/egl/egl_external_platform.d/10_nvidia_wayland.json ```
elezar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @mihalicyn.
Would you be able to backport this commit to the release-1.17 branch once we've merged it too?
Sure! |
|
Thanks. Please ping me on the backport PR. |
|
I created #862 as a backport. |
…variable We have to adjust XDG_DATA_DIRS variable to make nvidia-container-toolkit happy and find necessary configuration files. Actually, XDG_DATA_DIRS environment variable value we provided with is already correct (it's getting prepared for us in https://github.com/canonical/mesa-2404/blob/main/scripts/bin/gpu-2404-provider-wrapper.in and https://git.launchpad.net/~canonical-kernel-snaps/canonical-kernel-snaps/+git/kernel-snaps-u24.04/tree/hooks/kernel-gpu-2404-provider-mangler?h=pc-components) but for some reason nvidia-container-toolkit library expects these path to be relative to driver root, which leads to a situation when driver root is getting appended twice to a path and files can not be found. One possible (and clean) solution would be to explicitly specify config files seach path with nvcdi.WithConfigSearchPaths() but it doesn't work because of a bug NVIDIA/nvidia-container-toolkit#847. So the easiest way I found is to adjust XDG_DATA_DIRS variable in that weird way so when nvidia-container-toolkit prepend driverRoot to it a final path became valid and everything works. Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com> (cherry picked from commit 5e9629b)
After we've got NVIDIA/nvidia-container-toolkit#847 merged we can use WithConfigSearchPaths() nvcdi option to specify where NVIDIA configuration files are located and revert our previous hacky fix from canonical/lxd-pkg-snap#679 No behavior change for non-Ubuntu Core environment intended. Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
…15027) After we've got NVIDIA/nvidia-container-toolkit#847 merged we can use WithConfigSearchPaths() nvcdi option to specify where NVIDIA configuration files are located and revert our previous hacky fix from canonical/lxd-pkg-snap#679 No behavior change for non-Ubuntu Core environment intended. Please, merge with canonical/lxd-pkg-snap#739
After we've got NVIDIA/nvidia-container-toolkit#847 merged we can use WithConfigSearchPaths() nvcdi option to specify where NVIDIA configuration files are located and revert our previous hacky fix from canonical/lxd-pkg-snap#679 No behavior change for non-Ubuntu Core environment intended. Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com> (cherry picked from commit 16777c1)
Without this fix it's not possible to use a custom config search path option with nvcdi interface.