Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23247

Unable to build shap with GPU support on Windows 10

$
0
0

I am trying to install the latest version of SHAP (0.45.0) with CUDA support to utilise GPUTree, on a Windows 10 machine installed with Visual Studio 2022 (version 17.9.6) with "Desktop development with C++ workload", CMake version 3.29.2 and CUDA Toolkit version 12.4.1. I have ensured that the cl.exe's path is there in the Path environment variable. Also, CUDA_PATH and CUDA_PATH_V12_4 are also defined properly. I created a venv environment with Python 12.0.0. As per the documentation available at https://shap.readthedocs.io/en/latest/example_notebooks/api_examples/explainers/GPUTree.html I cloned the SHAP repository and ran python setup.py install --user to build SHAP with CUDA support. However, I am getting errors like the below and the build is not successful (Finished processing dependencies for shap==0.0.0).

(shap_gpu) C:\Users\mimi\shap>python setup.py install --userAttempting to build SHAP: with_binary=True, with_cuda=True (Attempt 1)NVCC ==>  C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\bin\nvcc.exeCompiling cuda extension, calling nvcc with arguments:['C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.4\\bin\\nvcc.exe', '-allow-unsupported-compiler', 'shap/cext/_cext_gpu.cu', '-lib', '-o', 'build/_cext_gpu.lib', '-Xcompiler', '/MD', '--include-path', 'C:\\Users\\mimi\\AppData\\Local\\Programs\\Python\\Python312\\Include', '--std', 'c++14', '--expt-extended-lambda', '--expt-relaxed-constexpr', '-gencode=arch=compute_60,code=sm_60', '-gencode=arch=compute_70,code=sm_70', '-gencode=arch=compute_75,code=sm_75', '-gencode=arch=compute_75,code=compute_75', '-gencode=arch=compute_80,code=sm_80']_cext_gpu.cuC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\include\cuda_fp16.hpp(1890): error: asm operand type size(8) does not match type/size implied by constraint 'r'      asm ("ld.global.nc.b32 %0, [%1];"  : "=r"(*(reinterpret_cast<unsigned int *>(&(ret)))) : "r"(ptr));                                                                                               ^C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\include\cuda_fp16.hpp(1896): error: asm operand type size(8) does not match type/size implied by constraint 'r'      asm ("ld.global.nc.b16 %0, [%1];"  : "=h"(*(reinterpret_cast<unsigned short *>(&(ret)))) : "r"(ptr));                                                                                                 ^C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\include\cuda_fp16.hpp(1902): error: asm operand type size(8) does not match type/size implied by constraint 'r'      asm ("ld.global.cg.b32 %0, [%1];"  : "=r"(*(reinterpret_cast<unsigned int *>(&(ret)))) : "r"(ptr));                                                                                               ^C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\include\cuda_fp16.hpp(1908): error: asm operand type size(8) does not match type/size implied by constraint 'r'      asm ("ld.global.cg.b16 %0, [%1];"  : "=h"(*(reinterpret_cast<unsigned short *>(&(ret)))) : "r"(ptr));                                                                                                 ^C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\include\cuda_fp16.hpp(1914): error: asm operand type size(8) does not match type/size implied by constraint 'r'      asm ("ld.global.ca.b32 %0, [%1];"  : "=r"(*(reinterpret_cast<unsigned int *>(&(ret)))) : "r"(ptr));                                                                                               ^C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\include\cuda_fp16.hpp(1920): error: asm operand type size(8) does not match type/size implied by constraint 'r'      asm ("ld.global.ca.b16 %0, [%1];"  : "=h"(*(reinterpret_cast<unsigned short *>(&(ret)))) : "r"(ptr));                                                                                                 ^C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\include\cuda_fp16.hpp(1926): error: asm operand type size(8) does not match type/size implied by constraint 'r'      asm ("ld.global.cs.b32 %0, [%1];"  : "=r"(*(reinterpret_cast<unsigned int *>(&(ret)))) : "r"(ptr));                                                                                               ^C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\include\cuda_fp16.hpp(1932): error: asm operand type size(8) does not match type/size implied by constraint 'r'      asm ("ld.global.cs.b16 %0, [%1];"  : "=h"(*(reinterpret_cast<unsigned short *>(&(ret)))) : "r"(ptr));                                                                                                 ^C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\include\cuda_fp16.hpp(1938): error: asm operand type size(8) does not match type/size implied by constraint 'r'      asm ("ld.global.lu.b32 %0, [%1];"  : "=r"(*(reinterpret_cast<unsigned int *>(&(ret)))) : "r"(ptr) : "memory");

I was expecting successful installation of SHAP package with CUDA support. Instead the building resulted in numerous errors. Please help to resolve the issue.


Viewing all articles
Browse latest Browse all 23247

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>