Skip to content

Commit 347e8a7

Browse files
almarkleinKorijn
andauthored
Move details on installation and requirements to docs (#337)
* Move details on installation and requirements to docs * tweaks * fmt --------- Co-authored-by: Korijn van Golen <[email protected]>
1 parent 0b54483 commit 347e8a7

File tree

2 files changed

+66
-50
lines changed

2 files changed

+66
-50
lines changed

README.md

Lines changed: 6 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ and the other [examples](https://github.com/pygfx/wgpu-py/blob/main/examples/).
2929

3030
## Status
3131

32-
> **Note**
32+
> **Note**
3333
>
3434
> The wgpu-API has not settled yet, use with care!
3535
@@ -44,48 +44,19 @@ and the other [examples](https://github.com/pygfx/wgpu-py/blob/main/examples/).
4444

4545
## Installation
4646

47-
```
48-
pip install wgpu
49-
```
50-
51-
The wheels include the prebuilt binaries of [wgpu-native](https://github.com/gfx-rs/wgpu-native).
52-
53-
Note that on Linux you need to use at least **pip >= 20.3**, and a recent
54-
distribution, otherwise the binaries will not be available. See "platform
55-
requirements" for details.
56-
57-
If you need/want to build wgpu-native yourself, you need to set the environment variable
58-
`WGPU_LIB_PATH` to let wgpu-py know where the DLL is located.
5947

60-
You may also want to install a GUI backend:
6148
```
62-
pip install glfw # a lightweight backend for the desktop
63-
pip install jupyter_rfb # only if you plan on using wgpu in Jupyter
49+
pip install wgpu glfw
6450
```
6551

66-
## Platform requirements
67-
68-
Under the hood, `wgpu` runs on Vulkan, Metal, or DX12. The wgpu-backend is
69-
selected automatically, but can be overridden by setting the `WGPU_BACKEND_TYPE`
70-
environment variable to "Vulkan", "Metal", "D3D12", "D3D11", or "OpenGL".
71-
72-
On Windows 10+, things should just work. On older Windows versions you may need
73-
to install the Vulkan drivers. You may want to force "Vulkan" while "D3D12" is
74-
less mature.
75-
76-
On MacOS you need at least 10.13 (High Sierra) to have Vulkan support.
77-
78-
On Linux, it's advisable to install the proprietary drivers of your GPU (if you
79-
have a dedicated GPU). You may need to `apt install mesa-vulkan-drivers`.
80-
Wayland support is currently broken (we could use a hand to fix this).
52+
Linux users should make sure that **pip >= 20.3**. That should do the
53+
trick on most systems. See [getting started](https://wgpu-py.readthedocs.io/en/stable/start.html)
54+
for details.
8155

82-
**Note that on Linux, binary wheels are only available for manylinux_2_24**. That
83-
means you can only install the binaries with **pip >= 20.3**, and need to use a recent distribution, listed [here](https://github.com/pypa/manylinux#manylinux). If you wish to work with an older distribution, you will have to build the [wgpu-native](https://github.com/gfx-rs/wgpu-native) library yourself, and point wgpu-py to the
84-
resulting binary using the `WGPU_LIB_PATH` environment variable.
8556

8657
## Usage
8758

88-
Also see the [online documentation](https://wgpu-py.readthedocs.io).
59+
Also see the [online documentation](https://wgpu-py.readthedocs.io) and the [examples](https://github.com/pygfx/wgpu-py/tree/main/examples).
8960

9061
The full API is accessable via the main namespace:
9162
```py

docs/start.rst

Lines changed: 60 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,69 @@ Installation
1010
pip install wgpu
1111
1212
13-
Dependencies
14-
------------
13+
Python 3.7 or higher is required. Pypy is supported. Only depends on ``cffi`` (installed automatically by pip).
14+
15+
16+
The wgpu-native library
17+
-----------------------
18+
19+
The wheels include the prebuilt binaries of `wgpu-native <https://github.com/gfx-rs/wgpu-native>`_.
20+
21+
On Linux you need at least **pip >= 20.3**, and a recent Linux distribution, otherwise the binaries will not be available. See *platform requirements* for details.
22+
23+
If you need/want, you can also `build wgpu-native yourself <https://github.com/gfx-rs/wgpu-native/wiki/Getting-Started>`_.
24+
You will then need to set the environment variable ``WGPU_LIB_PATH`` to let wgpu-py know where the DLL is located.
25+
26+
27+
GUI libraries
28+
-------------
29+
30+
Most users will want to render something to screen. To this end we recommend:
31+
32+
.. code-block:: bash
1533
16-
* Python 3.7 or higher is required. Pypy is supported.
17-
* The required ``wgpu-native`` library is distributed as part of the ``wgpu-py`` package.
18-
* The only other dependency is ``cffi`` (installed automatically by pip).
34+
pip install glfw
1935
36+
Multiple GUI backends are supported though:
2037

21-
System requirements
22-
-------------------
38+
* `glfw <https://github.com/FlorianRhiem/pyGLFW>`_: a lightweight GUI for the desktop
39+
* `jupyter_rfb <https://jupyter-rfb.readthedocs.io/en/latest/>`_: only needed if you plan on using wgpu in Jupyter
40+
* qt (PySide6, PyQt6, PySide2, PyQt5)
41+
* wx
2342

24-
The system must be new enough to support Metal or Vulkan:
2543

26-
* Windows: fine on Windows 10, probably older Windows versions too when DX12 can be used.
27-
* MacOS: version 10.13 High Sierra or higher.
28-
* Linux: Vulkan must be available.
44+
Platform requirements
45+
---------------------
46+
47+
Under the hood, wgpu runs on Vulkan, Metal, or DX12. The wgpu-backend
48+
is selected automatically, but can be overridden by setting the
49+
``WGPU_BACKEND_TYPE`` environment variable to "Vulkan", "Metal", "D3D12",
50+
"D3D11", or "OpenGL".
51+
52+
**Windows**
53+
54+
On Windows 10+, things should just work. On older Windows versions you
55+
may need to install the Vulkan drivers.
56+
57+
**MacOS**
58+
59+
On MacOS you need at least 10.13 (High Sierra) to have Metal/Vulkan support.
60+
61+
**Linux**
62+
63+
On Linux, it's advisable to install the proprietary drivers of your GPU
64+
(if you have a dedicated GPU). You may need to ``apt install
65+
mesa-vulkan-drivers``. Wayland support is currently broken (we could use
66+
a hand to fix this).
67+
68+
Binary wheels for Linux are only available for **manylinux_2_24**.
69+
This means that the installation requires ``pip >= 20.3``, and you need
70+
a recent Linux distribution, listed `here <https://github.com/pypa/manylinux#manylinux>`_.
71+
72+
If you wish to work with an older distribution, you will have to build
73+
wgpu-native yourself, see "dependencies" above. Note that wgpu-native
74+
still needs Vulkan support and may not compile / work on older
75+
distributions.
2976

3077

3178
About this API
@@ -42,7 +89,5 @@ What's new in this version?
4289
---------------------------
4390

4491
Since the API changes with each release, and we do not yet make things
45-
backwards compatible. You may want to check the changelog when you
46-
upgrade to a newer version of wgpu:
47-
48-
https://github.com/pygfx/wgpu-py/blob/main/CHANGELOG.md
92+
backwards compatible. You may want to check the `CHANGELOG.md <https://github.com/pygfx/wgpu-py/blob/main/CHANGELOG.md>`_
93+
when you upgrade to a newer version of wgpu.

0 commit comments

Comments
 (0)