Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nb::any is removed in nanobind v2.0.0 #106

Merged
merged 2 commits into from
May 30, 2024
Merged

Conversation

Huizerd
Copy link
Contributor

@Huizerd Huizerd commented May 29, 2024

I tried to build aestream with libcaer and CUDA support, but ran into errors. It turns out that nanobind recently removed nb::any support in nb::shape, and that one should now use -1 instead. This PR fixes that here, and allows me to compile successfully with pip install git+https://github.com/Huizerd/aestream@dev/nb_any_bug --no-binary aestream -v.

Tested on Ubuntu 20.04, with gcc-10 and g++-10 selected via update-alternatives as explained here. I have the latest libcaer master from here and CUDA toolkit 12.1 from here.

I also got it built successfully in a conda environment:

name: cuda_minimal
channels:
  - pytorch
  - nvidia
dependencies:
  - python=3.11
  - pytorch-cuda=12.1
  - pytorch==2.1.2
  - torchvision==0.16.2
  - cuda=12.1
  - cuda-nvcc=12.1
  - cuda-version=12.1
  - pip
  - pip:
    - cmake
    - numpy
    - setuptools
    - wheel

Also, when I didn't have g++-10 set as default and tried to build with CUDA support, I found that setting only CXX=g++-10 wasn't enough; you also have to set the host compiler for CUDA as follows:

CXX=g++-10 NVCC_PREPEND_FLAGS='-ccbin g++-10' pip install git+https://github.com/Huizerd/aestream@dev/nb_any_bug --no-binary aestream -v

Maybe this could be added in the docs :)

@Jegp
Copy link
Contributor

Jegp commented May 29, 2024

What a great and thorough contribution, thank you @Huizerd!

I wonder why the GPG check is failing in YUM, but I don't think you're to blame for that.

Your point of the NVCC flag would be great to have in the docs, as you suggested. Do you want to add that (https://github.com/aestream/aestream/blob/main/docs/install.md) or would you prefer I did it?

@Huizerd
Copy link
Contributor Author

Huizerd commented May 30, 2024

Done!

@Jegp
Copy link
Contributor

Jegp commented May 30, 2024

Brilliant. Thank you for the addition 👍
I'll take a look at the failing builds in another branch.

@Jegp Jegp merged commit c336426 into aestream:main May 30, 2024
6 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants