ccsb-scripps / AutoDock-GPU

AutoDock for GPUs and other accelerators
https://ccsb.scripps.edu/autodock
GNU General Public License v2.0
384 stars 104 forks source link

Error compiling AUtodock-GPU on WSL2 and other issues #216

Open ayeshafatma opened 1 year ago

ayeshafatma commented 1 year ago

Dear developers. I have a Windows 11 ASUS TUF machine with 2 GPUs . There is NVIDIA GTX1650 and CUDA 12.0 installed on it. I have installed WSL2 to work in the linux environment. I compiled the Autodock-GPU for the CPU, it went fine. when I do 'make DEVICE=GPU', it compiles without errors. When I do 'make DEVICE=CUDA', I get the following error


make DEVICE=CUDA rm -f ./host/inc/performdocking.h ./host/src/performdocking.cpp Building adgpu_analysis ... g++ \ ./host/src/calcenergy.cpp ./host/src/getparameters.cpp ./host/src/main.cpp ./host/src/miscellaneous.cpp ./host/src/processgrid.cpp ./host/src/processligand.cpp ./host/src/processresult.cpp ./host/src/setup.cpp \ -std=c++11 -I./common -I./host/inc -DVERSION=\"v1.5-release\" \ -o./bin/adgpu_analysis \ -O3 -DTOOLMODE DEVICE is set to GPU

CPU_INCLUDE_PATH is set to /opt/intel/system_studio_2020/opencl/SDK/include/CL CPU_LIBRARY_PATH is set to /opt/intel/system_studio_2020/opencl/SDK/lib64

GPU_INCLUDE_PATH is set to /usr/local/cuda-12.0/targets/x86_64-linux/include GPU_LIBRARY_PATH is set to usr/local/cuda-12.0/targets/x86_64-linux/lib

nvcc -DN64WI -use_fast_math --ptxas-options="-v" -gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_70,code=sm_70 -std=c++11 -I./common -I./host/inc -I/usr/local/cuda-12.0/targets/x86_64-linux/include -I./cuda -c ./cuda/kernels.cu /usr/include/c++/9/type_traits(1011): error: type name is not allowed

/usr/include/c++/9/type_traits(1011): error: type name is not allowed

/usr/include/c++/9/type_traits(1011): error: identifier "__is_assignable" is undefined

/usr/include/c++/9/utility(310): error: pack expansion does not make use of any argument packs

/usr/include/c++/9/type_traits(2482): error: class "std::enable_if<, void>" has no member "type" detected during instantiation of "std::swap" based on template argument <std::__c_file *> /usr/include/x86_64-linux-gnu/c++/9/bits/basic_file.h(79): here

/usr/include/x86_64-linux-gnu/c++/9/bits/basic_file.h(80): error: no instance of overloaded function "std::swap" matches the argument list argument types are: (__nv_bool, __nv_bool)

6 errors detected in the compilation of "/tmp/tmpxft_00000fab_00000000-9_kernels.compute_70.cpp1.ii". make: *** [Makefile.Cuda:187: kernels] Error 1


So I compiled with DEVICE=GPU and tried the test run. This time the error says there is no suitable OpenCL device or platform found


./bin/autodock_gpu_64w i --lfile ./input/1stp/derived/1stp_ligand.pdbqt --lfile ./input/1stp/derived/1stp_ligand.pdbqt --nrun 20 AutoDock-GPU version: v1.5-release

Running 1 docking calculation

Kernel source used for development: ./device/calcenergy.cl

Kernel string used for building: ./host/inc/stringify.h

Kernel compilation flags: -I ./device -I ./common -DN64WI -cl-mad-enable Error: clGetDeviceIDs(): -1 Info: Specified OpenCL platform 0 does not have a suitable device. Error: No suitable OpenCL platform found.


Kindly guide on how to remove the errors. Is it a problem with WSL?

Thank you

Regards Ayesha Fatima Turkey

atillack commented 1 year ago

@ayeshafatma The Cuda compilation error looks like it may be an incompatibility with the host C++ compiler and Cuda. For Cuda 12, likely GCC >= 10 is a good choice.

The OpenCL runtime error means that OpenCL platform 0 does not have a GPU listed and that no other platforms with one have been found. From what I find online OpenCL under WSL2 currently only works for certain Intel devices.

Eraser-A commented 1 month ago

改换英伟达显卡去跑的话,是不需要opencl的,而且make Device=CUDA是什么鬼,肯定是用make Device=GPU来编译autodockgpu*wi文件。

atillack commented 1 month ago

DEVICE=CUDA and DEVICE=OCLGPU are to directly choose which path to compile.

Also, we will have a new release that natively supports Windows with OpenCL soon.