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

Provide a script to install k2 automatically #1223

Open
csukuangfj opened this issue Jul 13, 2023 · 4 comments
Open

Provide a script to install k2 automatically #1223

csukuangfj opened this issue Jul 13, 2023 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@csukuangfj
Copy link
Collaborator

Many users have some issues when they come to install k2 and they find that it is quite difficult to install it.

I suggest that we provide a single script ./install-k2.sh to install k2 automatically.

The script should ask the following questions:

  • Whether to install a CPU version or a CUDA version of k2
  • Which version of CUDA toolkit to install
  • Which version of PyTorch to install
  • In which directory to install k2

The script should NOT ask for sudo permission.

Also, we should setup GitHub actions to test the script.

Help from the community is appreciated.

@csukuangfj csukuangfj added the help wanted Extra attention is needed label Jul 13, 2023
@danpovey
Copy link
Collaborator

In my opinion much of the benefit of this would come from the ability to customize to a specific situation, and to offer
advice. E.g. what is the base version of python (and is it part of a conda install); and do we have any limitations on the torch version, e.g. torch == something, torch >= something; do we have limitations on the cuda driver e.g. driver <= something, because we dont have root?

@csukuangfj
Copy link
Collaborator Author

csukuangfj commented Jul 13, 2023

In my opinion much of the benefit of this would come from the ability to customize to a specific situation, and to offer
advice

Yes, I agree. For instance, the script should first query the CUDA driver API version displayed by nvidia-smi
and then display a list of available CUDA runtime API versions for users to choose. After selecting the CUDA runtime API version, we then display a list of PyTorch versions.


Note: Use

nvidia-smi | grep "CUDA Version:" | tr -s " " " " |  rev  | cut -d " " -f 2 | rev

to get the driver CUDA API version

@desh2608
Copy link
Contributor

I have installed k2 on several clusters at this point, and the method that always works for me is to build from source with explicit path to the CUDNN library in the cmake argument, otherwise there is the libcudnn.so error at import time. Of course, this requires later adding the build directory to the PYTHONPATH. So far, I have not been able to use the pip wheel based install successfully.

@csukuangfj
Copy link
Collaborator Author

So far, I have not been able to use the pip wheel based install successfully.

The reason is that all the pre-compiled wheels are built using GitHub actions, which runs on Ubuntu 20.04 or Ubuntu 22.04.
The pre-compiled wheels are thus linked with a high version of libstdc++ and libc, which cause errors if your system libc or libstdc++ is too old. (Note: It is not possible to use Ubuntu <= 18.04 in GitHub actions any longer).

I am trying to fix this issue so that you can use pip install even if your system libc is not updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants