nanoporetech / medaka

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

illegal hardware instruction #456

Closed CFB2018 closed 1 year ago

CFB2018 commented 1 year ago

Hi,

I am having some issues analyzing my sequencing results. I have run a flonge-sequencing (flow cell type= FLO-FLG001), using base calling=high-accuracy model, 450bps, Guppy software version 6.5.7, and the chemistry type: R9.4.1. Based on the information from your latest README file, I am guessing that the model I need to fill in is: - m r941_min_high_g657.

I have installed the latest medaka v1.9.1. However, when I type the following commands in my terminal,

medaka tools list_models medaka tools download_models

I receive the following error message:

zsh: illegal hardware instruction medaka tools list_models.

Is the model description correct ? What do you believe could be the problem?

Thank you in advance. Carmen Flores Bjurström

Medaka is a Research Release.

Research releases are provided as technology demonstrators to provide early access to features or stimulate Community development of tools. Support for this software will be minimal and is only provided directly by the developers. Feature requests, improvements, and discussions are welcome and can be implemented by forking and pull requests. However much as we would like to rectify every issue and piece of feedback users may have, the developers may have limited resource for support of this software. Research releases may be unstable and subject to rapid iteration by Oxford Nanopore Technologies.

Please ensure that you are using the most recent version of medaka before filing a bug report. The most recent version can be found on the release page. If you are not using the most recent release, and file a issue regardless the most likely response from our developers will be to ask you to first upgrade.

Please ensure also to provide the information below, not doing so will likely result in a request for the information.

Describe the bug A clear and concise description of what the bug is including the command that you have run.

Logging Please attach any relevant logging messages. (Use ``` before and after code blocks).

Environment (if you do not have a GPU, write No GPU):

Additional context Add any other context about the problem here.

cjw85 commented 1 year ago
zsh: illegal hardware instruction

What computer hardware and operating system are you running medaka on? Most commonly the error above happens when trying to run medaka in a virtual machine with inadequate processor instruction support.

CFB2018 commented 1 year ago

Thank you for your input. How do I know whether the processor instruction support is inadequate? I have a MacBook Pro, the operating system is MacOS Ventura, version 13.5. The Hardware Overview:

Model Name: MacBook Pro Model Identifier: MacBookPro17,1 Model Number: Z11D0000AKS/A Chip: Apple M1 Total Number of Cores: 8 (4 performance and 4 efficiency) Memory: 16 GB System Firmware Version: 8422.141.2 OS Loader Version: 8422.141.2 Serial Number (system): FVFGC0M5Q05Q Hardware UUID: D9AEAC9F-488A-5CC9-B8B6-B7FFEEE1C897 Provisioning UDID: 00008103-000C08382220801E Activation Lock Status: Disabled

Having an Apple M1, I had to install Rosetta2, create a virtual environment and use pip to install necessary wheels and build packages always from source (with compatible versions). After doing this, I could install medaka but I still can´t run the commands.

cjw85 commented 1 year ago

I suspect your issue is arising due to the setup of Rosetta, your shell, and possibly the Python running in your shell. I know that you can find various guides on the internet that show you how to setup your shell to fool it into thinking the system is an x86_64 system and not ARM. My advice is do not follow these guides; embrace the fact that your MacOS device is ARM-based.

I am imagining that you've created a somewhat confused setup where various x86_64 packages have been installed that contain code which Rosetta cannot translate to native ARM instructions.

CFB2018 commented 1 year ago

Yes that could very well be the reason. I will give it another try after removing Rosetta iand see if I get it to work. Thank you.

cjw85 commented 1 year ago

If you can share your terminal output from setting up a virtual environment and installing medaka then I may be able to advise further.

CFB2018 commented 1 year ago

Thanks! I have removed Rosetta2. First I used homebrew to create a virtual environment and manage packages w dependencies. However, I get this error message: Error: Cannot install in Homebrew on ARM processor in Intel default prefix (/usr/local)! Therefore I started over using conda, but somehow when I want to type the command make install (after cloning from the git repo), I get this message: grep: medaka/init.py: No such file or directory Installing prerequisites with homebrew brew install pkg-config hdf5@1.12 openssl@3 Warning: No available formula with the name "hdf5@1.12". Did you mean hdf5@1.10 or hdf5@1.8? ==> Searching for similarly named formulae and casks... ==> Formulae hdf5@1.10 hdf5@1.8

To install hdf5@1.10, run: brew install hdf5@1.10 make: *** [pyprep-m1] Error 1

Can I not use homebrew or conda on this computer?

cjw85 commented 1 year ago

Hi again Carmen,

Can I enquire what you are ultimately trying to achieve? It may be that we can provide the software packaged in a more useful form for you to use.

What data are you starting from? What scientific result are you trying to reach?

CFB2018 commented 1 year ago

Hi Chris, that would be lovely. I am thankful for any suggestions. I want to analyze my flongle-sequencing results (Oxford Nano Technologies), to validate the sgRNAs present in the pooled CRISPR screen I have cloned. The sequencing results consists of short reads because I double-digested a 364bp region from the vector I am using, before preparing the rapid barcoding library (R9.4.1.).

There is a webpage named ONRamp, that analyses exactly this; https://www.biorxiv.org/content/10.1101/2022.03.15.484480v2 The authors have promised me to update the option of models, because none of them currently fit the combination I have used.

CFB2018 commented 1 year ago

I guess what I am wondering now is; In your opinion, is it just not possible to download Medaka1.9.1 on this computer or have I just gotten something wrong a long the way?

cjw85 commented 1 year ago

It is definitely possible. medaka is primarily developed on macOS (even though it is typically used on Linux computers).

Let me get back to you on how I would do it from scratch on macOS.

cjw85 commented 1 year ago

On a brand new macOS device (I just set one up from scratch), running the following sufficies to install medaka:

# run python3, this will trigger install of developer tools in a new window
python3

# make a virtual environment in which to install medaka
python3 -m venv medaka

# activate the virtual environment
. ./medaka/bin/activate

# install homebrew, which is required only to install libcrypto
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/"${USER}"/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

# install openssl, which should result in the file /opt/homebrew/lib/libcrypto.dylib being present
brew install openssl

# install medaka
export LIBRARY_PATH=/opt/homebrew/lib
pip install medaka
CFB2018 commented 1 year ago

This is great, thank you so much for sorting this out!8 sep. 2023 kl. 18:36 skrev Chris Wright @.***>: On a brand new macOS device (I just set one up from scratch), running the following sufficies to install medaka:

run python3, this will trigger install of developer tools in a new window

python3

make a virtual environment in which to install medaka

python3 -m venv medaka

activate the virtual environment

. ./medaka/bin.activate

install homebrew, which is required only to install libcrypto

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" (echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/"${USER}"/.zprofile eval "$(/opt/homebrew/bin/brew shellenv)"

install openssl, which should result in the file /opt/homebrew/lib/libcrypto.dylib being present

brew install openssl

install medaka

export LIBRARY_PATH=/opt/homebrew/lib pip install medaka

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

lhauff commented 1 year ago

Hello,

I followed the instructions provided to install medaka on local macOS yet I too still receive the the "illegal instructions" error when attempting medaka_consensus.

/medaka/bin/medaka_consensus: line 16: 742 Illegal instruction: 4 medaka tools list_models

cjw85 commented 1 year ago

Hi @lhauff,

This sounds like the same problem @CFB2018 was originally having. I would guess that you have also followed a guide on the internet that instructs you in how to run things like conda as if your macOS device is an Intel mac when it is in fact a ARM-based mac.

You will need to revert such hacks and allow medaka to be installedI'm sorry, I cannot be of any further assistance.