CUDA error 38

Hi all,

I tried to install CUDA on my JetsonTK1 following tutorial step by step.
I download CUDA 6.5 Toolkit for L4T Rel 21.2 from [url]https://developer.nvidia.com/linux-tegra-rel-21[/url]
I install it with these command lines:
sudo dpkg -i cuda-repo-l4t-r19.2_6.0-42_armhf.deb
sudo apt-get update
sudo apt-get install cuda-toolkit-6-5
sudo usermod -a -G video $USER
I add path:
echo “# Add CUDA bin & library paths:” >> ~/.bashrc
echo “export PATH=/usr/local/cuda/bin:$PATH” >> ~/.bashrc
echo “export LD_LIBRARY_PATH=/usr/local/cuda/lib:$LD_LIBRARY_PATH” >> ~/.bashrc
source ~/.bashrc

Finally when I verify if I well install cuda with “nvcc -V” command, it returns these lines:
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2014 NVIDIA Corporation
Built on Wed_Nov_12_15:57:57_CST_2014
Cuda compilation tools, release 6.5, V6.5.30

Then I installed and ran samples and when I tried to run one of them, “deviceQuery”, it returns these lines:
./deviceQuery Starting…

 CUDA Device Query (Runtime API) version (CUDART static linking)

cudaGetDeviceCount returned 38
-> no CUDA-capable device is detected
Result = FAIL

I searched on the internet in order to fix my problem but I don’t succeed.
I reinstalled the toolkit, I verify in .bashrc if the PATH was correctly added, I checked the Makefile of deviceQuery and it seems to be correct.
One strange things, in /dev directory I haven’t nvidia file, I don’t know why and I have read it should be here.

Please tell me what I can do if you know this problem.

Best regards, Quentin.

When a Jetson first arrives, there is a step to complete install…“sudo ~/NVIDIA-INSTALLER/installer.sh”…have you done this or flashed (which has the equivalent)? Without this CUDA can’t be used.

If you have done this, then to make sure nothing has overwritten the relevant files, check if anything here is not OK:

sha1sum -c /etc/nv_tegra_release

Thank you for the quick reply.
I used the installer.sh but only after the CUDA installation.
The sha1sum command returns these lines:
ubuntu@tegra-ubuntu:~$ sha1sum -c /etc/nv_tegra_release
/usr/lib/xorg/modules/drivers/nvidia_drv.so: OK
/usr/lib/xorg/modules/extensions/libglx.so: OK
/usr/lib/arm-linux-gnueabihf/tegra/libnvmmlite_video.so: OK
/usr/lib/arm-linux-gnueabihf/tegra/libnvwinsys.so: OK
/usr/lib/arm-linux-gnueabihf/tegra/libnvomx.so: OK
/usr/lib/arm-linux-gnueabihf/tegra/libnvtestio.so: OK
/usr/lib/arm-linux-gnueabihf/tegra/libnvmm.so: OK
/usr/lib/arm-linux-gnueabihf/tegra/libnvodm_imager.so: OK
/usr/lib/arm-linux-gnueabihf/tegra/libnvtestresults.so: OK
/usr/lib/arm-linux-gnueabihf/tegra/libnvapputil.so: OK
/usr/lib/arm-linux-gnueabihf/tegra/libnvmm_utils.so: OK
/usr/lib/arm-linux-gnueabihf/tegra/libnvrm_graphics.so: OK
/usr/lib/arm-linux-gnueabihf/tegra/libnvos.so: OK
/usr/lib/arm-linux-gnueabihf/tegra/libnvmmlite_image.so: OK
/usr/lib/arm-linux-gnueabihf/tegra/libnvddk_vic.so: OK
/usr/lib/arm-linux-gnueabihf/tegra/libnvomxilclient.so: OK
/usr/lib/arm-linux-gnueabihf/tegra/libglx.so: OK
/usr/lib/arm-linux-gnueabihf/tegra/libnvmm_camera_v3.so: OK
/usr/lib/arm-linux-gnueabihf/tegra/libnvmm_parser.so: OK
/usr/lib/arm-linux-gnueabihf/tegra/libnvmmlite_audio.so: OK
/usr/lib/arm-linux-gnueabihf/tegra/libnvodm_query.so: OK
/usr/lib/arm-linux-gnueabihf/tegra/libnvmmlite_utils.so: OK
/usr/lib/arm-linux-gnueabihf/tegra/libnvtnr.so: OK
/usr/lib/arm-linux-gnueabihf/tegra/libnvmm_contentpipe.so: OK
/usr/lib/arm-linux-gnueabihf/tegra/libjpeg.so: OK
/usr/lib/arm-linux-gnueabihf/tegra/libnvddk_2d_v2.so: OK
/usr/lib/arm-linux-gnueabihf/tegra/libnvdc.so: OK
/usr/lib/arm-linux-gnueabihf/tegra/libtegrav4l2.so: OK
/usr/lib/arm-linux-gnueabihf/tegra/libnvmmlite.so: OK
/usr/lib/arm-linux-gnueabihf/tegra/libnvparser.so: OK
/usr/lib/arm-linux-gnueabihf/tegra/libnvsm.so: OK
/usr/lib/arm-linux-gnueabihf/tegra/libnvavp.so: OK
/usr/lib/arm-linux-gnueabihf/tegra/libnvtvmr.so: OK
/usr/lib/arm-linux-gnueabihf/tegra/libnvrm.so: OK

I don’t know if the CUDA install itself would have required those installer.sh files to be in place. As I recall there may be some CUDA samples which don’t actually run on this platform, but I couldn’t tell you which ones do/don’t run. One thing which will definitely cause strange behavior is if the installer.sh was not run with sudo (the same is true if you fail to use sudo in a manual flash for the apply_binaries.sh step).

Your basic steps from the original post (other than not having had the final install step in yet) look basically correct. It may be possible you could remove and add the CUDA package back in now that installer.sh is completed, or perhaps use one of the other dpkg/apt commands to tell it to reinstall the CUDA package (I’m not an Ubuntu guy, I’m not sure which commands would be used to “freshen” a package). I have a strong feeling the issue is related to having not added the final installer.sh step first, though I can’t guarantee it. You may find it easiest to just update to L4T R21.5 (flash completes the equivalent of the install.sh step), as you’ll want something newer than the default R19.2 which the JTK1 ships with.

Finally it works.
I just flash the card and I do all steps in order to install CUDA again (I think in the same way) and it works.
So I don’t know what I did wrong the first time but thank you for your help and your quick replies.