Installing general package in octave has error - octave

I have error in installing general package using the instruction.
pkg install -forge general
and get the message
octave:3> pkg install -forge general
In file included from /usr/local/octave/3.8.0/lib/gcc47/gcc/x86_64-apple-darwin13/4.7.3/include/stdint.h:3:0,
from /usr/local/octave/3.8.0/include/octave-3.8.0/octave/oct-conf-post.h:167,
from /usr/local/octave/3.8.0/include/octave-3.8.0/octave/config.h:3351,
from /usr/local/octave/3.8.0/include/octave-3.8.0/octave/../octave/oct.h:31,
from SHA1.cc:19:
/usr/local/octave/3.8.0/lib/gcc47/gcc/x86_64-apple-darwin13/4.7.3/include-fixed/stdint.h:27:32: fatal error: sys/_types/_int8_t.h: No such file or directory
compilation terminated.
make: *** [SHA1.oct] Error 1
/usr/local/octave/3.8.0/bin/mkoctfile-3.8.0 SHA1.cc
pkg: error running `make' for the general package.
error: called from 'configure_make' in file /usr/local/octave/3.8.0/share/octave/3.8.0/m/pkg/private/configure_make.m near line 82, column 9
error: called from:
error: /usr/local/octave/3.8.0/share/octave/3.8.0/m/pkg/private/install.m at line 199, column 5
error: /usr/local/octave/3.8.0/share/octave/3.8.0/m/pkg/pkg.m at line 394, column 9
octave:3>
I have no idea to solve this problem. My computer OS is Mac 10.9.3 Mavericks. Octave version is 3.8.0
octave:1> ver
----------------------------------------------------------------------
GNU Octave Version 3.8.0
GNU Octave License: GNU General Public License
Operating System: Darwin 13.2.0 Darwin Kernel Version 13.2.0: Thu Apr 17 23:03:13 PDT 2014; root:xnu-2422.100.13~1/RELEASE_X86_64 x86_64
----------------------------------------------------------------------
no packages installed.
Does anyone have idea?

I find the solution! Using this comment
xcode-select --install
and it's success!
octave:1> ver
----------------------------------------------------------------------
GNU Octave Version 3.8.0
GNU Octave License: GNU General Public License
Operating System: Darwin 13.2.0 Darwin Kernel Version 13.2.0: Thu Apr 17 23:03:13 PDT 2014; root:xnu-2422.100.13~1/RELEASE_X86_64 x86_64
----------------------------------------------------------------------
no packages installed.
octave:2> pkg install -forge general
For information about changes from previous versions of the general package, run 'news general'.
octave:3> ver
----------------------------------------------------------------------
GNU Octave Version 3.8.0
GNU Octave License: GNU General Public License
Operating System: Darwin 13.2.0 Darwin Kernel Version 13.2.0: Thu Apr 17 23:03:13 PDT 2014; root:xnu-2422.100.13~1/RELEASE_X86_64 x86_64
----------------------------------------------------------------------
Package Name | Version | Installation directory
--------------+---------+-----------------------
general | 1.3.4 | /Users/apple/octave/general-1.3.4

I was having the same issue when trying to install the Octave Signal Package without success. The following finally appears to be working.
code-select --install from the Terminal window to install the command line tools
Install MacPorts for Mac. This is a standard installer that you can download from Macports.
sudo port install gcc48 --> This is a Fortran compiler, which is necessary for installing octave-general
sudo port install octave-general [NOTE: THIS TOOK A VERY LONG TIME, and I had to disable Spotlight indexing...Hours on a Macbook Pro]
sudo port install octave-control
sudo port install octave-signal

While looking at how to install the control package, I found this in the Arch Wiki:
Note: Some Octave's packages, like control, need the gcc-fortran ArchLinux's package in order to compile and install.
(https://wiki.archlinux.org/index.php/Octave)
So you might have to install gcc-fortran first.

Related

'which' doesn't find cuda after 'sudo dnf install cuda'

I ran sudo dnf install cuda on Fedora 27. The output is:
Last metadata expiration check: 0:01:05 ago on Thu 05 Jul 2018 10:32:51 AM CEST.
Package cuda-1:9.1.85.3-7.fc27.x86_64 is already installed, skipping.
Dependencies resolved.
Nothing to do.
Complete!
But when I do which cuda on the terminal, I get:
/usr/bin/which: no cuda in (/home/username/anaconda3/bin:/home/username/anaconda2/bin:/home/username/anaconda3/bin:/home/username/anaconda2/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/username/.local/bin:/home/username/bin)
Do I have cuda installed ?
Linux distribution :
x86_64
Fedora release 27 (Twenty Seven)
GPU available (output of lspci | grep -i nvidia):
01:00.0 3D controller: NVIDIA Corporation GP107M [GeForce GTX 1050 Mobile] (rev a1)
There is no executable called 'cuda'. The libraries get installed someplace like /usr/lib/x86_64-linux-gnu/libcuda.so.
You can try to run 'nvcc --version' but you can't be sure until you're able to run a cuda based application.
More details here:
https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#verify-installation

How to Install the CUDA Driver for TensorFlow (installing from source)

I'm trying to build TensorFlow from source and run it with GPU support. To install the toolkit I use the runfile, to install the driver I used the Additional Drivers Tool, since I did not get Ubuntu to boot into Text mode as specified in the CUDA documentation and stop lightdm and start lightdm does not work either, it gives me (also with sudo):
Name com.ubuntu.Upstart does not exist
So far I could build a release from the TensorFlow repository. However, when I'm trying to run the example as specified in the how-to
bazel-bin/tensorflow/cc/tutorials_example_trainer --use_gpu
the GPU apparently cannot be found:
jonas#jonas-Aspire-V5-591G:~/Documents/repos/tensoflow_fork$ bazel-bin/tensorflow/cc/tutorials_example_trainer --use_gpu
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcublas.so locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcudnn.so locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcufft.so locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcurand.so locally
E tensorflow/stream_executor/cuda/cuda_driver.cc:491] failed call to cuInit: CUDA_ERROR_UNKNOWN
I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:153] retrieving CUDA diagnostic information for host: jonas-Aspire-V5-591G
I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:160] hostname: jonas-Aspire-V5-591G
I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:185] libcuda reported version is: 352.63.0
I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:356] driver version file contents: """NVRM version: NVIDIA UNIX x86_64 Kernel Module 352.63 Sat Nov 7 21:25:42 PST 2015 GCC version: gcc version
4.9.2 (Ubuntu 4.9.2-10ubuntu13) """
I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:189] kernel reported version is: 352.63.0
I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:293] kernel version seems to match DSO: 352.63.0
I tensorflow/core/common_runtime/gpu/gpu_init.cc:81] No GPU devices available on machine.
F tensorflow/cc/tutorials/example_trainer.cc:125] Check failed: ::tensorflow::Status::OK() == (session->Run({{"x", x}}, {"y:0", "y_normalized:0"}, {}, &outputs)) (OK vs. Invalid argument: Cannot assign a device to node 'y': Could not satisfy explicit device specification '/gpu:0' because no devices matching that specification are registered in this process; available devices: /job:localhost/replica:0/task:0/cpu:0
[[Node: y = MatMul[T=DT_FLOAT, transpose_a=false, transpose_b=false, _device="/gpu:0"](Const, x)]])
Aborted
I'm using a clean Ubuntu 15.04 installation on an Acer Notebook with the GTX950M.
Can anybody tell me how to properly install the driver?
Can you run deviceQuery (comes with cuda installation)? Can you see nvidia present in lspci/lsmod/nvidia-smi?
lsmod |grep nvidia
dmesg | grep -i nvidia
lspci | grep -i nvidia
nvidia-smi
You can reload nvidia module and look for error messages
modprobe -r nvidia
dmesg | tail
sudo dmesg | grep NVRM
Related issue https://github.com/tensorflow/tensorflow/issues/601

NEW CLI INSTALL - does not work... tried Alloy and Classic

Summary:
2016-06-24T12:28:18.008Z | ERROR | An uncaught exception was thrown!
Cannot read property 'options' of undefined
2016-06-24T12:28:18.011Z | ERROR | Cannot read property 'options' of undefined
Details:
brand new installation, Windows 10 64bit
followed: https://docs.appcelerator.com/platform/latest/#!/guide/Appcelerator_CLI_Tasks
Steps I took:
Downloaded the NODE installer (URL on your downloads page):
node --version
v4.4.5
npm install appcelerator -g
npm WARN installMany request was bundled with appcelerator#4.2.6, but bundled package wasn't found in unpacked tree
npm WARN installMany chalk was bundled with appcelerator#4.2.6, but bundled package wasn't found in unpacked tree
npm WARN installMany progress was bundled with appcelerator#4.2.6, but bundled package wasn't found in unpacked tree
npm WARN installMany tar was bundled with appcelerator#4.2.6, but bundled package wasn't found in unpacked tree
npm WARN installMany which was bundled with appcelerator#4.2.6, but bundled package wasn't found in unpacked tree
npm WARN installMany debug was bundled with appcelerator#4.2.6, but bundled package wasn't found in unpacked tree
npm WARN installMany lodash was bundled with appcelerator#4.2.6, but bundled package wasn't found in unpacked tree
npm WARN installMany request was bundled with appcelerator#4.2.6, but bundled package wasn't found in unpacked tree
C:\Users\Ozz Nixon\AppData\Roaming\npm\appcelerator -> C:\Users\Ozz Nixon\AppData\Roaming\npm\node_modules\appcelerator\bin\appc
C:\Users\Ozz Nixon\AppData\Roaming\npm\appc -> C:\Users\Ozz Nixon\AppData\Roaming\npm\node_modules\appcelerator\bin\appc
appcelerator#4.2.6 C:\Users\Ozz Nixon\AppData\Roaming\npm\node_modules\appcelerator
├── which#1.0.8
├── progress#1.1.8
├── async#1.5.2
├── semver#3.0.1
├── debug#2.2.0 (ms#0.7.1)
├── chalk#0.5.1 (ansi-styles#1.1.0, escape-string-regexp#1.0.5, supports-color#0.2.0, strip-ansi#0.3.0, has-ansi#0.1.0)
├── update-notifier#0.5.0 (is-npm#1.0.0, string-length#1.0.1, chalk#1.1.3, repeating#1.1.3, semver-diff#2.1.0, configstore#1.4.0, latest-version#1.0.1)
├── tar#1.0.3 (inherits#2.0.1, block-stream#0.0.8, fstream#1.0.8)
├── request#2.72.0 (aws-sign2#0.6.0, forever-agent#0.6.1, tunnel-agent#0.4.2, oauth-sign#0.8.1, is-typedarray#1.0.0, caseless#0.11.0, stringstream#0.0.5, isstream#0.1.2, json-stringify-safe#5.0.1, extend#3.0.0, form-data#1.0.0-rc4, tough-cookie#2.2.2, node-uuid#1.4.7, qs#6.1.0, combined-stream#1.0.5, mime-types#2.1.10, aws4#1.3.2, hawk#3.1.3, bl#1.1.2, http-signature#1.1.1, har-validator#2.0.6)
└── lodash#4.11.1
appc setup
Finding latest version ...5.3.0 OK
Validating security checksum OK
Installing ... OK
Compiling platform native modules ...
└ socket.io-client/ws ... OK
└ bunyan/dtrace-provider ... OK
└ appc-ldapjs/dtrace-provider ... OK
└ chokidar/fsevents ... OK
└ chokidar/fsevents ... OK
Appcelerator Login required to continue ...
? Appcelerator ID: ozznixon#gmail.com
? Appcelerator ID: ozznixon#gmail.com
? Password: ********
Invalid Appcelerator ID and password combination.
Appcelerator Login required to continue ...
? Appcelerator ID: ozznixon#gmail.com
? Password: **************
Invalid Appcelerator ID and password combination.
Appcelerator Login required to continue ...
? Appcelerator ID: ozznixon#gmail.com
? Password: ********
This computer must be authorized before you can complete your login.
? Confirm with authorization code to Email or Phone/SMS? Email to ozznixon#gmail.com
An authorization code was sent to your email at ozznixon#gmail.com
? Please enter the authorization code you received via your email at ozznixon#gmail.com: 7015
This computer is now authorized: Windows Machine ID: 8f61c9c2-dad0-4208-9e4c-c096d20e2894
You can deauthorize this computer by logging out with appc logout
Generating Developer Certificate and Private/Public Keys...
? Do you plan on developing Titanium apps? Yes
Checking your environment...
No Mobile SDK found, downloading ...
New version available! 5.3.0.GA
Downloading http://builds.appcelerator.com/mobile-releases/5.3.0/mobilesdk-5.3.0.GA-win32.zip
100% [========================================] 0.0s
Extracting SDK to C:\ProgramData\Titanium
100% [========================================]
Setting Titanium SDK 5.3.0.GA as the default.
Titanium SDK 5.3.0.GA successfully installed!
You have the latest Titanium SDK release 5.3.0.GA
The following JDK issues were found in your environment:
JDK (Java Development Kit) not installed.
If you already have installed the JDK, verify your JAVA_HOME environment variable is correctly set.
The JDK is required for must be manually downloaded and installed from
http://appcelerator.com/jdk.
Some issues were detected for your environment
Please review the above found issues that were detected for your environment.
You should resolve these issues before building or running a cross platform app.
You can re-run setup once they are resolved to validate.
appc setup complete!
I downloaded and installed: Java SE Development Kit 8 Update 92 (64-bit)
Then:
appc use
The following versions are available:
5.3.1-2 Not Installed
5.3.0 Installed (Latest) (Active)
5.3.0-47 Not Installed
5.3.0-43 Not Installed
5.3.0-34 Not Installed
5.2.0-265 Not Installed
5.2.2 Not Installed
5.2.0-213 Not Installed
5.2.1 Not Installed
5.2.1-12 Not Installed
5.2.0-55 Not Installed
5.2.0 Installed
5.1.0 Not Installed
5.0.4 Not Installed
5.0.3 Not Installed
5.0.2 Not Installed
5.0.1 Not Installed
5.0.0 Not Installed
4.1.3 Not Installed
4.1.2 Not Installed
4.1.1 Not Installed
4.1.0 Not Installed
5.0.0-50 Not Installed
5.0.0-40 Not Installed
4.0.2 Not Installed
4.1.0-0 Not Installed
4.0.1 Not Installed
4.0.0 Not Installed
4.0.0-rc Not Installed
1.2.123 Not Installed
0.2.285 Not Installed
0.2.283 Not Installed
0.2.282 Not Installed
0.2.276 Not Installed
0.2.273 Not Installed
0.2.255 Not Installed
0.2.247 Not Installed
0.2.246 Not Installed
0.2.242 Not Installed
0.2.241 Not Installed
0.2.230 Not Installed
0.2.229 Not Installed
0.2.228 Not Installed
0.2.227 Not Installed
0.2.226 Not Installed
0.2.225 Not Installed
0.2.224 Not Installed
0.2.223 Not Installed
0.2.222 Not Installed
0.2.221 Not Installed
0.2.220 Not Installed
0.2.219 Not Installed
0.2.218 Not Installed
0.2.217 Not Installed
0.2.216 Not Installed
0.2.215 Not Installed
0.2.214 Not Installed
0.2.213 Not Installed
0.2.212 Not Installed
0.2.210 Not Installed
0.2.209 Not Installed
0.2.208 Not Installed
0.2.207 Not Installed
0.2.204 Not Installed
0.2.203 Not Installed
0.2.201 Not Installed
0.2.200 Not Installed
0.2.199 Not Installed
0.2.198 Not Installed
0.2.198 Not Installed
0.2.197 Not Installed
0.2.196 Not Installed
0.2.195 Not Installed
0.2.192 Not Installed
0.2.191 Not Installed
0.2.187 Not Installed
0.2.186 Not Installed
0.2.185 Not Installed
0.2.183 Not Installed
0.2.182 Not Installed
0.2.181 Not Installed
0.2.181 Not Installed
0.2.180 Not Installed
0.2.179 Not Installed
0.2.178 Not Installed
0.2.177 Not Installed
0.2.176 Not Installed
0.2.175 Not Installed
0.2.174 Not Installed
0.2.173 Not Installed
0.2.172 Not Installed
0.2.170 Not Installed
0.2.169 Not Installed
0.2.101 Not Installed
0.2.101 Not Installed
0.2.101 Not Installed
0.2.100 Not Installed
0.2.99 Not Installed
0.2.98 Not Installed
0.2.97 Not Installed
Then:
appc new -t titanium --id com.jahbraids.intro -n introproj -p android
A new update (5.3.1-2) is available... Download with appc use 5.3.1-2
Appcelerator Command-Line Interface, version 5.3.0
Copyright (c) 2014-2016, Appcelerator, Inc. All Rights Reserved.
*** new completed. ***
Then:
appc run
Appcelerator Command-Line Interface, version 5.3.0
Copyright (c) 2014-2016, Appcelerator, Inc. All Rights Reserved.
2016-06-23T23:51:51.172Z | ERROR | An uncaught exception was thrown!
Cannot read property 'options' of undefined
2016-06-23T23:51:51.175Z | ERROR | Cannot read property 'options' of undefined
Searched, found closed ticket, and tried:
npm install -g titanium
npm WARN deprecated wrench#1.5.8: wrench.js is deprecated! You should check out fs-extra (https://github.com/jprichardson/node-fs-extra) for any operations you were using wrench for. Thanks for all the usage over the years.
C:\Users\Ozz Nixon\AppData\Roaming\npm\ti -> C:\Users\Ozz Nixon\AppData\Roaming\npm\node_modules\titanium\bin\titanium
C:\Users\Ozz Nixon\AppData\Roaming\npm\titanium -> C:\Users\Ozz Nixon\AppData\Roaming\npm\node_modules\titanium\bin\titanium
titanium#5.0.9 C:\Users\Ozz Nixon\AppData\Roaming\npm\node_modules\titanium
├── async#1.4.2
├── sprintf#0.1.5
├── humanize#0.0.9
├── semver#5.0.3
├── colors#1.1.2
├── wrench#1.5.8
├── temp#0.8.3 (os-tmpdir#1.0.1, rimraf#2.2.8)
├── fields#0.1.24 (keypress#0.2.1, colors#0.6.2)
├── winston#1.0.2 (cycle#1.0.3, isstream#0.1.2, stack-trace#0.0.9, eyes#0.1.8, async#1.0.0, pkginfo#0.3.1, colors#1.0.3)
├── longjohn#0.2.9 (source-map-support#0.3.2)
├── request#2.62.0 (forever-agent#0.6.1, caseless#0.11.0, aws-sign2#0.5.0, oauth-sign#0.8.2, tunnel-agent#0.4.3, stringstream#0.0.5, isstream#0.1.2, json-stringify-safe#5.0.1, extend#3.0.0, tough-cookie#2.2.2, node-uuid#1.4.7, qs#5.1.0, combined-stream#1.0.5, mime-types#2.1.11, form-data#1.0.0-rc4, http-signature#0.11.0, bl#1.0.3, hawk#3.1.3, har-validator#1.8.0)
├── moment#2.10.6
└── node-appc#0.2.31 (xmldom#0.1.19, semver#5.0.1, node-uuid#1.4.3, adm-zip#0.4.7, diff#2.1.0, optimist#0.6.1, uglify-js#2.4.24, request#2.61.0)
Still: appc run -p android
Appcelerator Command-Line Interface, version 5.3.0
Copyright (c) 2014-2016, Appcelerator, Inc. All Rights Reserved.
2016-06-23T23:57:09.690Z | ERROR | An uncaught exception was thrown!
Cannot read property 'options' of undefined
2016-06-23T23:57:09.695Z | ERROR | Cannot read property 'options' of undefined
Did Update: appc use 5.3.1-2
Before you can continue, the latest Appcelerator software update needs to be downloaded.
Finding version 5.3.1-2 ... OK
Validating security checksum OK
Installing ... OK
Compiling platform native modules ...
└ socket.io-client/ws ... OK
└ bunyan/dtrace-provider ... OK
└ appc-ldapjs/dtrace-provider ... OK
└ chokidar/fsevents ... OK
└ chokidar/fsevents ... OK
Installed!!
Still: appc run -p android
Appcelerator Command-Line Interface, version 5.3.1-2
Copyright (c) 2014-2016, Appcelerator, Inc. All Rights Reserved.
2016-06-24T12:28:18.008Z | ERROR | An uncaught exception was thrown!
Cannot read property 'options' of undefined
2016-06-24T12:28:18.011Z | ERROR | Cannot read property 'options' of undefined
Thanks for sharing with us. Please run the following command in the administrative command prompt.
del -rf ~/.appcelerator
del -rf ~/.titanium
npm uninstall -g titanium
npm uninstall -g appcelerator
npm install -g appcelerator
appc use latest
appc setup
appc login
The issue you're seeing looks to be https://jira.appcelerator.org/browse/TIMOB-23480. This issue has been fixed in the latest 5.3.1 builds of the SDK. You can install this using appc ti sdk install -b 5_3_X -d.
Also for your reference my JAVA_HOME is set to C:\Program Files (x86)\Java\jdk1.7.0_80, after setting this environment variable make sure to restart your command prompt.

JSON/RPC/Client.pm Missing - Fedora 17

I want to run a JSON request using Zabbix API, but I get the following error:
Can't locate JSON/RPC/Client.pm in #INC (#INC contains: /usr/local/lib64/perl5
/usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl
/usr/lib64/perl5 /usr/share/perl5 .) at ./test.perl line 6.
I'am using Fedora 17 and don't find the package named: libjson-rpc-perl. I've already installed the following packages:
perl-CGI-Application-Plugin-JSON.noarch 1.02- 5.fc17 fedora
perl-Catalyst-View-JSON.noarch 0.30-5.fc17 fedora
perl-JSON-Any.noarch 1.29-1.fc17 fedora
perl-JSON-Any-tests.noarch 1.29-1.fc17 fedora
perl-JSON-PP.noarch 2.27200-3.fc17 fedora
perl-JSON-Path.noarch 0.101-2.fc17 fedora
perl-JSON-RPC-Daemon.noarch 1.03-2.fc17 updates
perl-JSON-RPC-legacy.noarch 1.01-2.fc17 fedora
perl-JSON-RPC-legacy-server.noarch 1.01-2.fc17 fedora
perl-JSON-Util.noarch 0.05-3.fc17 fedora
perl-JSON-XS.x86_64 1:2.32-1.fc17 fedora
perl-JSON-XS-tests.x86_64 1:2.32-1.fc17 fedora
perl-JSON-tests.noarch 2.53-4.fc17 fedora
perl-MooseX-Types-JSON.noarch 0.02-7.fc17 fedora
perl-MooseX-Types-JSON-tests.noarch 0.02-7.fc17 fedora
perl-Test-CPAN-Meta-JSON.noarch 0.13-1.fc17 fedora
perl-Test-JSON.noarch 0.11-6.fc17 fedora
perl-Test-JSON-tests.noarch 0.11-6.fc17 fedora
I don't know what to do now ? Can you please advice ?
Thanks in advance,
in your code :
use JSON::RPC::Legacy::Client;
and also change:
my $client = new JSON::RPC::Legacy::Client;
Use CPAN to install JSON::RPC. It's usually simple procedure. There is also a tool somewhere that converts CPAN distributions into rpms, but you might find cpan easier to handle without additional conversion step.
In general, in Fedora (and anywhere else in the Red Hat world), if you don't know which package contains the module you need, you can run:
% yum install 'perl(Module::Name)'
In this case, that would be:
% yum install 'perl(JSON::RPC::Client)'
JSON::RPC::Client was provided by an older version of JSON-RPC. Version 1.00 of JSON-RPC broke backwards compatibility with previous releases and no longer includes that module. You'd have to install the older version to get this code to work (or update the code to use the new API). You can get JSON-RPC 0.96 (the last compatible version) here.
You can install the old version in a private location just for this code.

CUDA Runtime API error 38: no CUDA-capable device is detected

The Situation
I have a 2 gpu server (Ubuntu 12.04) where I switched a Tesla C1060 with a GTX 670. Than I installed CUDA 5.0 over the 4.2. Afterwards I compiled all examples execpt for simpleMPI without error. But when I run ./devicequery I get following error message:
foo#bar-serv2:~/NVIDIA_CUDA-5.0_Samples/bin/linux/release$ ./deviceQuery
./deviceQuery Starting...
CUDA Device Query (Runtime API) version (CUDART static linking)
cudaGetDeviceCount returned 38
-> no CUDA-capable device is detected
What I have tried
To solve this I tried all of the thinks recommended by CUDA-capable device, but to no avail:
/dev/nvidia* is there and the permissions are 666 (crw-rw-rw-) and owner root:root
foo#bar-serv2:/dev$ ls -l nvidia*
crw-rw-rw- 1 root root 195, 0 Oct 24 18:51 nvidia0
crw-rw-rw- 1 root root 195, 1 Oct 24 18:51 nvidia1
crw-rw-rw- 1 root root 195, 255 Oct 24 18:50 nvidiactl
I tried executing the code with sudo
CUDA 5.0 installs driver and libraries at the same time
PS here is lspci | grep -i nvidia:
foo#bar-serv2:/dev$ lspci | grep -i nvidia
03:00.0 VGA compatible controller: NVIDIA Corporation GK104 [GeForce GTX 670] (rev a1)
03:00.1 Audio device: NVIDIA Corporation GK104 HDMI Audio Controller (rev a1)
04:00.0 VGA compatible controller: NVIDIA Corporation G94 [Quadro FX 1800] (rev a1)
[update]
foo#bar-serv2:~/NVIDIA_CUDA-5.0_Samples/bin/linux/release$ nvidia-smi -a
NVIDIA: API mismatch: the NVIDIA kernel module has version 295.59,
but this NVIDIA driver component has version 304.54. Please make
sure that the kernel module and all NVIDIA driver components
have the same version.
Failed to initialize NVML: Unknown Error
How could that be, if I use the CUDA 5.0 installer to install driver and libs at the same time. Could the old 4.2 version, that is still lying around mess things up?
I came across this issue, and running
nvidia-smi
informed me of an API mismatch. The problem was that my Linux distro had installed updates that required a system restart, so restarting resolved the issue.
See this stack overflow question Installing cuda 5 samples in Ubuntu 12.10.
Ubuntu 12 is not a supported Linux distro (yet). For reference see CUDA 5.0 Toolkit Release Notes And Errata
** Distributions Currently Supported
Distribution 32 64 Kernel GCC GLIBC
----------------- -- -- --------------------- ---------- -------------
Fedora 16 X X 3.1.0-7.fc16 4.6.2 2.14.90
ICC Compiler 12.1 X
OpenSUSE 12.1 X 3.1.0-1.2-desktop 4.6.2 2.14.1
Red Hat RHEL 6.x X 2.6.32-131.0.15.el6 4.4.5 2.12
Red Hat RHEL 5.5+ X 2.6.18-238.el5 4.1.2 2.5
SUSE SLES 11 SP2 X 3.0.13-0.27-pae 4.3.4 2.11.3
SUSE SLES 11.1 X X 2.6.32.12-0.7-pae 4.3.4 2.11.1
Ubuntu 11.10 X X 3.0.0-19-generic-pae 4.6.1 2.13
Ubuntu 10.04 X X 2.6.35-23-generic 4.4.5 2.12.1
If you want to do it run on Ubuntu 12 anyway then see answer of rpardo. It looks like this distro instead of installing 64 bit libraries to /usr/lib64 installs them to /usr/lib/x86_64-linux-gnu/
I'd suggest searching for all instances of libcuda.so and libnvidia-ml.so on the system. Since the driver doesn't support this distro it might have installed libraries to a path that is not pointed by LD_LIBRARY_PATH. Then move the libraries around and/or change the LD_LIBRARY_PATH to point to this location (it should be the first path on the left). Then retry nvidia-smi or deviceQuery
Good luck
I got error 38 for cudaGetDeviceCount on a windows machine with GTX980 GPU.
After I downloaded the latest driver for GTX 980 fro the NVIDIA site, installed it and restarted, everything is fine. Looks like the CUDA installer is not installing the latest driver.
Try running the sample using sudo (or, you might do a 'sudo su', set LD_LIBRARY_PATH to the path of cuda libraries and run the sample while being root). Apparently, since you've probably installed CUDA 5.0 using sudo, the samples doesn't run with normal user. However, if you run a sample with root, then you'll be able to run samples with the regular user too! I've not yet restarted the system to see if samples work with normal user even after reboot, or each time you should run at least one CUDA application with root.
The problem might completely disappear if you install CUDA TookKit without using sudo.
I had very similar problem on Debian and it turns out that loaded nvidia module had different version than libcuda1.
To check for installed nvidia module you should do:
$ sudo modinfo nvidia-current | grep version
version: 319.82
If it doesn't match version of libcuda1 this the root of your problems.