nanoporetech / medaka

Sequence correction provided by ONT Research
https://nanoporetech.com
Other
391 stars 73 forks source link

Need help with 'AVX instructions not available' error #502

Closed benn888 closed 1 month ago

benn888 commented 2 months ago

Hi there,

I used pip to install medaka on a Virtualbox VM Ubuntu 22.04. The host machine runs on Windows 11 and has access to AVX instructions. However, when I try to run medaka_consensus, I get this error:

Running medaka consensus Cannot import pyabpoa, some features may not be available. The TensorFlow library was compiled to use AVX instructions, but these aren't available on your machine. /path_to_conda_env/bin/medaka_consensus : ligne 171 : 9540 Abandon (core dumped) ...

AVX instructions seem indeed not to be available on the Ubuntu guest machine: I get nothing when I do grep "avx" /proc/cpuinfo According to my readings, this is an issue with Virtualbox which does not enable AVX on the guest machine.

Hence, I would like to know how to get rid of this error?

1) I am very new to this field but I think I understand that compiling a tensorflow version not requiring AVX instructions could help. Am I right? And if so, would medaka still run without AVX ? If this is a valid option, could you please provide information on how to compile tensorflow without AVX ? As I said, I am completely new to this field :)

2) Would installing medaka from source rather than from pip be a solution? I actually tried to install it that way too but I got this error message at the make install step:

test -d venv || python3 -m venv venv --prompt "medaka" Error: [Errno 1] Operation not permitted: 'lib' -> '/media/sf_Win_Ub_shared_folder/medaka/venv/lib64' make: *** [Makefile:149 : venv/bin/activate] Error 1

Running sudo make install brought me a bit further but I got another message:

test -d venv || python3 -m venv venv --prompt "medaka" . ./venv/bin/activate && pip install pip wheel --upgrade /bin/sh: 1: .: cannot open ./venv/bin/activate: No such file make: *** [Makefile:150 : venv/bin/activate] Error 2

If installing medaka from source can help solving the no-AVX issue, what should I do to have a proper installation without the above error encountered at the make install step?

Thank you in advance for your help!

cjw85 commented 2 months ago

This is fairly common for virtual machines not to support long vector instructions.

On Windows you might like to try Windows Subsystem for Linux to run a Ubuntu environment. It uses Windows native hypervisor and I believe allows access to full CPU instruction sets.

benn888 commented 2 months ago

WSL was indeed the solution to avoid restrictions of VM, it worked perfectly!

Thanks so much for your help!