Skip to content
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

Can't load libdl on Linux (Ubuntu Jammy Jellyish) #34

Open
20kdc opened this issue Mar 5, 2022 · 1 comment
Open

Can't load libdl on Linux (Ubuntu Jammy Jellyish) #34

20kdc opened this issue Mar 5, 2022 · 1 comment

Comments

@20kdc
Copy link

20kdc commented Mar 5, 2022

I get this with Veldrid 4.8.0 on .NET 6:

20kdc@Magnus:~/Documents/External/space-station-14$ dotnet run --project Pow3r
Renderer: Veldrid
Veldrid API: Vulkan
Fullscreen: False
VSync: True
Unhandled exception. System.TypeInitializationException: The type initializer for 'Vulkan.VulkanNative' threw an exception.
 ---> System.DllNotFoundException: Unable to load shared library 'libdl' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibdl: cannot open shared object file: No such file or directory
   at Vulkan.Libdl.dlerror()
   at Vulkan.NativeLibrary.UnixNativeLibrary.LoadLibrary(String libraryName)
   at Vulkan.NativeLibrary..ctor(String libraryName)
   at Vulkan.NativeLibrary.UnixNativeLibrary..ctor(String libraryName)
   at Vulkan.NativeLibrary.Load(String libraryName)
   at Vulkan.VulkanNative.LoadNativeLibrary()
   at Vulkan.VulkanNative..cctor()
   --- End of inner exception stack trace ---
   at Veldrid.Vk.VulkanUtil.EnumerateInstanceLayers()
   at Veldrid.Vk.VkGraphicsDevice.CreateInstance(Boolean debug, VulkanDeviceOptions options)
   at Veldrid.Vk.VkGraphicsDevice..ctor(GraphicsDeviceOptions options, Nullable`1 scDesc, VulkanDeviceOptions vkOptions)
   at Veldrid.Vk.VkGraphicsDevice..ctor(GraphicsDeviceOptions options, Nullable`1 scDesc)
   at Veldrid.GraphicsDevice.CreateVulkan(GraphicsDeviceOptions options, VkSurfaceSource surfaceSource, UInt32 width, UInt32 height)
   at Pow3r.Program.InitVeldrid() in /home/20kdc/Documents/External/space-station-14/Pow3r/Program.Veldrid.cs:line 101
   at Pow3r.Program.InitRenderer() in /home/20kdc/Documents/External/space-station-14/Pow3r/Program.cs:line 357
   at Pow3r.Program.Run(String[] args) in /home/20kdc/Documents/External/space-station-14/Pow3r/Program.cs:line 210
   at Pow3r.Program.Main(String[] args) in /home/20kdc/Documents/External/space-station-14/Pow3r/Program.cs:line 380

I don't know what particular part of this is important here, but looking at 14eee15 makes me think it's a case of a change fixing MacOS only to break Linux support.
(Obviously I can't be certain of that without recompiling stuff and working out how to use a modified Nuget package locally. If you have any instructions in that regard, send them.)

@Beyley
Copy link

Beyley commented Mar 24, 2022

I get this with Veldrid 4.8.0 on .NET 6:

20kdc@Magnus:~/Documents/External/space-station-14$ dotnet run --project Pow3r
Renderer: Veldrid
Veldrid API: Vulkan
Fullscreen: False
VSync: True
Unhandled exception. System.TypeInitializationException: The type initializer for 'Vulkan.VulkanNative' threw an exception.
 ---> System.DllNotFoundException: Unable to load shared library 'libdl' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibdl: cannot open shared object file: No such file or directory
   at Vulkan.Libdl.dlerror()
   at Vulkan.NativeLibrary.UnixNativeLibrary.LoadLibrary(String libraryName)
   at Vulkan.NativeLibrary..ctor(String libraryName)
   at Vulkan.NativeLibrary.UnixNativeLibrary..ctor(String libraryName)
   at Vulkan.NativeLibrary.Load(String libraryName)
   at Vulkan.VulkanNative.LoadNativeLibrary()
   at Vulkan.VulkanNative..cctor()
   --- End of inner exception stack trace ---
   at Veldrid.Vk.VulkanUtil.EnumerateInstanceLayers()
   at Veldrid.Vk.VkGraphicsDevice.CreateInstance(Boolean debug, VulkanDeviceOptions options)
   at Veldrid.Vk.VkGraphicsDevice..ctor(GraphicsDeviceOptions options, Nullable`1 scDesc, VulkanDeviceOptions vkOptions)
   at Veldrid.Vk.VkGraphicsDevice..ctor(GraphicsDeviceOptions options, Nullable`1 scDesc)
   at Veldrid.GraphicsDevice.CreateVulkan(GraphicsDeviceOptions options, VkSurfaceSource surfaceSource, UInt32 width, UInt32 height)
   at Pow3r.Program.InitVeldrid() in /home/20kdc/Documents/External/space-station-14/Pow3r/Program.Veldrid.cs:line 101
   at Pow3r.Program.InitRenderer() in /home/20kdc/Documents/External/space-station-14/Pow3r/Program.cs:line 357
   at Pow3r.Program.Run(String[] args) in /home/20kdc/Documents/External/space-station-14/Pow3r/Program.cs:line 210
   at Pow3r.Program.Main(String[] args) in /home/20kdc/Documents/External/space-station-14/Pow3r/Program.cs:line 380

I don't know what particular part of this is important here, but looking at 14eee15 makes me think it's a case of a change fixing MacOS only to break Linux support. (Obviously I can't be certain of that without recompiling stuff and working out how to use a modified Nuget package locally. If you have any instructions in that regard, send them.)

Known issue, a temporary fix is to make a soft link from /usr/lib/libdl.so.2 -> /usr/lib/libdl.so

Tacodiva added a commit to Tacodiva/TdVk that referenced this issue Dec 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants