Build error with "python-torchvision-rocm" Package

Trying to install the “python-torchvision-rocm” Package from the AUR as a prerequisite to get my AMD RX 6600XT to work with Automatic 1111 Stable Diffusion Web UI; however I get a build error that outputs this:

[100%] Linking CXX shared library
[100%] Built target torchvision
Traceback (most recent call last):
  File "/home/username/python-torchvision-rocm/src/vision-0.14.1/", line 9, in <module>
    import torch
ModuleNotFoundError: No module named 'torch'
==> ERROR: A failure occurred in build().

Thx in advance for any help.

Did you install python-pytorch-rocm before?

No, I haven’t; however, I did install python-pytorch-opt-rocm since my CPU supports AVX2.

Which AUR helper are you using? I guess it’s using a different python env during build and can’t locate the torch package this way.

I’ve used Pamac and the manual method:

git clone
cd python-torchvision-rocm
makepkg -si

Both methods output the same error.

Please use their instructions to install it, it will do all for you, no need to install other packages as you do usually.

Apparently those instructions and the specific instructions for AMD GPUs for Arch/Arch-based Linux Distros in the Github wiki weren’t working for me when I tried run after using several of the AMD/Linux install methods; it outputted for me when using my RX 6600XT the following:

AssertionError: Torch is not able to use GPU; add -- skiptorch-cuda-test to COMMANDLINE_ARGS variable to disable this check

It essence, the torch and the application can’t see the AMD GPU.

Anyways, I found a workaround from Reddit after searching around for a few hours. After git cloning Automatic1111 Stable Diffusion UI, run this command inside the cloned directory:


The application should be able to work with an AMD GPU now.

Although, I came originally looking for a solution to fix the python-torchvision-rocm build error … I figured out how to get to the end goal which was to get Automatic 1111 Stable Diffusion Web UI running; I guess I’ll mark this fixed.

Thx again for the help guys.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.