默认情况只安装 最大 SM 架构
DGL 的 cmake/modules/CUDA.cmake 里写死了一个选择逻辑:
CUDA_ARCH_BIN,它会 默认取检测到的最高架构(这里就是 86);
输出类似于: -- Running GPU architecture autodetection -- Found GPU arch 8.6 8.6 8.6 8.6 8.6 8.6 7.5 7.5 -- CUDA_NVCC_FLAGS: -Xcompiler;-fopenmp,-Wall,-fPIC,,-O0,-g3,-ggdb,-DUSE_LIBXSMM,-DDGL_CPU_LLC_SIZE=40000000,-D__BLAS=0,-DUSE_EPOLL,-DIDXTYPEWIDTH=64,-DREALTYPEWIDTH=32;--expt-relaxed-constexpr;-gencode;arch=compute_86,code=sm_86;-gencode;arch=compute_86,code=compute_86;--expt-extended-lambda;-Wno-deprecated-declarations;-std=c++17
因此,如果要让 多个SM架构(如75 和 86) 同时编进去,必须使用特定的参数:
cmake -DUSE_CUDA=ON \
-DCUDA_ARCH_NAME=Manual \
-DCUDA_ARCH_BIN="75;86" \
-DCUDA_ARCH_PTX="75;86" \
输出类似于: <没有autodetection> -- CMAKE_CXX_FLAGS: -fopenmp -Wall -fPIC -O0 -g3 -ggdb -DUSE_LIBXSMM -DDGL_CPU_LLC_SIZE=40000000 -D__BLAS=0 -DUSE_EPOLL -DIDXTYPEWIDTH=64 -DREALTYPEWIDTH=32 -- CUDA_NVCC_FLAGS: -Xcompiler;-fopenmp,-Wall,-fPIC,,-O0,-g3,-ggdb,-DUSE_LIBXSMM,-DDGL_CPU_LLC_SIZE=40000000,-D__BLAS=0,-DUSE_EPOLL,-DIDXTYPEWIDTH=64,-DREALTYPEWIDTH=32;--expt-relaxed-constexpr;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_86,code=sm_86;-gencode;arch=compute_75,code=compute_75;-gencode;arch=compute_86,code=compute_86;--expt-extended-lambda;-Wno-deprecated-declarations;-std=c++17
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。