Skip to content
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

cuda runtime error (10) #503

Closed
lixin4ever opened this issue Sep 13, 2016 · 4 comments
Closed

cuda runtime error (10) #503

lixin4ever opened this issue Sep 13, 2016 · 4 comments

Comments

@lixin4ever
Copy link

lixin4ever commented Sep 13, 2016

Dear all,

I have a issue when using the cutorch package

I install Torch7 with self-contained Lua on the redhat machine. No error occurs during the installation. Then I installed cutorch, and the output in the shell is below:

-- Installing: /home/liuxuebo/distro/install/include/THC/generic/THCTensorSort.cu
cd build
Updating manifest for /home/liuxuebo/distro/install/lib/luarocks/rocks
cutorch scm-1 is now built and installed in /home/liuxuebo/distro/install/ (license: BSD)

which seems normal. Then I try to import cutorch in th shell and the output is ok. However, when I ran a torch program using GPU, I met an error:

THCudaCheck FAIL file=/tmp/luarocks_cutorch-scm-1-8352/cutorch/init.c line=720 error=10 : invalid device ordinal
/home/liuxuebo/distro/install/bin/luajit: main.lua:282: cuda runtime error (10) : invalid device ordinal at /tmp/luarocks_cutorch-scm-1-8352/cutorch/init.c:720
stack traceback:
[C]: in function 'setDevice'
main.lua:282: in function 'main'
main.lua:354: in main chunk
[C]: in function 'dofile'
...ebo/distro/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: at 0x00405810

I wonder that do the settings of cuda or the way I install torch cause this problem?

(P.S., version of cuda is 7.0)

@soumith
Copy link
Member

soumith commented Sep 30, 2016

invalid device ordinal
means you are accessing a GPU device index that is not accessible to the program

@soumith soumith closed this as completed Sep 30, 2016
@allanj
Copy link

allanj commented Dec 11, 2017

How to solve this problem?

@liuxiaojun56
Copy link

I get the same problem. Any help on how to solve this problem ?

@shubhvachher
Copy link

I'm new to torch but the way I got this working is

$th
th> require 'cutorch'
th> cutorch.getDevice()

Then plugging the output from above into cutorch.setDevice in the code that isn't working. More experienced torch devs could point out if there is a better way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants