FS#42694 - [python-pycuda] nvidia module failed to unload after running pycuda using optirun

Attached to Project: Community Packages
Opened by Thomas King (thomasking0529) - Thursday, 06 November 2014, 06:05 GMT
Last edited by Giancarlo Razzolini (grazzolini) - Friday, 06 December 2019, 12:39 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sven-Hendrik Haase (Svenstaro)
Felix Yan (felixonmars)
Giancarlo Razzolini (grazzolini)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
after optirun, the nvidia module was not unloaded and bbswitch cannot turn off the discrete card, cause nvidia_uvm still using nvidia module

Additional info:



Steps to reproduce:
This task depends upon

Closed by  Giancarlo Razzolini (grazzolini)
Friday, 06 December 2019, 12:39 GMT
Reason for closing:  Deferred
Comment by Doug Newgard (Scimmia) - Thursday, 06 November 2014, 15:52 GMT
So what starts nvidia_svm but doesn't shut it down? I don't even find a file called "nvidia_svm", so I have no idea what it is.
Comment by Thomas King (thomasking0529) - Friday, 07 November 2014, 01:40 GMT
sorry I misspelled it, it was nvidia_uvm. Can I edit the task it self?
Comment by Doug Newgard (Scimmia) - Friday, 07 November 2014, 04:22 GMT
Can't find anything by that name in the repos, either. I'm just trying to figure out where to assign this.
Comment by Thomas King (thomasking0529) - Friday, 07 November 2014, 06:17 GMT
optirun with my own opengl application works well. Maybe caused by python-pycuda? I don't know either. nvidia_uvm is part of nvidia driver, for unified memory feature of CUDA.
Comment by Thomas King (thomasking0529) - Sunday, 07 December 2014, 09:15 GMT
New comment, run the plain cuda executable with optirun also cause this problem, so this is not the bug of pycuda, as OpenGL applications runs smoothly, it should be a bug of cuda itself, so maybe we need to ignore it cause cuda is propriety.
Comment by Nikolay Bogoychev (Dheart) - Thursday, 04 June 2015, 15:28 GMT
This is not a bug with CUDA.
When you say "optirun blaa" what optirun does is to switch on the gpu and insert the nvidia module. When the program finishes, it removes the nvidia module and turns off the GPU.

On newer cuda, when running a cuda application, the nvidia module requests that the nvidia_uvm module is loaded as well, as it is needed by the cuda runtime. Bumblebee doesn't know about this module and tries to remove nvidia, but nvidia_uvm depends on nvidia so it can't remove the module and can't turn off the GPU.

Solution:
manually:
modprobe -r nvidia_uvm
modprobe -r nvidia
tee /proc/acpi/bbswitch <<< OFF

Should this be a bug?
If anything you could talk to the Bumblebee developers to check for nvidia_uvm before trying to remove the nvidia module and shutdown the GPU.
Comment by Ivy Foster (escondida) - Thursday, 10 October 2019, 03:28 GMT
thomasking0529, do you still have this issue?
Comment by Kassian Sun (Ksmata) - Monday, 14 October 2019, 13:40 GMT
Sorry I don't use pycuda anymore so can't answer this question.
p.s. thomasking0529 is my old account

Loading...