openforis / sepal

Geographical Data Processing in the Cloud
https://sepal.io/
MIT License
207 stars 46 forks source link

Cannot install the Cupy lib in venv #155

Closed 12rambau closed 2 years ago

12rambau commented 2 years ago

The BFAST_GPU application is based on multiple libs to perform its algorithm including Cupy the GPU version of the famous Numpy lib.

When Cupy is included to the requirements.txt of the module, the venv fails to built itself as Cupy look for CUDA path and toolkit (https://docs.cupy.dev/en/stable/install.html#installing-cupy-from-pypi).

This will be an issue for any application that wants to run GPU based libs (including Cupy and tensorflow)

12rambau commented 2 years ago

When we did the installation using only pip install cupy, cupy tries to guess the CUDA version in the system. as the installation is not run in a GPU environment, pip was failing. The workaround is to force CUDA version in the cupycommand using the lib recommendations:

pip install cupy-cuda114

it will of course require changes when cuda version will be changed