native-diffusion icon indicating copy to clipboard operation
native-diffusion copied to clipboard

Error: Buffer must not exceed 256MB

Open charvoa opened this issue 3 years ago • 4 comments

Steps to reproduce :

Created a new projet Added native-diffusion as a dependency (branch: master)

Download pre-converted bins here : https://drive.google.com/file/d/1EU_qxlF-p6XrxsoACvcI2CAmu45NphAC/view?usp=share_link

Copy/Pasted code from Readme.md, and chanded it to localUrl :

let path = URL(fileURLWithPath: "/Users/xyz/Downloads/bins")
do {
  try await sd.prepModels(localUrl: path)
}

I launch the app, I type "astronaut cat" in the TextField. And after a few seconds I got this error :

-[MTLDebugHeap newBufferWithLength:options:]:123: failed assertion `Buffer Validation
newBufferWith*:length 0x20000000 must not exceed 256 MB.

charvoa avatar Dec 20 '22 09:12 charvoa

Hi, which OS/version and RAM available? Have you tried the low memory option?

mortenjust avatar Dec 20 '22 09:12 mortenjust

Trying on an iPhone 14 Pro simulator (iOS 16.0) , on my MBP 16-inch 2021 M1 Pro (16GB) with macOS 13.0.

And I added the "Increased Memory Limit" capability to the target

charvoa avatar Dec 20 '22 09:12 charvoa

@charvoa Have you solved this problem? I had the same problem on 14 Pro simulator(iOS 16.2), but on macOS 13.1 worked.

jiangdi0924 avatar Dec 28 '22 09:12 jiangdi0924

@charvoa Have you solved this problem? I had the same problem on 14 Pro simulator(iOS 16.2), but on macOS 13.1 worked.

saveMemoryButBeSlower = true , will be work

jiangdi0924 avatar Dec 28 '22 14:12 jiangdi0924