Wgpu: Software rendering

Created on 5 May 2020  路  9Comments  路  Source: gfx-rs/wgpu

What's the wgpu story with regards to software rendering? Would something like OSMesa work as a backend?

(Perhaps this question better belongs to the wgpu-native repo, I was unsure)

enhancement question

All 9 comments

@Korijn Current story is to rely on the SW implementations of the native backends:

  • on Vulkan there is swiftshader
  • on D3D there is a Warp adapter, which we could pick (already) if we had any sort of "software" flag in the adapter descriptor
  • on OpenGL there is OSMesa, but gfx/wgpu OpenGL backend is by itself pretty fragile still, so it needs to mature more before we can expose it and make usable.

Alright, so on Linux, I should be able to build swiftshader and run wgpu-native with it. Would that require any special settings or compiler/linker options?

It would be ideal if all it took was the presence of swiftshader as described in their docs. Is that the case for wgpu-native?

On Linux, the LD_LIBRARY_PATH environment variable or -rpath linker option can be used to direct applications to search for shared libraries in the indicated directory first.

Assuming SwiftShader can be used via the Vulkan Loader ICD interface, you'd just run your app on Linux with VK_ICD_FILENAMES=<path_to_swiftshader_icd.json>. wgpu wouldn't necessarily know that it works with swiftshader.

I'll see if I can find anything like that in their docs/source.

Thanks so far!

Edit: looks like an ICD JSON file is included in the build output: https://github.com/google/swiftshader/commit/e7ce4e53915d026720005ca2c1831a5c28f77b3f

I'll be giving this a shot sometime soon with wgpu-py in a docker container.

FWIW, last I heard, swiftshader assumes a very specific use by an application. It's not build (at least yet) as a general purpose Vulkan implementation. Rather, it's made to work well with Angle on Vulkan. So beware of dragons when you test this, but I'm following your work with anticipation :)

We'll see! :)

Just wondering if there have been any developments in this regard? :) Judging from #969 the Vulkan software renderer by mesa is still in development.

I don't think we have any actions to do here. If you want to test Mesa's LavaPipe today, you can do it. Since it's a regular Vulkan driver, no changes are needed on wgpu side.

Closing as no-action needed

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cwfitzgerald picture cwfitzgerald  路  20Comments

kvark picture kvark  路  15Comments

MarekLg picture MarekLg  路  39Comments

Aeledfyr picture Aeledfyr  路  23Comments

cloudhead picture cloudhead  路  15Comments