Open tymokvo opened 2 years ago
Hey, glad to see you here, we never actually had aardvark running on Fedora yet, so some issues were to be expected sadly.
The OpenGL problem looks pretty weird to me since the OpenGL 4.6 working
print already created a hidden window to determine whether or not that works. It may be related to some particular window-hint we use. Sadly these things tend to be pretty involved, but you could try removing window-hints until something works (in Aardvark.Application.Slim.GL)
The vulkan problem could possibly be related to the use of a different UI framework but essentially we just use GLFWs functionality for vulkan interop. Could you share the log output prior to the error?
Maybe I can install Fedora on one of my machines, but sadly I'm quite busy at the Moment. Maybe @hyazinthh has some more ideas what happens here, he always keeps things running on linux.
strange, i have never seen glfw to fail except for headless scenarios. do vulkaninfo or glxinfo/glxgears work?
vulkaninfo
works, but there are a lot of features set to false.
Here is the (long) log output from running with the Vulkan
backend:
glxinfo
and glxgears
both work.
I'm also running on X11 if that matters.
The GL issue should be fixed now.
Awesome! I looked into trying it, but I don't know paket
very well and haven't been able to figure out how to use the Aardvark.Rendering
git repo as the package source for the demo since it looks like the nuget package isn't updated with that patch yet.
We released new packages (5.2.8) which contain the fix, please let us know if this resolves the GL issue for you.
I updated the packages with paket update
, ran HelloWorld
(which got a bit further!) but got a new error:
0: initializing aardvark ....................................................
0: System Information:
0: System: Linux 5.18.13-100.fc35.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jul 22 14:20:24 UTC 2022
0: Processor: 8 core x64
0: Process: x64
0: Framework: .NET Core 3.1.27
0: Loading plugins ........................................................
0: WARNING: [LoadPlugins] could not load plugins: Could not load file or assembly 'System.Reflection.Metadata, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
0: Loading plugins ................................................ 0.050 s
0: initializing CustomPicklerProvider ............................. 0.678 s
0: initializing Constants ......................................... 0.014 s
0: initializing PixImageSharp ..................................... 0.042 s
0: initializing aardvark .................................... [0.60x] 2.791 s
0: OpenGL 4.6 working
0: initializing OpenGL runtime ..............................................
0: vendor: "Intel"
0: renderer: "Mesa Intel(R) Xe Graphics (TGL GT2)"
0: version: OpenGL 4.6.0 / GLSL 4.6.0 Core
0: initializing OpenGL runtime ...................................... 0.235 s
Unhandled exception. System.Exception: mprotect failed
at Aardvark.Base.ExecutableMemory.alloc(IntPtr size)
at Aardvark.Rendering.Management.MemoryManager`1..ctor(Memory`1 mem, IntPtr initialCapacity)
at Aardvark.Rendering.GL.ChangeableProgram.FragmentProgram..ctor()
at Aardvark.Rendering.GL.Command.arg20@1265-1(Command x, CompilerInfo info, AdaptiveToken token)
at Aardvark.Rendering.GL.Command.Command.Update(AdaptiveToken token, CompilerInfo info)
at Aardvark.Rendering.GL.RenderTasks.NewRenderTask.ProcessDeltas(AdaptiveToken token, RenderToken renderToken)
at Aardvark.Rendering.GL.RenderTasks.AbstractOpenGlRenderTask.Perform(AdaptiveToken token, RenderToken renderToken, OutputDescription desc)
at <StartupCode$Aardvark-Rendering>.$AbstractRenderTask.Run@87-3.Invoke(AdaptiveToken token)
at Aardvark.Rendering.AbstractRenderTask.UseValues[a](AdaptiveToken token, OutputDescription output, FSharpFunc`2 f)
at <StartupCode$Aardvark-Rendering>.$AbstractRenderTask.arg10@83-9(AbstractRenderTask x, RenderToken renderToken, OutputDescription out, AdaptiveToken token)
at <StartupCode$Aardvark-Rendering>.$AbstractRenderTask.action@1-47(AbstractRenderTask x, AdaptiveToken token, RenderToken renderToken, OutputDescription out, Unit _arg1)
at Aardvark.Rendering.AbstractRenderTask.Run(AdaptiveToken token, RenderToken renderToken, OutputDescription out)
at Aardvark.Rendering.AbstractRenderTask.Aardvark.Rendering.IRenderTask.Run(AdaptiveToken token, RenderToken renderToken, OutputDescription out)
at Aardvark.Application.Slim.OpenGL.createSwapchain@210-1.Invoke(RenderingLockDisposable _arg2)
at Microsoft.FSharp.Core.Operators.Using[T,TResult](T resource, FSharpFunc`2 action) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\prim-types.fs:line 4750
at Aardvark.Application.Slim.OpenGL.createSwapchain@206.Aardvark.Glfw.ISwapchain.Run(IRenderTask task, IQuery query)
at Aardvark.Glfw.Window.Redraw()
at Aardvark.Glfw.Application.Run(Window[] ws)
at Aardvark.Glfw.Window.Run()
at Aardvark.Glfw.Window.Aardvark.Application.IRenderWindow.Run()
at Aardvark.Application.Utilities.SimpleRenderWindow.Run(FSharpOption`1 preventDisposal)
at Program.main(String[] argv)
Hey, we never tested it on a fedora, but I think we're not too far away from seeing something. You could for the moment try to use the vulkan backend since it doesn't need that particular feature.
If you want to help us out you could try to run the tests/demo in https://github.com/aardvark-community/aardvark.assembler and see if those crash too
Will do! I actually tried Vulkan too and it also crashed. But, figured it was easier to focus on one code path at a time.
Maybe nothing, but the log says
Framework: .NET Core 3.1.27
and then it tries to load net5.0 assembly
Could not load file or assembly 'System.Reflection.Metadata, Version=5.0.0.0,
Could this just be some package dependency/resolve problem?
@tymokvo If you let paket resolve everything from scratch in your project, does this change anything? E.g.
cd <your-project>
git clean -dxf
rm paket.lock
dotnet paket install
./build.sh
... or, alternatively, is it possible to up upgrade your project to net6.0?
I'll give it a go!
I did a little research and it may be that fedora prohibts executable&writable memory. We've had a similar issue on Mac M1, so I 'll setup a VM and test that once I have the time. However if the Aardvark.Assembler demo/tests run without crashing my theory is wrong
I ran the Aardvark.Assembler
tests (just with dotnet test
in the root of the repo, if that's the right way) and got all greens.
Running the demo (with dotnet run -c Release src/Demo/Demo.fsproj
) failed with a similar mprotect failed
error:
0: initializing aardvark ....................................................
0: System Information:
0: System: Linux 5.18.13-100.fc35.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jul 22 14:20:24 UTC 2022
0: Processor: 8 core x64
0: Process: x64
0: Framework: .NET 6.0.6
0: Loading plugins ................................................ 0.109 s
0: initializing CustomPicklerProvider ............................. 0.283 s
0: initializing Constants ......................................... 0.014 s
0: initializing aardvark .................................... [0.20x] 0.619 s
Unhandled exception. System.Exception: mprotect failed
at Aardvark.Base.ExecutableMemory.alloc(IntPtr size)
at <StartupCode$Aardvark-Assembler>.$FragmentProgram.-cctor@28.Invoke(IntPtr size)
at Aardvark.Base.MemoryManager..ctor(IntPtr capacity, MemoryManagerConfig config)
at Aardvark.Assembler.FragmentProgram`1..ctor(Boolean differential, FSharpFunc`2 compile)
Thanks for trying, so I guess I won't get around setting up a fedora VM to fix this. Thankfully it happens without any GPU involvement s.t. i don't need a native machine...
I will pursue the issue when I have a little time left and will get back to you. (Might be a few days)
The fix should be fairly easy if my suspicions are confirmed...
Hey, I had a little time today and may have a potential fix.
There's a branch here called fedora-bug
which might work (updated packages).
Please test!
I tested it on my native Manjaro (Arch) machine and it worked, the old version crashed just like yours (however i had to upgrade the projects to net6.0)
Awesome, will do! How do I upgrade them to net6.0? Just change the TargetFramework
in the .fsproj
?
Awesome, the patch on fedora-bug
works, thank you! And even when using the netcoreapp3.1
build.
I added the output here in case it is useful at all. It still has the warning about System.Reflection.Metadata 5.0.0.0
that @stefanmaierhofer pointed out, but it doesn't seem to be an issue.
Glad to see something working. I just pushed updated project files (net6.0) with some minor fixes for linux (wrong file-paths, etc.)
Nice, that is working well for GL. Vulkan is still an issue though. But the GL performance seems pretty great for the hardware I'm using so that's minor.
0: WARNING: [Vulkan] renderpass order BackToFront not implemented
0: [Vulkan] using 1 descriptor pools
0: ERROR: [Vulkan] could not allocate DescriptorSet (-1000069000)
Unhandled exception. System.Exception: [Vulkan] could not allocate DescriptorSet (-1000069000)
at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1433.Invoke(String message) in D:\workspace\_work\1\s\src\fsharp\FSharp.Core\printf.fs:line 1433
at Aardvark.Rendering.Vulkan.Utilities.check(String str, VkResult err)
at Aardvark.Rendering.Vulkan.DescriptorSetModule.f@41-148(DescriptorSetLayout layout, DescriptorPool pool, VkDescriptorSetAllocateInfo* pInfo, VkDescriptorSet* pHandle)
at Aardvark.Rendering.Vulkan.DescriptorSetModule.f@41-147(DescriptorSetLayout layout, DescriptorPool pool, VkDescriptorSetAllocateInfo* pInfo)
at Aardvark.Rendering.Vulkan.DescriptorSetModule.f@41-146(DescriptorSetLayout layout, DescriptorPool pool, VkDescriptorSetLayout* pLayoutHandle)
at Aardvark.Rendering.Vulkan.DescriptorSetModule.action@1-41(DescriptorSetLayout layout, DescriptorPool pool, Unit unitVar0)
at Aardvark.Rendering.Vulkan.DescriptorSetModule.tryAlloc(DescriptorSetLayout layout, DescriptorPool pool)
at <StartupCode$Aardvark-Rendering-Vulkan>.$DescriptorSet.CreateDescriptorSet@325.Invoke(DescriptorSetLayout layout, DescriptorPool pool)
at <StartupCode$Aardvark-Rendering-Vulkan>.$DescriptorSet.action@1-38(DescriptorPoolBag x, FSharpFunc`2 tryAllocSet, DescriptorSetLayout layout, Unit unitVar0)
at Aardvark.Rendering.Vulkan.DescriptorPoolBag.CreateSet(DescriptorSetLayout layout, FSharpFunc`2 tryAllocSet)
at Aardvark.Rendering.Vulkan.ContextDescriptorSetExtensions.CreateDescriptorSet(Device this, DescriptorSetLayout layout)
at Aardvark.Rendering.Vulkan.Resources.DescriptorSetResource.GetHandle(AdaptiveToken token, RenderToken renderToken)
at Aardvark.Rendering.Vulkan.AbstractResourceLocation`1.Update(AdaptiveToken token, RenderToken renderToken)
at Aardvark.Rendering.Vulkan.AbstractResourceLocation`1.Aardvark.Rendering.Vulkan.IResourceLocation<'a>.Update(AdaptiveToken t, RenderToken rt)
at Aardvark.Rendering.Vulkan.Resources.DescriptorSetBindingResource.Compute(AdaptiveToken token, RenderToken renderToken)
at Aardvark.Rendering.Vulkan.AbstractPointerResource`1.GetHandle(AdaptiveToken token, RenderToken renderToken)
at Aardvark.Rendering.Vulkan.AbstractResourceLocation`1.Update(AdaptiveToken token, RenderToken renderToken)
at Aardvark.Rendering.Vulkan.AbstractResourceLocation`1.Aardvark.Rendering.Vulkan.IResourceLocation.Update(AdaptiveToken t, RenderToken rt)
at <StartupCode$Aardvark-Rendering-Vulkan>.$ResourceManager.arg20@1974(ResourceLocationReader x, RenderToken renderToken, AdaptiveToken t)
at <StartupCode$Aardvark-Rendering-Vulkan>.$ResourceManager.arg10@1-1(ResourceLocationReader x, RenderToken renderToken, AdaptiveToken token)
at Aardvark.Rendering.Vulkan.ResourceLocationReader.Update(AdaptiveToken token, RenderToken renderToken)
at <StartupCode$Aardvark-Rendering-Vulkan>.$ResourceManager.run@2048-12(ResourceLocationSet x, RenderToken renderToken, AdaptiveToken t, Boolean changed)
at <StartupCode$Aardvark-Rendering-Vulkan>.$ResourceManager.arg10@2045-2(ResourceLocationSet x, RenderToken renderToken, AdaptiveToken t)
at Aardvark.Rendering.Vulkan.ResourceLocationSet.Update(AdaptiveToken token, RenderToken renderToken)
at Aardvark.Rendering.Vulkan.CommandTask.Perform(AdaptiveToken token, RenderToken renderToken, OutputDescription desc)
at <StartupCode$Aardvark-Rendering>.$AbstractRenderTask.Run@87-3.Invoke(AdaptiveToken token)
at <StartupCode$Aardvark-Rendering>.$AbstractRenderTask.arg10@83-9(AbstractRenderTask x, RenderToken renderToken, OutputDescription out, AdaptiveToken token)
at <StartupCode$Aardvark-Rendering>.$AbstractRenderTask.action@1-47(AbstractRenderTask x, AdaptiveToken token, RenderToken renderToken, OutputDescription out, Unit _arg1)
at Aardvark.Rendering.AbstractRenderTask.Run(AdaptiveToken token, RenderToken renderToken, OutputDescription out)
at Aardvark.Rendering.AbstractRenderTask.Aardvark.Rendering.IRenderTask.Run(AdaptiveToken token, RenderToken renderToken, OutputDescription out)
at Aardvark.Application.Slim.Vulkan.createSurface@73-2.Invoke(Framebuffer fbo)
at <StartupCode$Aardvark-Rendering-Vulkan>.$Swapchain.f@248-213(Swapchain x, FSharpFunc`2 render, TokenCommandBuilder builder@, Framebuffer framebuffer, ImageView colorView, FSharpRef`1 currentImage, FSharpRef`1 backbuffer, Unit _arg7)
at <StartupCode$Aardvark-Rendering-Vulkan>.$Swapchain.f@248-212(Swapchain x, FSharpFunc`2 render, TokenCommandBuilder builder@, Framebuffer framebuffer, ImageView colorView, FSharpOption`1 depthView, FSharpRef`1 currentImage, FSharpRef`1 backbuffer, Unit _arg5)
at <StartupCode$Aardvark-Rendering-Vulkan>.$Swapchain.RenderFrame@223-1.Invoke(Unit unitVar)
at Aardvark.Rendering.Vulkan.CommandAPI.TokenCommandBuilder.Run[a](FSharpFunc`2 f)
at <StartupCode$Aardvark-Rendering-Vulkan>.$Swapchain.action@1-48(Swapchain x, FSharpFunc`2 render, Unit unitVar0)
at Aardvark.Rendering.Vulkan.Swapchain.RenderFrame(FSharpFunc`2 render)
at Aardvark.Glfw.Window.Redraw()
at Aardvark.Glfw.Application.Run(Window[] ws)
at Aardvark.Glfw.Window.Run()
at Aardvark.Glfw.Window.Aardvark.Application.IRenderWindow.Run()
at Aardvark.Application.Utilities.SimpleRenderWindow.Run(FSharpOption`1 preventDisposal)
at Program.main(String[] argv)
Btw, (this is unrelated but I didn't see another repo in your org to raise this) the https://aardworx.com/ domain seems to have an invalid TLS cert. Both Firefox and curl
refuse to connect.
Hey, I'll forward the issue with aardworx.com, but there's a lot of (not so well curated and documented) demos/examples out there at https://github.com/aardvark-platform and https://github.com/aardvark-community
These things are a bit rough around the edges but we're happy to help on discord, github, mail, github, etc
Most recently we published a simple multiplayer game made with aardvark done by two interns (with help of course)
https://github.com/aardvark-community/aardwars
It's not the tidiest code but it uses ELM-style updates for the game-logic, so it's fairly straight-forward (note that packages are not yet properly updated there)
Are the patches from the 5.2.9-prerelease0002
library versions present in versions >= 5.2.9
? I just tried starting a new dotnet cli project using 5.2.12
, but got the mprotect failed
error again.
This is what my package reference section looks like:
<PackageReference Include="Aardvark.Application" Version="5.2.12" />
<PackageReference Include="Aardvark.Application.Utilities" Version="5.2.12" />
<PackageReference Include="Aardvark.Rendering" Version="5.2.12" />
<PackageReference Include="Aardvark.Scenegraph" Version="5.2.12" />
Hey, I'll check that as soon as i have time (maybe some merge problem or i simply forgot to merge it)
Hello,
I came across Aardvark today and was trying to get started running the
HelloWorld
program on Linux (Fedora 35). Using either theGL
orVulkan
backend fails, however.I'd be happy to start a PR to update the docs with steps to resolve if someone can point me in the direction of a solution.
GL
Vulkan
Warning: long stacktrace ahead!