Chrome Canary 97版本WebGPU启用方法及运行示例报错问题咨询
Hey there, I’ve actually hit this exact problem with Chrome Canary 97.0.4686.0 before—so yes, I can confirm this issue is reproducible under specific scenarios. Let’s walk through why this happens and how to get WebGPU running properly:
Double-check your flag configuration
Even if you remember enablingunsafe-webgpu, Chrome sometimes fails to apply the setting correctly. Head tochrome://flags/#enable-unsafe-webgpuand make sure it’s set to Enabled. Then, fully quit Chrome (don’t just close tabs—exit the entire application) and restart it. This step is crucial because flag changes often require a full restart to take effect.Confirm your GPU’s compatibility
WebGPU relies on your GPU supporting Vulkan (Windows/Linux) or Metal (macOS). If your GPU is outdated or doesn’t meet these requirements, Chrome will block WebGPU even with the flag turned on. You can check this by visitingchrome://gpuand looking for the "WebGPU" section. If it shows "Software only, hardware acceleration unavailable", your GPU is the bottleneck here.Clear cached data and reset browser settings
Corrupted cache or misconfigured browser settings can interfere with WebGPU’s initialization. Try clearing your cached images/files and cookies viachrome://settings/clearBrowserData, or reset Chrome to its default settings usingchrome://settings/reset. This eliminates any lingering configuration issues that might be blocking the API.Test with a fresh Chrome profile
Extensions or profile-specific tweaks can sometimes block WebGPU. Create a new profile (click your profile icon in the top-right corner → Add), then test the WebGPU samples without any extensions installed. If it works here, you’ll know an extension or custom setting in your original profile was causing the problem.
The error you’re seeing (TypeError: Cannot read property 'requestDevice' of null) occurs because navigator.gpu is returning null—meaning Chrome isn’t exposing the WebGPU API at all. This almost always ties back to one of the issues we covered above.
内容的提问来源于stack exchange,提问作者rafineria888wp

