mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-01-26 15:28:10 -05:00
Show install instructions when dawn library is missing (#9059)
* Show install instructions when dawn library is missing * Handle missing dawn in ops_webgpu * Simplify * Solve f-string backlash error
This commit is contained in:
@@ -1,12 +1,16 @@
|
||||
import functools, struct
|
||||
from tinygrad.device import Compiled, Allocator, Compiler
|
||||
from tinygrad.renderer.wgsl import WGSLRenderer
|
||||
from tinygrad.helpers import round_up
|
||||
from tinygrad.helpers import round_up, OSX
|
||||
from tinygrad.runtime.autogen import webgpu
|
||||
from typing import List, Any
|
||||
import ctypes
|
||||
|
||||
instance = webgpu.wgpuCreateInstance(webgpu.WGPUInstanceDescriptor(features = webgpu.WGPUInstanceFeatures(timedWaitAnyEnable = True)))
|
||||
try:
|
||||
instance = webgpu.wgpuCreateInstance(webgpu.WGPUInstanceDescriptor(features = webgpu.WGPUInstanceFeatures(timedWaitAnyEnable = True)))
|
||||
except AttributeError:
|
||||
raise RuntimeError("Cannot find dawn library. Install it with: " + ("brew tap wpmed92/dawn && brew install dawn" if OSX else
|
||||
"sudo curl -L https://github.com/wpmed92/pydawn/releases/download/v0.1.6/libwebgpu_dawn.so -o /usr/lib/libwebgpu_dawn.so"))
|
||||
|
||||
def to_c_string(_str): return ctypes.create_string_buffer(_str.encode('utf-8'))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user