gorgonia / cu

package cu provides an idiomatic interface to the CUDA Driver API.
Apache License 2.0
475 stars 64 forks source link

testing #45

Open LucaPaterlini opened 5 years ago

LucaPaterlini commented 5 years ago

Error in initialization, please refer to "https://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__INITIALIZE.html" for details on:

I have encountered this error while following the instruction to test if its correctly installed

ray-harris commented 5 years ago

I'm getting the same error when running cudatest

$ cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.2 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.2 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

$ go version
go version go1.13.4 linux/amd64

$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Sun_Jul_28_19:07:16_PDT_2019
Cuda compilation tools, release 10.1, V10.1.243

$ go get gorgonia.org/cu
$ go install gorgonia.org/cu/cmd/cudatest
$ cudatest
Error in initialization, please refer to "https://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__INITIALIZE.html" for details on:
$

This is using the CUDA 10.1 toolkit. Maybe the initialization flags have changed?

ray-harris commented 5 years ago

The issue is that there are new error codes. The values for cuResult are sparse and if the error is one that's not defined in cu/result.go, but less than 999, CUDA_ERROR_UNKNOWN, then cuResult.String() returns an empty string.

I tweaked cu/result.go to include the error code in the message and the one I'm getting is 804, CUDA_ERROR_COMPAT_NOT_SUPPORTED_ON_DEVICE. Now that I know what the error is, I'll go from there, but I'll see about opening a PR to return a useful error message when result() encounters a code it doesn't know.

ray-harris commented 5 years ago

A reboot fixed the 804 error and cudatest runs fine now for me.

@LucaPaterlini Are you still having this issue? If so, take a look at my PR and see if that will give you an error code you can use.