Community Packages

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#31488 - [cuda-toolkit] cuda-gdb requires root permissions to run

Attached to Project: Community Packages
Opened by Nick Henderson (nwhsvc) - Monday, 10 September 2012, 21:26 GMT
Last edited by Sven-Hendrik Haase (Svenstaro) - Monday, 29 October 2012, 03:00 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sven-Hendrik Haase (Svenstaro)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

Attempts to run cuda-gdb as a normal user result in cuda-gdb reporting "fatal:
The CUDA driver initialization failed. (error code = 1)". Running with as root
via su or sudo produces correct results.

I have a multi-gpu system. I do all cuda development and debugging on the
non-display device. I've tested the same procedure in run level 3 from a
basic terminal and run level 5 inside X11.

Package versions:
- nvidia 304.43-1
- cuda-toolkit 4.2.9-1

Output from nvidia-smi:
Mon Sep 10 14:07:31 2012
+------------------------------------------------------+
| NVIDIA-SMI 4.304.43 Driver Version: 304.43 |
|-------------------------------+----------------------+----------------------+
| GPU Name | Bus-Id Disp. | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 Quadro FX 1700 | 0000:01:00.0 N/A | N/A |
| 60% 57C N/A N/A / N/A | 16% 82MB / 511MB | N/A Default |
+-------------------------------+----------------------+----------------------+
| 1 Tesla C2070 | 0000:02:00.0 Off | 0 |
| 32% 83C P8 N/A / N/A | 0% 11MB / 5375MB | 0% Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Compute processes: GPU Memory |
| GPU PID Process name Usage |
|=============================================================================|
| 0 Not Supported |
+-----------------------------------------------------------------------------+

Steps to reproduce:
- compile driver.cu with
$ nvcc -g -G -gencode arch=compute_20,code=sm_20 driver.cu -o driver
- run cuda-gdb as a normal user
$ cuda-gdb ./driver
...
(cuda-gdb) run
...
fatal: The CUDA driver initialization failed. (error code = 1)
(cuda-gdb)
- run cuda-gdb as a super user
$ sudo cuda-gdb ./driver
...
(cuda-gdb) run
...
vd[0] = 0
vd[1] = 1
...
Program exited normally.
...
(cuda-gdb)
This task depends upon

Closed by  Sven-Hendrik Haase (Svenstaro)
Monday, 29 October 2012, 03:00 GMT
Reason for closing:  Fixed
Additional comments about closing:  Apparently fixed
Comment by Sven-Hendrik Haase (Svenstaro) - Wednesday, 12 September 2012, 05:15 GMT
I can reproduce. From the strace, I can't really see what exactly is failing, though. No obvious permission denied errors. I attached both strace logs. The interesting stuff seems to happen way down at POKEUSER. I'll need help with this one.
   sudo (407.7 KiB)
   no-sudo (296.9 KiB)
Comment by Sven-Hendrik Haase (Svenstaro) - Monday, 01 October 2012, 05:32 GMT
What does upstream say to this? Did you talk to them?
Comment by Nick Henderson (nwhsvc) - Monday, 01 October 2012, 16:16 GMT
I filed a bug upstream. I am in contact with a Nvidia tool developer. He asked me to try cuda-gdb while running the development driver from CUDA 5 RC1. I will try this next week. On vacation now.
Comment by Dave Reisner (falconindy) - Monday, 01 October 2012, 17:19 GMT
Rerun strace with -f and you'll get more useful output. As is, you're only seeing syscalls from cuda-gdb itself, not the process it spawns/ptraces.
Comment by Nick Henderson (nwhsvc) - Thursday, 18 October 2012, 22:33 GMT
No help from Arch devs at this point. I tried to install CUDA 5 with no luck. I kept getting a device-runtime mismatch error on any cuda runtime call. However, now cuda-gdb works with the nvidia driver currently in Arch (304.51) and this cuda-toolkit package. Something must have changed.

Loading...