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.
Coming back to the full installation, isn't it enougt to follow the instructions presented here ? https://www.youtube.com/watch?v=hvYSt4AUeJg ? In my case, unfortunately I have an error message like " <eval_with_key>.13:146:12," following this automatic installaiton.
Another point, I've seen in the discord of nod.ai that for rnda 2, we are supposed to change some parameters in windows (see below), are we supposed to do that or the installaiton changes these parameters automatically ?
In powershell set env flag $Env:AMD_ENABLE_LLPC=0
This is applicable for RDNA1 and RDNA2 users (basically 6000-series and below). LLPC=1 is only applicable for RDNA3
For win10 Go to properties on 'this pc' -> advanced system settings -> advanced tab -> environment variables
under system variables add New -> variable name should be AMD_ENABLE_LLPC and set variable value to "0" (zero).