I'm attempting to run a neural network built using dl4j using the GPU. The code works fine when using the native platform dependency, but when I switch to using CUDA, execution fails with an exception:
Caused by: java.lang.UnsatisfiedLinkError: ...\cuda-8.0-6.0-1.3-windows-x86_64.jar\org\bytedeco\javacpp\windows-x86_64\jnicuda.dll: Can't find dependent libraries
Here is what I have in my build.gradle:
// compile group: 'org.nd4j', name: 'nd4j-native-platform', version: '0.9.1'
compile group: 'org.nd4j', name: 'nd4j-cuda-8.0-platform', version: '0.9.1'
Here are the dependencies showin in IDEA:
I was able to install the CUDA Toolkit and build the examples just fine. Running deviceQuery shows that my CUDA Driver / Runtime version is 9.1, is this a problem since the nd4j-cuda-8.0-platform references 8.0? Not sure, since the version is 0.9.1, which matches my CUDA version and there does not seem to be a 9.0 platform available.
Is there something additional that I'm missing? If so, how do I troubleshoot/resolve this?
So, it turns out there are a few issues. Firstly, deeplearning4j's current release does not support CUDA 9, which I had naively installed thinking the latest and greatest is the best. CUDA 9 is supported on the latest snapshot, which I tried out, but apparently due to some issue with Gradle and snapshots, was unable to resolve the issue.
Ultimately I uninstalled everything relating to CUDA from my PC and installed CUDA 8 from scratch, restarted the computer, and now things seem to be working.
Related
I'm trying to install JAX on the NVIDIA Jetson TX2 and I'm facing considerable issues.
I have CUDA 9.0 and it gives me the following error:
No library found under: /usr/local/cuda-9.0/targets/aarch64-linux/lib/libcublasLt.so.9.0
So I go looking and of course that library does not exist. Does anyone have any pointers on how I can about installing that library? I've tried searching google and it does not appear to exist at all.
The cublasLt library did not come into existence until cuda 10.1 here is the cublas 10.0 doc and here is the cublas 10.1 doc.
Therefore you won't be able to use cublasLt with CUDA 9.0
On a Jetson the correct way to get the latest CUDA install including libraries like cublas is to install the latest JetPack.
I'm compiling the source code by using pgf95 (Fortran compiler).
If I use cuda 10.0, it successfully compiles the source code.
However, If I use cuda 10.1, it fails showing that 'cannot find libcublasLt.so'.
When I scan the directory cuda-10.0/lib64, cuda-10.1/lib64, both do not have the file starting with 'libcublasLt'.
How can I solve this issue?
libcublasLt.so is the library that provides the implementation for the cublasLt API which is defined here. It just happens to be a separate shared object from libcublas.so
In the past (e.g. CUDA 10.0 and prior), most CUDA libraries were installed in /usr/local/cuda/lib64 (or similar) by default (on linux). At about the CUDA 10.1 timeframe, it was decided that some libraries would be installed in different places. CUDA 10.1 is also where the cublasLt API and library were introduced. This affected some cublas libraries and is discussed in the CUDA 10.1 release notes here (both the introduction of the cublasLt library, as well as the change in library locations).
So there are 2 possibilities here (for CUDA 10.1, CUDA 10.2):
libcublasLt.so is on your machine, but it is simply not where you were expecting to find it.
libcublasLt.so is not on your machine. This means you are working with CUDA version prior to the introduction of the cublasLt API (i.e. 10.0 or prior), or you have a broken install.
So, assuming you are working with CUDA 10.1 or CUDA 10.2, the first step is to locate/determine whether libcublasLt.so is on your machine or not. You can use a linux utility like find or locate to accomplish that. They should have man pages available for you.
If you can find it, then you need to provide the path to it, via a linker spec (e.g. -L/path/to/libcublasLt.so/
If you can't find it, then either you are working with an older version of CUDA (10.0 or prior), or you need to reinstall CUDA.
I believe by the time you get to CUDA 11.0, the CUDA packages put the cublas libraries back in /usr/local/cuda/lib64 with the other libraries. YMMV.
I am installing CUDA on Ubuntu 14.04 and have a Maxwell card (GTX 9** series) and I think I have installed everything properly with the toolkit as I can compile my samples. However, I read that in places that I should install the SDK (This appears to be talked about with the sdk 4). I am not sure if the toolkit and sdk are different? As I have a later 9 series card does that mean I have CUDA 6 running? Here is my nvcc version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2014 NVIDIA Corporation
Built on Wed_Aug_27_10:36:36_CDT_2014
Cuda compilation tools, release 6.5, V6.5.16
I am following a book and I need to include <cutil.h> and I can't find that file in the includes anywhere where I installed it.
I followed this guide provided by nvidia and as I have done what they say this is why I am confused http://developer.download.nvidia.com/compute/cuda/6_5/rel/docs/CUDA_Getting_Started_Linux.pdf
Thanks for help
CUDA Toolkit is a software package that has different components. The main pieces are:
CUDA SDK (The compiler, NVCC, libraries for developing CUDA software, and CUDA samples)
GUI Tools (such as Eclipse Nsight for Linux/OS X or Visual Studio Nsight for Windows)
Nvidia Driver (system driver for driving the card)
It has also many other components such as CUDA-debugger, profiler, memory checker, etc.
The fact that you are able to compile and run samples means that you probably installed the Toolkit fully and have the SDK, the driver, and the Samples at least.
As for the cutil.h, doing a search in my CUDA 6.5 installation with find -L . -iname "cutil.h" yielded no results. Also looking at other related questions on SO, it seems like this header file does not exist in CUDA installations anymore (since CUDA 5.0). However, looking at the samples, you can find some newer utility headers such as helper_cuda.h being in use. Helpers like these should be located in somewhere like /usr/local/cuda/samples/common/inc in your OS. helper_cuda.h is a header I almost always include in my CUDA programs since I find utility functions such as checkCudaErrors() very useful.
If you are following a book, my recommendation is; try to compile the code, and whenever you get an error saying a utility function is missing, do a grep search in the header files included in samples/common/inc. You will most probably find the missing utility functions there and then you can include the necessary headers accordingly.
So I downloaded the latest Cuda (5.0.35) script to install Cuda on my desktop on which I have Debian (kernel 2.6.32).
When I ran the script though I get an error on the log which says:
The compiler used to compile the kernel (gcc-4.3) does not exactly match the current compiler (gcc-4.7)
So I looked to install gcc-4.3 from the repositories but it isn't there. Then I downloaded the gcc-4.3 package separately but when I try to install it I get many conflicting dependencies so installing it is really not an option. I installed gcc-4.4 which is in the repositories and changed the soft link for gcc to link to the gcc-4.4 version but I get the same message above
The compiler used to compile the kernel (gcc-4.3) does not exactly match the current compiler (gcc-4.4)
So the question is, is there a way that I can install the driver successfully without relying on the gcc-4.3?
I installed a 3.2 kernel which was compiled with gcc-4.6 and that worked for me. You could also compile the old kernel using gcc-4.7 although I tried it and had some errors. The problem is that Debian uses a very old kernel so it was compiled with gcc-4.3.
I'm trying to do some CUDA development on a PC without CUDA-capable GPU via emulation mode. The OS is Linux Mint Debian (can be considered Debian testing for all practical purposes) 32bit (2.6.32-5-686 kernel). Here's what I did so far:
Grabbed the CUDA Toolkit 32 bit and SDK for Ubuntu from http://developer.nvidia.com/cuda-toolkit-40
Installed the CUDA Toolkit in /usr/local/cuda/lib
Added the paths to bashrc
echo "# CUDA stuff
PATH=\$PATH:/usr/local/cuda/bin
LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:/usr/local/cuda/lib
export PATH
export LD_LIBRARY_PATH" >> ~/.bashrc
Added the path to /etc/ld.so.conf.d/cuda.conf:
/usr/local/cuda/lib
Executed "sudo ldconfig"
Restarted the session
Then installed the SDK in /home/user/NVIDIA_GPU_Computing_SDK folder
When I got to NVIDIA_GPU_Computing_SDK/C and type "make emu=1" to compile the examples I get:
nvcc warning : option 'device-emulation' has been deprecated and is ignored
/usr/bin/ld: cannot find -lcudartemu
/usr/bin/ld: cannot find -lcudartemu
collect2: ld returned 1 exit status
Seems like a library missing (rt = runtime ?). There is libcudart3 in the package manager, but wants a whole bunch of nvidia stuff as a dependency, including drivers and I don't even have an NVIDIA card on this machine. Also apparently the GPU emulation is now deprecated... Does anybody have some experience with CUDA emulation?
There is no emulation in CUDA any more. It was deprecated and removed during the 3.x release cycle. There is no emulation support beyond CUDA 3.1 IIRC. Certainly there is nothing you can do in CUDA 4.0.
On Linux, your best bet is to try gpuocelot, which provides a PTX level emulation on x86 processors and a reimplementation of the CUDA APIs.
Although I agree with the suggestion to try Ocelot, when I was in the same boat I found it easiest to go on eBay and get a cheap CUDA capable card to use for testing (I think I paid < $40). If you have the ability to open the hardware (I realize this isn't an option for some people) and to install drivers, that's what I'd suggest.