conda-forge / nvcc-feedstock

A conda-smithy repository for nvcc.
BSD 3-Clause "New" or "Revised" License
12 stars 23 forks source link

Error while installing nvcc on conda environment #65

Closed kirk86 closed 1 year ago

kirk86 commented 3 years ago

Issue: I receive the following error while trying to install nvcc in a conda environment. rm: cannot remove '/lib/libcuda.so': Permission denied File /home/user/miniconda3/envs/tflow/lib/lib64/stubs/libcuda.so doesn't exist

It seems that is trying to remove my system /lib/libcuda.so and I don't know why, plus this is undesirable behaviour as an end user I'll end up with a messed up system.


Environment (conda list):

``` $ conda list # packages in environment at /home/user/miniconda3/envs/tflow: # # Name Version Build Channel _libgcc_mutex 0.1 main anyio 2.2.0 py37h06a4308_0 argon2-cffi 20.1.0 py37h27cfd23_1 async_generator 1.10 py37h28b3542_0 attrs 20.3.0 pyhd3eb1b0_0 babel 2.9.0 pyhd3eb1b0_0 backcall 0.2.0 pyhd3eb1b0_0 blas 1.0 mkl bleach 3.3.0 pyhd3eb1b0_0 brotlipy 0.7.0 py37h27cfd23_1003 bzip2 1.0.8 h7b6447c_0 ca-certificates 2020.12.5 ha878542_0 conda-forge certifi 2020.12.5 py37h89c1867_1 conda-forge cffi 1.14.5 py37h261ae71_0 chardet 4.0.0 py37h06a4308_1003 cite2c 0.2.1 pypi_0 pypi cryptography 3.4.7 py37hd23ed53_0 cudatoolkit 10.2.89 hfd86e86_1 cycler 0.10.0 py37_0 dbus 1.13.18 hb2f20db_0 decorator 5.0.5 pyhd3eb1b0_0 defusedxml 0.7.1 pyhd3eb1b0_0 docstring-to-markdown 0.7 pypi_0 pypi entrypoints 0.3 py37_0 expat 2.3.0 h2531618_2 ffmpeg 4.2.2 h20bf706_0 filelock 3.0.12 pyhd3eb1b0_1 fontconfig 2.13.1 h6c09931_0 freetype 2.10.4 h5ab3b9f_0 [97/1845] geomloss 0.2.4 pypi_0 pypi glib 2.68.0 h36276a3_0 gmp 6.2.1 h2531618_2 gnutls 3.6.5 h71b1129_1002 gpytorch 1.3.1 pypi_0 pypi gst-plugins-base 1.14.0 h8213a91_2 gstreamer 1.14.0 h28cd5cc_2 icu 58.2 he6710b0_3 idna 2.10 pyhd3eb1b0_0 importlib-metadata 3.7.3 py37h06a4308_1 importlib_metadata 3.7.3 hd3eb1b0_1 intel-openmp 2020.2 254 ipykernel 5.3.4 py37h5ca1d4c_0 ipympl 0.7.0 pyhd3eb1b0_0 ipython 7.22.0 py37hb070fc8_0 ipython_genutils 0.2.0 pyhd3eb1b0_1 ipywidgets 7.6.3 pyhd3eb1b0_1 jedi 0.17.2 pypi_0 pypi jinja2 2.11.3 pyhd3eb1b0_0 joblib 1.0.1 pyhd3eb1b0_0 jpeg 9b h024ee3a_2 json5 0.9.5 py_0 jsonschema 3.2.0 py_2 jupyter-lsp 1.1.4 pyhd8ed1ab_0 conda-forge jupyter-packaging 0.7.12 pyhd3eb1b0_0 jupyter_client 6.1.12 pyhd3eb1b0_0 jupyter_core 4.7.1 py37h06a4308_0 jupyter_server 1.4.1 py37h06a4308_0 jupyterlab 3.0.11 pyhd3eb1b0_1 jupyterlab-lsp 3.4.1 pyhd8ed1ab_0 conda-forge jupyterlab_pygments 0.1.2 py_0 jupyterlab_server 2.4.0 pyhd3eb1b0_0 jupyterlab_widgets 1.0.0 pyhd3eb1b0_1 kiwisolver 1.3.1 py37h2531618_0 lame 3.100 h7b6447c_0 lcms2 2.12 h3be6417_0 ld_impl_linux-64 2.33.1 h53a641e_7 libffi 3.3 he6710b0_2 libgcc-ng 9.1.0 hdf63c60_0 libgfortran-ng 7.3.0 hdf63c60_0 libopus 1.3.1 h7b6447c_0 libpng 1.6.37 hbc83047_0 libsodium 1.0.18 h7b6447c_0 libstdcxx-ng 9.1.0 hdf63c60_0 libtiff 4.1.0 h2733197_1 [52/1845] libuuid 1.0.3 h1bed415_2 libuv 1.40.0 h7b6447c_0 libvpx 1.7.0 h439df22_0 libxcb 1.14 h7b6447c_0 libxml2 2.9.10 hb55368b_3 lz4-c 1.9.3 h2531618_0 markupsafe 1.1.1 py37h14c3975_1 matplotlib 3.3.4 py37h06a4308_0 matplotlib-base 3.3.4 py37h62a2d02_0 mistune 0.8.4 py37h14c3975_1001 mkl 2020.2 256 mkl-service 2.3.0 py37he8ac12f_0 mkl_fft 1.3.0 py37h54f3939_0 mkl_random 1.1.1 py37h0573a6f_0 nbclassic 0.2.6 pyhd3eb1b0_0 nbclient 0.5.3 pyhd3eb1b0_0 nbconvert 6.0.7 py37_0 nbformat 5.1.3 pyhd3eb1b0_0 ncurses 6.2 he6710b0_1 nest-asyncio 1.5.1 pyhd3eb1b0_0 nettle 3.4.1 hbb512f6_0 ninja 1.10.2 py37hff7bd54_0 nodejs 10.13.0 he6710b0_0 notebook 6.3.0 py37h06a4308_0 numpy 1.19.2 py37h54aff64_0 numpy-base 1.19.2 py37hfa32c7d_0 nvcc_linux-64 10.2 h1a5f58c_12 conda-forge olefile 0.46 py37_0 openh264 2.1.0 hd408876_0 openssl 1.1.1k h27cfd23_0 packaging 20.9 pyhd3eb1b0_0 pandas 1.2.3 py37ha9443f7_0 pandoc 2.12 h06a4308_0 pandocfilters 1.4.3 py37h06a4308_1 parso 0.7.1 pypi_0 pypi pcre 8.44 he6710b0_0 pexpect 4.8.0 pyhd3eb1b0_3 pickleshare 0.7.5 pyhd3eb1b0_1003 pillow 8.2.0 py37he98fc37_0 pip 21.0.1 py37h06a4308_0 pluggy 0.13.1 pypi_0 pypi prometheus_client 0.10.0 pyhd3eb1b0_0 prompt-toolkit 3.0.17 pyh06a4308_0 ptyprocess 0.7.0 pyhd3eb1b0_2 pycparser 2.20 py_2 [7/1845] pygments 2.8.1 pyhd3eb1b0_0 pyopenssl 20.0.1 pyhd3eb1b0_1 pyparsing 2.4.7 pyhd3eb1b0_0 pyqt 5.9.2 py37h05f1152_2 pyrsistent 0.17.3 py37h7b6447c_0 pysocks 1.7.1 py37_1 python 3.7.10 hdb3f193_0 python-dateutil 2.8.1 pyhd3eb1b0_0 python-jsonrpc-server 0.4.0 pypi_0 pypi python-language-server 0.36.2+49.g3536061 pypi_0 pypi python_abi 3.7 1_cp37m conda-forge pytorch 1.8.1 py3.7_cuda10.2_cudnn7.6.5_0 pytorch pytz 2021.1 pyhd3eb1b0_0 pyzmq 20.0.0 py37h2531618_1 qt 5.9.7 h5867ecd_1 rauth 0.7.3 pypi_0 pypi readline 8.1 h27cfd23_0 requests 2.25.1 pyhd3eb1b0_0 scikit-learn 0.24.1 py37ha9443f7_0 scipy 1.6.2 py37h91f5cce_0 seaborn 0.11.1 pyhd3eb1b0_0 sed 4.8 he412f7d_0 conda-forge send2trash 1.5.0 pyhd3eb1b0_1 setuptools 52.0.0 py37h06a4308_0 sip 4.19.8 py37hf484d3e_0 six 1.15.0 py37h06a4308_0 sniffio 1.2.0 py37h06a4308_1 sqlite 3.35.4 hdfb4753_0 terminado 0.9.4 py37h06a4308_0 testpath 0.4.4 pyhd3eb1b0_0 threadpoolctl 2.1.0 pyh5ca1d4c_0 tk 8.6.10 hbc83047_0 torchaudio 0.8.1 py37 pytorch torchvision 0.9.1 py37_cu102 pytorch tornado 6.1 py37h27cfd23_0 tqdm 4.59.0 pyhd3eb1b0_1 traitlets 5.0.5 pyhd3eb1b0_0 typing_extensions 3.7.4.3 pyha847dfd_0 ujson 4.0.2 pypi_0 pypi urllib3 1.26.4 pyhd3eb1b0_0 wcwidth 0.2.5 py_0 webencodings 0.5.1 py37_1 wheel 0.36.2 pyhd3eb1b0_0 widgetsnbextension 3.5.1 py37_0 x264 1!157.20191217 h7b6447c_0 xz 5.2.5 h7b6447c_0 zeromq 4.3.4 h2531618_0 zipp 3.4.1 pyhd3eb1b0_0 zlib 1.2.11 h7b6447c_3 zstd 1.4.9 haebb681_0 ```


Details about conda and system ( conda info ):

``` $ conda info active environment : tflow active env location : /home/user/miniconda3/envs/tflow shell level : 1 user config file : /home/user/.condarc populated config files : conda version : 4.10.0 conda-build version : not installed python version : 3.7.10.final.0 virtual packages : __cuda=11.2=0 __linux=4.14.225=0 __glibc=2.33=0 __unix=0=0 __archspec=1=x86_64 base environment : /home/user/miniconda3 (writable) conda av data dir : /home/user/miniconda3/etc/conda conda av metadata url : https://repo.anaconda.com/pkgs/main channel URLs : https://repo.anaconda.com/pkgs/main/linux-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/linux-64 https://repo.anaconda.com/pkgs/r/noarch package cache : /home/user/miniconda3/pkgs /home/user/.conda/pkgs envs directories : /home/user/miniconda3/envs /home/user/.conda/envs platform : linux-64 user-agent : conda/4.10.0 requests/2.25.1 CPython/3.7.10 Linux/4.14.225-1-MANJARO manjaro/21.0 glibc/2.33 UID:GID : 1000:1000 netrc file : None offline mode : False ```
leofang commented 3 years ago

Hi, I am not sure where the rm command comes from, but end users are not supposed to use this package; it's meant to be used by Conda-Forge package maintainers, see https://conda-forge.org/docs/user/faq.html (the last Q & A; for some reason I can't hyperlink to it).

kirk86 commented 3 years ago

Thanks, I needed nvcc in order to compile some installed packages and I thought this should be the package that would allow me to install and utilise nvcc.

kkraus14 commented 3 years ago

Thanks, I needed nvcc in order to compile some installed packages and I thought this should be the package that would allow me to install and utilise nvcc.

Unfortunately nvcc is not redistributable per the CUDA EULA so conda cannot ship an nvcc package. This is a shim package to call into a system installed nvcc from the CUDA toolkit.

leofang commented 3 years ago

Btw the rm command is done here: https://github.com/conda-forge/nvcc-feedstock/blob/be30075db0e7d4f551b41c82bb53e73daccdcc9e/recipe/install_nvcc.sh#L157 Perhaps we should add extra safeties to ensure the activate/deactivate scripts are only run in a conda-build session, not in end users' environments (despite it takes no effect in your case, but who knows).

kkraus14 commented 3 years ago

We should probably short circuit and error for now if the package isn't being used in CONDA_BUILD

kirk86 commented 3 years ago

Thanks for the explanation @kkraus14!

leofang commented 1 year ago

Perhaps we should add extra safeties to ensure the activate/deactivate scripts are only run in a conda-build session, not in end users' environments (despite it takes no effect in your case, but who knows).

I think a better alternative was already implemented in #84. Let's close this. Thank you @kirk86 for reporting!