k2-fsa / k2

FSA/FST algorithms, differentiable, with PyTorch compatibility.
https://k2-fsa.github.io/k2
Apache License 2.0
1.1k stars 214 forks source link

Build with CUDA 12.x is broken in Docker #1199

Closed artbataev closed 1 year ago

artbataev commented 1 year ago

CUDA 12.x build is broken in Docker (when compiling without GPU / for all architectures).

How to reproduce

Dockerfile:

# nvidia-pytorch official docker image
ARG BASE_IMAGE=nvcr.io/nvidia/pytorch:23.04-py3

FROM ${BASE_IMAGE}

RUN K2_MAKE_ARGS="-j" pip install -v "git+https://github.com/k2-fsa/k2#egg=k2" || { echo "k2 installation failed"; exit 1; }

Execute:

docker build --tag pytorch_k2_cuda12 .

Error:

...
#6 70.68     [  8%] Building CXX object _deps/kaldifeat-build/kaldifeat/csrc/CMakeFiles/kaldifeat_core.dir/online-feature.cc.o
#6 70.69     nvcc fatal   : Unsupported gpu architecture 'compute_35'
#6 70.69     make[2]: *** [k2/csrc/CMakeFiles/k2_log.dir/build.make:76: k2/csrc/CMakeFiles/k2_log.dir/log.cu.o] Error 1
#6 70.69     make[1]: *** [CMakeFiles/Makefile2:364: k2/csrc/CMakeFiles/k2_log.dir/all] Error 2
...

Potential solution

Remove 35 from K2_COMPUTE_ARCH_CANDIDATES for CUDA 12.x

csukuangfj commented 1 year ago

Closing via #1200