Open ghailey opened 5 years ago
How to build Torch with CUDA10 Install the latest CMake from github repo (the latest FindCUDA.cmake will be installed) $ sudo apt-get purge cmake $ git clone https://github.com/Kitware/CMake.git $ cd CMake $ ./bootstrap; make; sudo make install Remove FindCUDA.cmake. $ cd ~/torch $ rm -fr cmake/3.6/Modules/FindCUDA Apply the following patch to cutorch diff --git a/lib/THC/THCAtomics.cuh b/lib/THC/THCAtomics.cuh index 400875c..ccb7a1c 100644 --- a/lib/THC/THCAtomics.cuh +++ b/lib/THC/THCAtomics.cuh @@ -94,6 +94,7 @@ static inline device void atomicAdd(long address, long val) { }
+#if !(CUDA_ARCH >= 700 || !defined(CUDA_ARCH) ) static inline device void atomicAdd(half address, half val) { unsigned int address_as_ui = (unsigned int ) ((char )address - ((size_t)address & 2)); @@ -117,6 +118,7 @@ static inline device void atomicAdd(half *address, half val) { } while (assumed != old); }
+#endif $ cd extra/cutorch $ cat > atomic.patch
CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: CUDA_cublas_device_LIBRARY (ADVANCED) linked by target "THC" in directory /home/ghy/torch/extra/cutorch/lib/THC
-- Configuring incomplete, errors occurred! See also "/home/ghy/torch/extra/cutorch/build/CMakeFiles/CMakeOutput.log". See also "/home/ghy/torch/extra/cutorch/build/CMakeFiles/CMakeError.log".