easybuild-easyblocks icon indicating copy to clipboard operation
easybuild-easyblocks copied to clipboard

`multi_deps` with a binary + extension package does not work

Open mboisson opened this issue 5 years ago • 5 comments
trafficstars

I am trying to install TensorRT, which supports multiple versions of python. I want to use multi_deps

The problem is that the tensorrt.py EasyBlock is based on a binary. Extracting the binary multiple times simply over-writes the existing installation folder for each version of python. The resulting installation therefore only supports the last version of python specified in the multi_deps

https://github.com/ComputeCanada/easybuild-easyblocks/blob/computecanada-master/easybuild/easyblocks/t/tensorrt.py

https://github.com/ComputeCanada/easybuild-easyconfigs/blob/computecanada-master/easybuild/easyconfigs/t/TensorRT/TensorRT-7.0.0.11-CUDAcore-10.1.243.eb

@bartoldeman @boegel, any idea how to work around this ?

It seems like for a Binary EasyBlock, multi_deps should perform the installation step only once.

mboisson avatar Feb 19 '20 16:02 mboisson

I tried this to see if it would keep the files between each run keeppreviousinstall = True

But it does not seem to do the trick :/

mboisson avatar Feb 20 '20 20:02 mboisson

I see @akesandgren was the author of the tensorrt.py EasyBlock, so tagging you too.

mboisson avatar Feb 20 '20 21:02 mboisson

The issue is caused by this line : https://github.com/ComputeCanada/easybuild-easyblocks/blob/computecanada-master/easybuild/easyblocks/generic/binary.py#L109

which can only be removed with Python 3.8's new dirs_exist_ok for the shutil.copytree

This means that the option keeppreviousinstall = True

is not compatible with packages that use the Binary EasyBlock.

In general, this also means that any EasyBlock that inherits from Binary can not successfully use the multi_deps option, without a workaround (see next post).

mboisson avatar Feb 20 '20 21:02 mboisson

For my specific use case (TensorRT), I worked around the issue by bypassing this codepath by specifying a custom install_cmd :

https://github.com/ComputeCanada/easybuild-easyconfigs/blob/6b883300c207014bf1fe7739f749dd9906401fec/easybuild/easyconfigs/t/TensorRT/TensorRT-6.0.1.5-CUDAcore-10.1.243.eb#L15

mboisson avatar Feb 20 '20 21:02 mboisson

We have been hit by this as well, while preparing an easyconfig file for NVPL, based on the Bundle easyblock and components, with the PackedBinary as default easyblock.

The workaround with a custom install_cmd works, even though then there is an additional hiccup (not showstopper). The hiccup is that for every component the PackedBinary easyblock iterates over the list of sources and calls then the install method of the Binary easyblock, meaning that the install_cmd is executed N*N times, instead of just N times.

damianam avatar Jul 10 '24 15:07 damianam