I ran into problems building on a fresh install of Linux (Ubuntu 18.04) when trying to build with the cuBLAS library. Details are
OS: Ubuntu 18.04
GCC: 7.4.0
cmake: 3.14.3
Boost: 1.65.1
CUDA: 10.1.105-1
Nvidia Driver: 418.39-1
GPU: GTX1080ti
Gpufit: 12496a... Apr 12 16:11:54 2019
I used the following commands to build;
mkdir Gpufit-build
cd Gpufit-build
cmake -DCMAKE_BUILD_TYPE=RELEASE -DUSE_CUBLAS=TRUE ../Gpufit
make
The build failed with the following statements...
../libGpufit.so: undefined reference to 'init_gemm_select'
../libGpufit.so: undefined reference to 'free_gemm_select'
../libGpufit.so: undefined reference to 'cublasLtGetVersion'
../libGpufit.so: undefined reference to 'cublasLtGetProperty'
../libGpufit.so: undefined reference to 'cublasLtCtxInit'
../libGpufit.so: undefined reference to 'cublasLtGetCudartVersion'
../libGpufit.so: undefined reference to 'cublasLtShutdownCtx'
I was able to eventually get around this (and subsequent) problem as follows;
(Note; I do not claim that this is the best way to solve the problem. It is merely what worked for me, and may be of assistance in addressing the actual problem).
- After installing cuda toolkit (from .deb package) I had to create symbolic links from the /usr/local/cuda directory to the cuBLAS libraries (for some odd reason with CUDA 10.1, Nvida have put these in a different location /usr/lib/x86_64-linux-gnu). The commands I used were
sudo ln -s /usr/local/cuda/libcublasLt.so /usr/lib/x86_64-linux-gnu/libcublasLt.so
sudo ln -s /usr/local/cuda/libcublasLt.so.10 /usr/lib/x86_64-linux-gnu/libcublasLt.so.10
sudo ln -s /usr/local/cuda/libcublasLt.so10.1.0.105 /usr/lib/x86_64-linux-gnu/libcublasLt.so.10.1.0.105
sudo ln -s /usr/local/cuda/libcublasLt_static.a /usr/lib/x86_64-linux-gnu/libcublasLt_static.a
sudo ln -s /usr/local/cuda/libcublas.so /usr/lib/x86_64-linux-gnu/libcublas.so
sudo ln -s /usr/local/cuda/libcublas.so.10 /usr/lib/x86_64-linux-gnu/libcublas.so.10
sudo ln -s /usr/local/cuda/libcublas.so10.1.0.105 /usr/lib/x86_64-linux-gnu/libcublas.so.10.1.0.105
sudo ln -s /usr/local/cuda/libcublas_static.a /usr/lib/x86_64-linux-gnu/libcublas_static.a
- To fix the build errors, it was necessary to tell the linker to include the static library libcublasLt_static.a This was achieved by modifying the files
Gpufit repository path/Gpufit/CMakeLists.txt
Gpufit repository path/Gpufit/examples/CMakeLists.txt
Gpufit repository path/Gpufit/Gpufit/examples/CMakeLists.txt
In each file, every instance of the line
target_link_libraries(${target} ${modules})
was replaced with the following line:
target_link_libraries(${target} ${modules} /usr/local/cuda/lib64/libcublasLt_static.a)
The build directory was then erased
cd <Gpufit repository path>/Gpufit-build
rm -rf *
and the cmake command rerun
cmake -DCMAKE_BUILD_TYPE=RELEASE -DUSE_CUBLAS=TRUE ../Gpufit
make
The build then succeeded.
As previously mentioned, I am not very familiar with the cmake machinery, so there may be a much better way to fix this problem than this workaround. Hope it helps anyway.
I ran into problems building on a fresh install of Linux (Ubuntu 18.04) when trying to build with the cuBLAS library. Details are
OS: Ubuntu 18.04
GCC: 7.4.0
cmake: 3.14.3
Boost: 1.65.1
CUDA: 10.1.105-1
Nvidia Driver: 418.39-1
GPU: GTX1080ti
Gpufit: 12496a... Apr 12 16:11:54 2019
I used the following commands to build;
The build failed with the following statements...
I was able to eventually get around this (and subsequent) problem as follows;
(Note; I do not claim that this is the best way to solve the problem. It is merely what worked for me, and may be of assistance in addressing the actual problem).
Gpufit repository path/Gpufit/CMakeLists.txt
Gpufit repository path/Gpufit/examples/CMakeLists.txt
Gpufit repository path/Gpufit/Gpufit/examples/CMakeLists.txt
In each file, every instance of the line
was replaced with the following line:
The build directory was then erased
and the cmake command rerun
The build then succeeded.
As previously mentioned, I am not very familiar with the cmake machinery, so there may be a much better way to fix this problem than this workaround. Hope it helps anyway.