Meumeu / WiVRn

An OpenXR streaming application to a standalone headset
GNU General Public License v3.0
134 stars 22 forks source link

FFMPEG drm hardware context creation failed: Cannot allocate memory #64

Closed ztx-lyghters closed 1 month ago

ztx-lyghters commented 1 month ago

Hello. I got my Oculus Quest 2 a week ago, first time trying to use WiVRn. I have installed an apk client on my headset from the recent release and I have compiled the server. The problem is that I cannot connect to the server, I get this error:

ztx:build-server/server $ ./wivrn-server
WiVRn v0.14.1-1-gdfa74c2 starting
Service published: scarlettPC
Server started, PID 21139
 INFO [ipc_server_main]  'v21.0.0-4402-gffb71af2' starting up...
DEBUG [comp_main_create_system_compositor] Doing init 0x5606d778d870
 WARN [build_device_extensions] Duplicate device extension VK_KHR_external_memory_fd not added twice
 WARN [build_device_extensions] Duplicate device extension VK_KHR_external_memory_fd not added twice
 WARN [build_device_extensions] Duplicate device extension VK_KHR_external_memory_fd not added twice
 INFO [create_device] Created device and COMPUTE queue with QUEUE_GLOBAL_PRIORITY_MEDIUM.
 INFO [vk_print_device_info] Device info:
        name: AMD Radeon Graphics (RADV NAVI22)
        vendor: 0x1002
        product: 0x73df
        deviceType: VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU
        apiVersion: 1.3.267
        driverVersion: 0x05c03006
 INFO [vk_print_features_info] Features:
        timestamp_compute_and_graphics: true
        timestamp_period: 10.000000
        timestamp_valid_bits: 64
        timeline_semaphore: true
 INFO [vk_print_external_handles_info] Supported images:
        VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT:
                color import=true export=true
                depth import=true export=true
 INFO [vk_print_external_handles_info] Supported fences:
        VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT: true
        VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT: true
 INFO [vk_print_external_handles_info] Supported semaphores:
        VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT(binary): true
        VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT(binary): true
        VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT(timeline): false
        VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT(timeline): true
ERROR [comp_wivrn_create_images] Failed to create video encoder: FFMPEG drm hardware context creation failed: Cannot allocate memory
Server exited, exit status 0, received signal ABRT (Aborted)
Service published: scarlettPC

I am unsure what it is related to, I seem to have all the codecs. I am on Gentoo, my videocard is Sapphire Pulse Radeon RX6700 (10GB). I tried to build with -DWIVRN_USE_NVENC=OFF, didn't change a thing.

xytovl commented 1 month ago

Do you have ffmpeg with drm and vaapi support? On Gentoo you can use the ebuild in https://gitweb.gentoo.org/repo/proj/guru.git/tree/media-libs/wivrn which should have the correct dependencies.

ztx-lyghters commented 1 month ago

Do you have ffmpeg with drm and vaapi support? On Gentoo you can use the ebuild in https://gitweb.gentoo.org/repo/proj/guru.git/tree/media-libs/wivrn which should have the correct dependencies.

I certainly seem to miss something, but cannot pinpoint it. I compiled the server without VAAPI and it works now. I'll try to build the ebuild from guru, thanks. I think I'll close the issue for now, as for now it seems the problem is entirely on my side.

ztx-lyghters commented 1 month ago

Turned out I was somehow missing libdrm flag for ffmpeg package, though emerge actually seemed to think otherwise. Something is wrong with my system. Maybe that information will help someone else.