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

wgpu库进行计算着色器(Compute Shader)编译时出现了错误 #25

Closed
TralMac opened this issue Aug 18, 2023 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@TralMac
Copy link

TralMac commented Aug 18, 2023

2023-08-18T04:24:01.957Z WARN [wgpu::backend::direct] Shader translation error for stage ShaderStages(COMPUTE): HLSL: Unimplemented("write_expr_math Unpack4x8unorm")
2023-08-18T04:24:01.958Z WARN [wgpu::backend::direct] Please report it to https://github.com/gfx-rs/naga
2023-08-18T04:24:01.958Z ERROR [wgpu::backend::direct] Handling wgpu errors as fatal by default
thread 'main' panicked at 'wgpu error: Validation Error

Caused by:
In Device::create_compute_pipeline
note: label = matmul
Internal error: HLSL: Unimplemented("write_expr_math Unpack4x8unorm")

', C:\Users\runneradmin.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-0.16.3\src\backend\direct.rs:3019:5
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

以下为openai给出的解释:
根据您提供的错误消息,看起来是在使用wgpu库进行计算着色器(Compute Shader)编译时出现了错误。

错误消息中指出了一个HLSL(High-Level Shading Language)编译错误,具体是关于未实现的功能:"Unimplemented("write_expr_math Unpack4x8unorm")"。这可能表示您的计算着色器中使用了HLSL中尚未实现的操作或函数。

解决此问题的步骤如下:

  1. 报告问题:根据错误消息中的提示,您可以将此问题报告给wgpu库的开发者,以便他们了解到该功能尚未实现,并可能提供修复或解决方案。您可以访问https://github.com/gfx-rs/naga并提交一个新的issue。

  2. 检查计算着色器代码:检查您的计算着色器代码,特别关注使用了"Unpack4x8unorm"操作或函数的地方。如果可能,尝试使用其他可用的操作或函数替代。

  3. 版本更新:确保您正在使用wgpu库的最新版本。可能已经有人报告了这个问题,并且在更新的版本中可能已经得到修复。

  4. 回溯信息:根据错误消息中的提示,您可以设置环境变量RUST_BACKTRACE为1,以显示完整的回溯信息。这可能会提供更多关于错误发生位置的信息,帮助您进行故障排除。

我已经是最新驱动了,请问该怎么解决😔

@cgisky1980
Copy link
Member

可否贴出GPU型号,还有运行的模型型号、 启动命令等信息帮助定位问题

@cryscan
Copy link
Collaborator

cryscan commented Aug 25, 2023

你使用的是DX12模式,目前该模式编译Shader是有问题。正在考虑提供预编译的Spir-V Shader,之后版本会有。

@cryscan cryscan added the bug Something isn't working label Aug 25, 2023
@cryscan cryscan closed this as completed Nov 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants