shinpei0208 / gdev

First-Class GPU Resource Management: Device Drivers, Runtimes, and CUDA Compilers for Nouveau.
http://www.pdsl.jp/
MIT License
350 stars 70 forks source link

Failed to open gdev0 / cuCtxCreate failed #17

Closed clementine-m closed 11 years ago

clementine-m commented 11 years ago

Hello,

I'm very interested in Gdev and I would like to use the user-space runtime with the Nouveau driver. Nouveau and libdrm were previously installed, so I followed to Readme.nouveau to install the Gdev library and the CUDA driver API. I installed the CUDA 4.0 Toolkit (and only the toolkit) to use nvcc to compile the programs. To test Gdev I compiled and tried to run the madd program (in test/cuda/user), changing the Makefile according to the Readme (add "-ldrm -ldrm_nouveau -L /usr/lib").

The compilation seems ok : $ make nvcc -arch sm_20 -cubin -o madd_gpu.cubin madd_gpu.cu gcc -o user_test -L /usr/local/gdev/lib64 -I /usr/local/gdev/include -ldrm_nouveau -lcuda -lgdev main.c madd.c

But when I run the program I've got the following : $ ./user_test 256 block = (16, 16) grid = (16, 16) [gdev] Failed to open gdev0 cuCtxCreate failed: res = 999 Test failed

Is there a common troubleshooting for this, or did I miss something?

My configuration : Ubuntu 12.10 32 bit, kernel 3.5.0-27 GPU : Quadro 2000

Thank you, Clementine

mharsch commented 11 years ago

This smells like a permissions issue. Did you add your user account to the local machine's 'video' group?

clementine-m commented 11 years ago

Thank you for your quick answer.

Following your advice I added my user account to the 'video' group, but still have the same output... Maybe a relevant point (or not) : I don't know at what stage /dev/gdev0 is supposed to be created, but I can't find any gdev* in /dev.

shinpei0208 commented 11 years ago

Gdev doesn't support 32-bit machines. Looks like your machine is 32-bit?

Best,

clementine-m commented 11 years ago

My OS was indeed a 32-bit one.

I reinstalled Ubuntu 12.10 in the 64-bit version, with the Nouveau driver, kernel 3.5.0-27. Reinstalled the Gdev (user-space) library, the CUDA driver API and the CUDA Toolkit (version 4.0) from scratch. Added my user account to the 'video' group again. Compiled the madd program (in test/cuda/user) with "-ldrm -ldrm_nouveau -L /usr/lib".

I still have the same output :(

Edit : it works when I'm root! Is there any way to make it work with a simple user? Anyway, thank you a lot!

shinpei0208 commented 11 years ago

Please try "sudo". If it does't still work, you can send us the dmesg log.

Shinpei

clementine-m commented 11 years ago

It works with sudo. Thank you for your help!

Clementine

shinpei0208 commented 11 years ago

Great :)