ITADN

Error while running the SpeedyWeather Primitivewet model on Mac M3 GPUs (following the example)

#1018OpenKNR8070 创建于 2026-03-27
K
KNR8070commented
Hi, I am trying to run the model on Mac M3 using the available GPUs. I have installed Metal and followed the steps provided in the example. I am getting the following error while setting up the model: ``` julia> architecture = SpeedyWeather.GPU() GPU(MetalBackend()) julia> spectral_grid = SpectralGrid(trunc=63, nlayers=8, architecture=architecture) SpectralGrid{Spectrum{...}, OctahedralGaussianGrid{...}} ├ Number format: Float32 ├ Spectral: T63 LowerTriangularMatrix ├ Grid: 96-ring OctahedralGaussianGrid, 10944 grid points ├ Resolution: 1.94°, 216km (at 6371km radius) ├ Vertical: 8-layer atmosphere └ Architecture: GPU(MetalBackend()) using MtlArray julia> model = PrimitiveWetModel(spectral_grid=spectral_grid) ERROR: ArgumentError: cannot take the CPU address of a MtlMatrix{Float32, Metal.PrivateStorage} Stacktrace: [1] unsafe_convert(::Type{Ptr{Float32}}, x::MtlMatrix{Float32, Metal.PrivateStorage}) @ Metal ~/.julia/packages/Metal/SVvf5/src/array.jl:268 [2] unsafe_convert(::Type{Ptr{…}}, V::SubArray{Float32, 2, MtlMatrix{…}, Tuple{…}, false}) . . . ``` How to resolve this issue? Is it something related to the GPU structure in the mac or maybe coming from the how I setup julia and speedyweather on my system??
2 条评论