Skip to contentSkip to conversation

New: "Userspace still has active objects" and "trying to unbind memory from uninitialized GART !" when unbinding from radeon

Bug 116101 [email protected] 1 participant 8 messages Apr 9, 2016 – Apr 13, 2016

lore
Share & tools
lore
#0 lore raw

https://bugzilla.kernel.org/show_bug.cgi?id=116101

Bug ID: 116101
Summary: "Userspace still has active objects" and "trying to
unbind memory from uninitialized GART !" when unbinding from radeon
Product: Drivers
Version: 2.5
Kernel Version: 4.5.0
Hardware: All
OS: Linux
Tree: Mainline
Status: NEW
Severity: normal
Priority: P1
Component: Video(DRI - non Intel)
Assignee: [email protected]
Reporter: [email protected]
Regression: No

Created attachment 212291
--> https://bugzilla.kernel.org/attachment.cgi?id=212291&action=edit
Journalctl output

I am attempting to unbind my R9 290 from radeon and rebind it to vfio. However, the entire system hangs when "echo "0000:01:00.0" > /sys/bus/pci/devices/0000:01:00.0/driver/unbind" is ran as root.

Steps to Reproduce:
Run the following script as root

#!/bin/bash
set -x
echo "1002 67b1" > /sys/bus/pci/drivers/vfio-pci/new_id echo "0000:01:00.0" > /sys/bus/pci/devices/0000:01:00.0/driver/unbind echo "0000:01:00.0" > /sys/bus/pci/drivers/vfio-pci/bind echo "1002 67b1" > /sys/bus/pci/drivers/vfio-pci/remove_id

echo "1002 aac8" > /sys/bus/pci/drivers/vfio-pci/new_id echo "0000:01:00.1" > /sys/bus/pci/devices/0000:01:00.1/driver/unbind echo "0000:01:00.1" > /sys/bus/pci/drivers/vfio-pci/bind echo "1002 aac8" > /sys/bus/pci/drivers/vfio-pci/remove_id

set +x

Actual Results:
System hangs on "echo "0000:01:00.0" >
/sys/bus/pci/devices/0000:01:00.0/driver/unbind"

Journalctl shows "Apr 09 16:10:26 joey-arch-pc kernel: radeon 0000:01:00.0:
Userspace still has active objects !" followed by numerous "Apr 09 16:10:26 joey-arch-pc kernel: trying to unbind memory from uninitialized GART !"

Expected Results:

The GPU should be unbinding from radeon and rebinding to vfio-pci without hanging.

Additional information:
I experienced the same issue on 4.1.20-1.

I know of instances where the same script results in the expected outcome with a Cayman PRO graphics card.

Attached is the output of journalctl for the entire boot. Go to 16:10:26 to see relevant call traces.

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

[Bug 116101] "RIP radeon_gem_va_ioctl+0x35/0x650", "Userspace still has active objects", and "trying to unbind memory from uninitialized GART !" when unbinding from radeon

https://bugzilla.kernel.org/show_bug.cgi?id=116101

Joe P. <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

            Summary|"Userspace still has active |"RIP
                   |objects" and "trying to     |radeon_gem_va_ioctl+0x35/0x
                   |unbind memory from          |650", "Userspace still has
                   |uninitialized GART !" when  |active objects", and
                   |unbinding from radeon       |"trying to unbind memory
                   |                            |from uninitialized GART !"
                   |                            |when unbinding from radeon
Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw

[Bug 116101] "RIP radeon_gem_va_ioctl+0x35/0x650", "Userspace still has active objects", and "trying to unbind memory from uninitialized GART !" when unbinding from radeon

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=116101

Christian König <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #1 from Christian König <[email protected]> --- Well as the error message already suggests "Userspace still has active objects !" you have an application which is still using the hardware.

So unbinding and rebinding it to the isn't possible in this state.

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#3 lore raw

[Bug 116101] "RIP radeon_gem_va_ioctl+0x35/0x650", "Userspace still has active objects", and "trying to unbind memory from uninitialized GART !" when unbinding from radeon

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=116101

--- Comment #2 from Joe P. <[email protected]> ---
Right now the radeon card isn't being used for anything. I am using my Intel iGPU as my output but using PRIME offloading to play games via the 290 (which works fine). Sorry, I should have specified that in the original report.

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#4 lore raw

[Bug 116101] "RIP radeon_gem_va_ioctl+0x35/0x650", "Userspace still has active objects", and "trying to unbind memory from uninitialized GART !" when unbinding from radeon

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=116101

--- Comment #3 from Joe P. <[email protected]> --- (In reply to Christian König from comment #1)

Quoted 4 lines

Well as the error message already suggests "Userspace still has active objects !" you have an application which is still using the hardware.

So unbinding and rebinding it to the isn't possible in this state.

Just to show that it's working

$ glxinfo | grep "OpenGL renderer"
OpenGL renderer string: Mesa DRI Intel(R) Sandybridge Server 
$ DRI_PRIME=1 glxinfo | grep "OpenGL renderer"
OpenGL renderer string: Gallium 0.4 on AMD HAWAII (DRM 2.43.0, LLVM 3.7.1)
Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#5 lore raw

[Bug 116101] "RIP radeon_gem_va_ioctl+0x35/0x650", "Userspace still has active objects", and "trying to unbind memory from uninitialized GART !" when unbinding from radeon

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=116101

--- Comment #4 from Christian König <[email protected]> --- It doesn't matter what OpenGL driver you currently use for the desktop. The hardware is in use by something so unbinding can't work correctly.

Try "sudo lsof /dev/dri/card1" (or whatever number your Radeon card is) to figure out which process it is using.

Might be that X has opened for prime support or something without your knowledge.

Another possibility is that a framebuffer device is still bound to it.

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#6 lore raw

[Bug 116101] "RIP radeon_gem_va_ioctl+0x35/0x650", "Userspace still has active objects", and "trying to unbind memory from uninitialized GART !" when unbinding from radeon

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=116101

Joe P. <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #5 from Joe P. <[email protected]> --- (In reply to Christian König from comment #4)

Quoted 10 lines

It doesn't matter what OpenGL driver you currently use for the desktop. The hardware is in use by something so unbinding can't work correctly.

Try "sudo lsof /dev/dri/card1" (or whatever number your Radeon card is) to figure out which process it is using.

Might be that X has opened for prime support or something without your knowledge.

Another possibility is that a framebuffer device is still bound to it.

Wow, can't believe it was that simple. I checked and X was using the device. I set the ignore option of the 290 to true in the X configuration file and it worked fine. X wasn't using the device and I am still able to use PRIME offloading. I'm having some issues when using PRIME, but that's a separate issue and I can now unbind the device. Thanks. Marking the bug as invalid.

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#7 lore raw

[Bug 116101] "RIP radeon_gem_va_ioctl+0x35/0x650", "Userspace still has active objects", and "trying to unbind memory from uninitialized GART !" when unbinding from radeon

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=116101

--- Comment #6 from Michel Dänzer <[email protected]> --- There's still a bug though — if unbinding can't work, it should be refused upfront, not attempted anyway, breaking things.

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel