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

Running the sample app on .NET 9 throws MissingFieldException "Field not found: '{Shader}.<buffer>P'" #893

Open
Peter-Juhasz opened this issue Dec 30, 2024 · 1 comment
Labels
regression 💥 A (breaking) change or behavioral difference in a new release

Comments

@Peter-Juhasz
Copy link

Reproduction Steps

Run "Hello world" based on https://github.com/Sergio0694/ComputeSharp/wiki/3.-Getting-started-%F0%9F%93%96 to multiply numbers in an array at once.

Or the sample app: https://github.com/Sergio0694/ComputeSharp/blob/120aff270539996ef9fc52fe46561d12da0b89d4/samples/ComputeSharp.Sample/Program.cs

Expected Behavior

The sample runs without any error just like on .NET 8.0.

Actual Behavior

Unhandled exception. System.MissingFieldException: Field not found: 'GpuLinq.MultiplyByTwo.<buffer>P'.
   at ComputeSharp.Generated.<GpuLinq_MultiplyByTwo_g>FBE22A9B254E8C5B4C31CB0BF8C793133B000321365754432B0E19EFB843B68E0__GraphicsResourcesLoader.buffer(MultiplyByTwo& value)
   at GpuLinq.MultiplyByTwo.global::ComputeSharp.Descriptors.IComputeShaderDescriptor<GpuLinq.MultiplyByTwo>.LoadGraphicsResources[TLoader](MultiplyByTwo& shader, TLoader& loader) in S:\git\disposable\GpuLinq\obj\Debug\net9.0\ComputeSharp.SourceGenerators\ComputeSharp.SourceGenerators.ComputeShaderDescriptorGenerator\GpuLinq.MultiplyByTwo.g.cs:line 102
   at ComputeSharp.ComputeContext.Run[T](Int32 x, Int32 y, Int32 z, T& shader) in /_/src/ComputeSharp/Shaders/ComputeContext.cs:line 178
   at ComputeSharp.ComputeContext.Run[T](Int32 x, T& shader) in /_/src/ComputeSharp/Shaders/ComputeContext.cs:line 127
   at ComputeSharp.GraphicsDeviceExtensions.For[T](GraphicsDevice device, Int32 x, T& shader) in /_/src/ComputeSharp/Graphics/Extensions/GraphicsDeviceExtensions.Dispatching.cs:line 26
   at GpuLinq.Program.Main(String[] args) in S:\git\disposable\GpuLinq\Program.cs:line 15

System info

This section should contain useful info such as:

  • ComputeSharp NuGet version (or branch/commit, if building from source): 3.1.0
  • Operating system version: 26100.2605
  • CPU/GPU model (the latter is especially useful for shader issues): NVIDIA GeForce RTX 4060 TI
  • Visual Studio version, or .NET SDK/runtime version: 17.13 P2.1 + .NET 9.0.100
@Peter-Juhasz Peter-Juhasz added regression 💥 A (breaking) change or behavioral difference in a new release untriaged 🧰 A new issue that needs initial triage labels Dec 30, 2024
@Sergio0694
Copy link
Owner

This is a known issue caused by a bug in .NET 9 (dotnet/runtime#109943). It's also the reason why #871 is currently still a draft. We fixed the issue in .NET 9 (and I've added some regression tests for this scenario specifically), but the fix hasn't been released yet. It should be out in .NET 9.0.2xx, which should be out sometime in February I think.

@Sergio0694 Sergio0694 removed the untriaged 🧰 A new issue that needs initial triage label Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression 💥 A (breaking) change or behavioral difference in a new release
Projects
None yet
Development

No branches or pull requests

2 participants