This guide is meant for developers who want to experiment with the IREE/MLIR toolchain to compile Vulkan code. A more streamlined installation procedure (that uses precompiled .vmfb files optimized for various GPUs) would be possible, but in the interest of time, we’re sharing here instructions meant for developers.
AMD Software: Adrenalin Edition 22.11.1 for MLIR/IREE Driver Version 22.20.29.09 for Windows® 10 and Windows® 11 (Windows Driver Store Version 31.0.12029.9003)
https://www.amd.com/en/support/kb/release-notes/rn-rad-win-22-11-1-mril-iree
On a powershell with admin privileges, do the command below:
set-executionpolicy remotesigned
You’ll need Python 3.10, here’s one possible way to install it on Windows:
-
Use the
Windows Installer (64-bit)
to install Python3.10 on Windows from the official link: https://www.python.org/downloads/release/python-3100/- Important: Enable the option
Add Python 3.10 to PATH
shown during the beginning of the installation.
- Important: Enable the option
-
Download and install Git from the link here: https://git-scm.com/download/win
On a new powershell window, run the commands below:
PS C:\Users\harish> git clone https://github.com/nod-ai/SHARK
PS C:\Users\harish> cd SHARK
PS C:\Users\harish\SHARK> .\setup_venv.ps1
The last command will show the detected Python version as 3.10 in the beginning.
On the same powershell, or on a new powershell, run the commands below:
PS C:\Users\harish\SHARK> ./shark.venv/Scripts/activate
(shark.venv) PS C:\Users\harish\SHARK> cd web
(shark.venv) PS C:\Users\harish\SHARK\web> python index.py
Access Stable Diffusion on http://localhost:8080
PS C:\Users\harish\SHARK> ./shark.venv/Scripts/activate
(shark.venv) PS C:\Users\harish\SHARK> cd .\shark\examples\shark_inference\stable_diffusion\
(shark.venv) PS C:\Users\harish\SHARK\shark\examples\shark_inference\stable_diffusion> python main.py --precision="fp16" --device="vulkan" --no-import_mlir --prompt "A film still of lalaland, artwork by studio ghibli, makoto shinkai, pixv" --steps=50 --seed=123456
Image will be saved in SHARK\shark\examples\shark_inference\stable_diffusion
folder.
- In windows, you will need paths to be short, so clone the repo in your root folder of a drive.
does it support the older vega GPUs?