-
Notifications
You must be signed in to change notification settings - Fork 26
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
About static link to cudnn and cublas #5
Comments
Hello gangmul12! Are you still working on pytorch-gpgpusim? |
Hi! i worked on pytorch-gpgpusim, but i've realized that many kernels in cuDNN library is implemented with only SASS, so now i'm studying SASS in fact XD |
@gangmul12 |
@ohcurrent |
To add onto this, the maxwell_something_xxxx function headers are not in the newer CuDNN versions, so it might have been a mistake that they were there in the first place. |
@cng123, Then did you simulate with higher version of cuDNN7.1.4 ? |
@ohcurrent, I saw many cuDNN kernel is optimized to some of its architecture, newer versions have volta_xxxx then it only contains SASS code. |
@gangmul12 |
@gangmul12 I was trying to build your project with CUDA 8.0 and CUDNN 7.1.3, since versions above this doesn't work according to the developer of GPGPU-Sim (gpgpu-sim/gpgpu-sim_distribution#166 (comment)) After installing, I attempted to run an MNIST example (https://github.com/pytorch/examples/blob/master/mnist/main.py), and got the following output: I would be grateful for some help, whether it's a solution or some hint to narrow the problem down. |
@Azuresonance |
I think nobody managing this repo now, but for future usage.
my env:
OS : Ubuntu 16.04
cudnn : 7.1.4
cuda : 8.0
and i installed pytorch according to the instruction of @cng123. link is below
https://docs.google.com/document/d/17fSM2vrWodP8rWR7ctpgaggVXEw0uD2VCAh0Gi4Gpb4/edit?usp=sharing
I downloaded https://github.com/pytorch/examples, and run imagenet benchmark. Then, I found gpgpu-sim often face deadlock, seg fault, or CUDNN_STATUS_INTERNAL_ERROR
I analyzed this problem by using LD_DEBUG flags, then i found that pytorch library dynamically loads libcuda.so.1, which should not be linked.
I've found two reason why it tried to link to libcuda.so.1 instead of gpgpu-sim's libcudart.so.
In compilation stage for _nvrtc.so, there is a link flag to libcuda.so.
pytorch-gpgpu-sim/setup.py
Line 1010 in 1e37e08
I can bypass issue from this by using static library of cudnn or deleting lcuda link flag(if you want to use shared version of cudnn). I personally prefer using static library.
libcublas.so has a link to libcuda.so. Strangely, i can't find a explicity linkage libcublas.so to libcuda.so when i check it using ldd command, but LD_DEBUG result shows that libcublas.so calls functions in libcuda.so.
At first, I tried to resolve this issue by making a copy of libcudart.so with the name of libcuda.so.1. However, there are so many unimplemented cuda driver function in cuda_runtime_api.cc, so my terminal generated CUDNN_STATUS_INTERNAL_ERROR very quickly.
Then, I just built pytoch with libcublas_static.a by modifying some cmake value. like
pytorch-gpgpu-sim/CMakeLists.txt
Line 80 in 1e37e08
pytorch-gpgpu-sim/cmake/public/cuda.cmake
Lines 248 to 251 in 1e37e08
Then, many errors were gone.
I also think this is closely related the merged pull-request of gpgpu-sim-distribution, gpgpu-sim/gpgpu-sim_distribution#129
I'm not sure it is meaningful to improve old version of pytorch(ver0.4) but anyway, i hope this issue help your simulation
Thank you
The text was updated successfully, but these errors were encountered: