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

win11编译paddle2.4,CUDA缺少device.h #52791

Closed
hibean opened this issue Apr 11, 2023 · 1 comment
Closed

win11编译paddle2.4,CUDA缺少device.h #52791

hibean opened this issue Apr 11, 2023 · 1 comment
Assignees
Labels
status/close 已关闭 type/question 用户提问

Comments

@hibean
Copy link

hibean commented Apr 11, 2023

编译环境:
win11
cuda12.1
vs2019
python3.10.11

编译报错:

[684/3243] Building CUDA object paddle\phi\kernels\CMakeFiles\phi_gpu.dir\gpu\graph_send_recv_kernel.cu.obj
FAILED: paddle/phi/kernels/CMakeFiles/phi_gpu.dir/gpu/graph_send_recv_kernel.cu.obj
C:\PROGRA~1\NVIDIA~2\CUDA\v12.1\bin\nvcc.exe -forward-unknown-to-host-compiler -DCUDA_TOOLKIT_ROOT_DIR="\"C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.1\"" -DCUDA_VERSION_MAJOR=\"12\" -DCUDA_VERSION_MINOR=\"1\" -DCUDNN_MAJOR_VERSION=\"8\" -DEIGEN_STRONG_INLINE=inline -DEIGEN_USE_GPU -DGOOGLE_GLOG_DLL_DECL="" -DLAPACK_FOUND -DNOMINMAX -DPADDLE_DISABLE_PROFILER -DPADDLE_DLL_EXPORT -DPADDLE_DLL_INFERENCE -DPADDLE_ON_INFERENCE -DPADDLE_VERSION=0.0.0 -DPADDLE_VERSION_INTEGER=0 -DPADDLE_WITH_AVX -DPADDLE_WITH_CRYPTO -DPADDLE_WITH_CUDA -DPADDLE_WITH_MKLDNN -DPADDLE_WITH_MKLML -DPADDLE_WITH_POCKETFFT -DPADDLE_WITH_SSE3 -DTRT_PLUGIN_FP16_AVALIABLE -DUTF8PROC_STATIC -DWIN32_LEAN_AND_MEAN -D_XKEYCHECK_H -ID:\pythonWorkspace\Paddle\build -ID:\pythonWorkspace\Paddle\paddle\fluid\framework\io -ID:\pythonWorkspace\Paddle\build\third_party\install\zlib\include -ID:\pythonWorkspace\Paddle\build\third_party\install -ID:\pythonWorkspace\Paddle\build\third_party\install\gflags\include -ID:\pythonWorkspace\Paddle\build\third_party\install\glog\include -ID:\pythonWorkspace\Paddle\build\third_party\eigen3\src\extern_eigen3 -ID:\pythonWorkspace\Paddle\build\third_party\threadpool\src\extern_threadpool -ID:\pythonWorkspace\Paddle\build\third_party\dlpack\src\extern_dlpack\include -ID:\pythonWorkspace\Paddle\build\third_party\install\xxhash\include -ID:\pythonWorkspace\Paddle\build\third_party\install\warpctc\include -ID:\pythonWorkspace\Paddle\build\third_party\install\utf8proc\include -ID:\pythonWorkspace\Paddle\build\third_party\install\mklml\include -ID:\pythonWorkspace\Paddle\build\third_party\install\mkldnn\include -ID:\pythonWorkspace\Paddle\build\third_party\install\protobuf\include -I"C:\Program Files\Python310\include" -I"C:\Program Files\Python310\Lib\site-packages\numpy\core\include" -ID:\pythonWorkspace\Paddle\build\third_party\pybind\src\extern_pybind\include -ID:\pythonWorkspace\Paddle\build\third_party\install\cryptopp\include -ID:\pythonWorkspace\Paddle\build\third_party\pocketfft\src -ID:\pythonWorkspace\Paddle\build\third_party\dirent\src\extern_dirent\include -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\include" -ID:\pythonWorkspace\Paddle -ID:\pythonWorkspace\Paddle\build\..\paddle\fluid\framework\io -D_WINDOWS -Xcompiler=" /W0  /GR /EHsc"  -gencode arch=compute_75,code=sm_75 -w --expt-relaxed-constexpr --expt-extended-lambda -Xcompiler "/wd4244 /wd4267 /wd4819 " -Xcompiler /bigobj  -Xcompiler="/arch:AVX" -Xcompiler="-MT -O2 -Ob2" -DNDEBUG -std=c++14 --generate-code=arch=compute_50,code=[compute_50,sm_50] --generate-code=arch=compute_52,code=[compute_52,sm_52] --generate-code=arch=compute_60,code=[compute_60,sm_60] --generate-code=arch=compute_61,code=[compute_61,sm_61] --generate-code=arch=compute_70,code=[compute_70,sm_70] --generate-code=arch=compute_75,code=[compute_75,sm_75] --generate-code=arch=compute_80,code=[compute_80,sm_80] --generate-code=arch=compute_86,code=[compute_86,sm_86] -MD -MT paddle\phi\kernels\CMakeFiles\phi_gpu.dir\gpu\graph_send_recv_kernel.cu.obj -MF paddle\phi\kernels\CMakeFiles\phi_gpu.dir\gpu\graph_send_recv_kernel.cu.obj.d -x cu -c D:\pythonWorkspace\Paddle\paddle\phi\kernels\gpu\graph_send_recv_kernel.cu -o paddle\phi\kernels\CMakeFiles\phi_gpu.dir\gpu\graph_send_recv_kernel.cu.obj -Xcompiler=-Fdpaddle\phi\kernels\CMakeFiles\phi_gpu.dir\phi_gpu.pdb,-FS
D:\pythonWorkspace\Paddle\paddle\phi\kernels\gpu\graph_send_recv_kernel.cu(70): error: namespace "thrust" has no member "device"
      thrust::fill(thrust::device,
                           ^

D:\pythonWorkspace\Paddle\paddle\phi\kernels\gpu\**graph_send_recv_kernel.cu**(76): error: namespace "thrust" has no member "device"
      thrust::fill(thrust::device,
                           ^

2 errors detected in the compilation of "D:/pythonWorkspace/Paddle/paddle/phi/kernels/gpu/graph_send_recv_kernel.cu".
graph_send_recv_kernel.cu
[685/3243] Building CUDA object paddle\phi\kernels\CMakeFiles\phi_gpu.dir\gpu\graph_send_ue_recv_kernel.cu.obj
FAILED: paddle/phi/kernels/CMakeFiles/phi_gpu.dir/gpu/graph_send_ue_recv_kernel.cu.obj
C:\PROGRA~1\NVIDIA~2\CUDA\v12.1\bin\nvcc.exe -forward-unknown-to-host-compiler -DCUDA_TOOLKIT_ROOT_DIR="\"C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.1\"" -DCUDA_VERSION_MAJOR=\"12\" -DCUDA_VERSION_MINOR=\"1\" -DCUDNN_MAJOR_VERSION=\"8\" -DEIGEN_STRONG_INLINE=inline -DEIGEN_USE_GPU -DGOOGLE_GLOG_DLL_DECL="" -DLAPACK_FOUND -DNOMINMAX -DPADDLE_DISABLE_PROFILER -DPADDLE_DLL_EXPORT -DPADDLE_DLL_INFERENCE -DPADDLE_ON_INFERENCE -DPADDLE_VERSION=0.0.0 -DPADDLE_VERSION_INTEGER=0 -DPADDLE_WITH_AVX -DPADDLE_WITH_CRYPTO -DPADDLE_WITH_CUDA -DPADDLE_WITH_MKLDNN -DPADDLE_WITH_MKLML -DPADDLE_WITH_POCKETFFT -DPADDLE_WITH_SSE3 -DTRT_PLUGIN_FP16_AVALIABLE -DUTF8PROC_STATIC -DWIN32_LEAN_AND_MEAN -D_XKEYCHECK_H -ID:\pythonWorkspace\Paddle\build -ID:\pythonWorkspace\Paddle\paddle\fluid\framework\io -ID:\pythonWorkspace\Paddle\build\third_party\install\zlib\include -ID:\pythonWorkspace\Paddle\build\third_party\install -ID:\pythonWorkspace\Paddle\build\third_party\install\gflags\include -ID:\pythonWorkspace\Paddle\build\third_party\install\glog\include -ID:\pythonWorkspace\Paddle\build\third_party\eigen3\src\extern_eigen3 -ID:\pythonWorkspace\Paddle\build\third_party\threadpool\src\extern_threadpool -ID:\pythonWorkspace\Paddle\build\third_party\dlpack\src\extern_dlpack\include -ID:\pythonWorkspace\Paddle\build\third_party\install\xxhash\include -ID:\pythonWorkspace\Paddle\build\third_party\install\warpctc\include -ID:\pythonWorkspace\Paddle\build\third_party\install\utf8proc\include -ID:\pythonWorkspace\Paddle\build\third_party\install\mklml\include -ID:\pythonWorkspace\Paddle\build\third_party\install\mkldnn\include -ID:\pythonWorkspace\Paddle\build\third_party\install\protobuf\include -I"C:\Program Files\Python310\include" -I"C:\Program Files\Python310\Lib\site-packages\numpy\core\include" -ID:\pythonWorkspace\Paddle\build\third_party\pybind\src\extern_pybind\include -ID:\pythonWorkspace\Paddle\build\third_party\install\cryptopp\include -ID:\pythonWorkspace\Paddle\build\third_party\pocketfft\src -ID:\pythonWorkspace\Paddle\build\third_party\dirent\src\extern_dirent\include -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\include" -ID:\pythonWorkspace\Paddle -ID:\pythonWorkspace\Paddle\build\..\paddle\fluid\framework\io -D_WINDOWS -Xcompiler=" /W0  /GR /EHsc"  -gencode arch=compute_75,code=sm_75 -w --expt-relaxed-constexpr --expt-extended-lambda -Xcompiler "/wd4244 /wd4267 /wd4819 " -Xcompiler /bigobj  -Xcompiler="/arch:AVX" -Xcompiler="-MT -O2 -Ob2" -DNDEBUG -std=c++14 --generate-code=arch=compute_50,code=[compute_50,sm_50] --generate-code=arch=compute_52,code=[compute_52,sm_52] --generate-code=arch=compute_60,code=[compute_60,sm_60] --generate-code=arch=compute_61,code=[compute_61,sm_61] --generate-code=arch=compute_70,code=[compute_70,sm_70] --generate-code=arch=compute_75,code=[compute_75,sm_75] --generate-code=arch=compute_80,code=[compute_80,sm_80] --generate-code=arch=compute_86,code=[compute_86,sm_86] -MD -MT paddle\phi\kernels\CMakeFiles\phi_gpu.dir\gpu\graph_send_ue_recv_kernel.cu.obj -MF paddle\phi\kernels\CMakeFiles\phi_gpu.dir\gpu\graph_send_ue_recv_kernel.cu.obj.d -x cu -c D:\pythonWorkspace\Paddle\paddle\phi\kernels\gpu\graph_send_ue_recv_kernel.cu -o paddle\phi\kernels\CMakeFiles\phi_gpu.dir\gpu\graph_send_ue_recv_kernel.cu.obj -Xcompiler=-Fdpaddle\phi\kernels\CMakeFiles\phi_gpu.dir\phi_gpu.pdb,-FS
D:\pythonWorkspace\Paddle\paddle\phi\kernels\gpu\**graph_send_ue_recv_kernel.cu(**68): error: namespace "thrust" has no member "device"
      thrust::fill(thrust::device,
                           ^

D:\pythonWorkspace\Paddle\paddle\phi\kernels\gpu\graph_send_ue_recv_kernel.cu(75): error: namespace "thrust" has no member "device"
      thrust::fill(thrust::device,
                           ^
2 errors detected in the compilation of "D:/pythonWorkspace/Paddle/paddle/phi/kernels/gpu/graph_send_ue_recv_kernel.cu".

错误提示
error: namespace "thrust" has no member "device"

目前的处理步骤
分别在以下这两个文件,添加 #include <thrust/device.h>
graph_send_ue_recv_kernel.cu
graph_send_recv_kernel.cu

类似如下:

#include <thrust/device.h>
#include <thrust/device_vector.h>
#include <thrust/fill.h>

但是再次编译依然报错

而我发现在CUDA12.1的目录:C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\include\thrust下根本没有device.h文件

请问各位,现在该怎么办?

@hibean
Copy link
Author

hibean commented Apr 12, 2023

参考 #49539 解决问题

@hibean hibean closed this as completed Apr 12, 2023
@paddle-bot paddle-bot bot added status/close 已关闭 and removed status/new-issue 新建 labels Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/close 已关闭 type/question 用户提问
Projects
None yet
Development

No branches or pull requests

2 participants