chipsalliance / f4pga-examples

Example designs showing different ways to use F4PGA toolchains.
https://f4pga-examples.readthedocs.io
Apache License 2.0
263 stars 77 forks source link

Conda can't resolve packages for aarch64 #246

Open lachlansmith opened 2 years ago

lachlansmith commented 2 years ago

I'm on an M1 Mac inside an Ubuntu virutal machine following SymbiFlow Getting Started. When I execute this step:

conda env create -f $FPGA_FAM/environment.yml

Conda fails to solve the environment most probably because conda is trying to resolve aarch64 as opposed to x86_64. It fails to resolve the following packages... everything.

Collecting package metadata (repodata.json): done
Solving environment: failed

ResolvePackageNotFound: 
  - litex-hub::gcc-riscv64-elf-newlib==9.2.0=20201119_154229
  - litex-hub::symbiflow-yosys-plugins==1.0.0_7_382_g6712d71=20210818_135210
  - litex-hub::vtr-optimized==8.0.0_4118_g06317d042=20210813_070938
  - litex-hub::prjxray-tools==0.1_2842_g6867429c=20210301_104249
  - litex-hub::openocd==0.10.0_1514_ga8edbd020=20201119_154304
  - litex-hub::prjxray-db==0.0_253_gcd41f08=20211122_104637
  - litex-hub::yosys==0.9_5567_g539d4ee9=20210813_070938_py37

Is there a work around for this? Surely this issue persists on native aarch64 linux and somebody has found a work around. Can I manually build this environment?

If this can't be done then there's no hope for M1 Mac owners doing FPGA development.

Thanks

pgielda commented 2 years ago

No real workaround other than building from sources, as you pointed out the pre-compiled packages are available for x86_64. Having said that we will look at possibly providing aarch64 linux packages in the future. The main blocker is that there are no aarch64 github actions runners, we would have to set up a custom architecture, and previously there was no interest. We could be using QEMU to build but it would potentially take ages to build. So some practical blockers, are solvable if there is interest.

@PiotrZierhoffer @kgugala FYI

lachlansmith commented 2 years ago

Would be great if Symbiflow could solve this emerging issue. Vivado has no interest as seen here, Vivado ARM Linux.

pgielda commented 2 years ago

There is definitely interest and its definitely doable. Also the whole project is open source so there is no technical obstacle, just a matter of doing it ;)

I will report once there is some progress on any of the packages. We do need to set-up some CI infra for ARM within the project first to be able to test properly.

lachlansmith commented 2 years ago

Hi @pgielda understanding these things take time, what does this space look like at the moment?

mithro commented 2 years ago

FYI - https://github.com/SymbiFlow/conda-packages/pull/160

conversy commented 1 year ago

Hi, I'm running into this issue too.

I tried to install the x86_64 version (with the correct installer from miniconda and by specifying an x86_64 shell with env /usr/bin/arch -x86_64 /bin/zsh --login (as per this explanation), to no avail. Also tried with miniforge, still no luck.

Is it possible to see which arch are the modules conda tries to install?

conversy commented 1 year ago

[EDIT] ok i'm dumb, the packages only exist for x86_64, please ignore the previous message. [EDIT 2] Docker can now use Rosetta 2: in Docker Desktop, General settings, check Use Virtualization framework, and in Features in development, check Use Rosetta for x86/amd64 emulation on Apple Silicon. Then in a macOS Terminal (for my 35T-based board):

docker pull gcr.io/hdl-containers/conda/f4pga/xc7/a50t
docker run --platform linux/amd64 -it gcr.io/hdl-containers/conda/f4pga/xc7/a50t:latest
unixb0y commented 1 year ago

No real workaround other than building from sources

Are there any instructions to build all required dependencies from source? I'm running Ubuntu 22.04 LTS as a VM on M2 Pro.

unixb0y commented 1 year ago

Bump