Hello there,
I installed NVIDIA driver and CUDA on CentOS 7, compiled ffmpeg to do hardware codec, I added video hardware coding code to libspice-server, so that KVM loaded libspice-server.so when the virtual machine played video. I hope video playback has the ability to accelerate hardware encoding, but now libspice-server.so called by kvm always prompts CUDA initialization error(cuInit return err != CUDA_SUCCESS)
I also compiled ffmpeg and CUDA examples, all example applications worked correctly, so is CUDA/NVIDIA does not support KVM or any other settings I need to do?
[AVHWDeviceContext @ 0x55db9479d0c0] Loaded lib: libcuda.so.1
[AVHWDeviceContext @ 0x55db9479d0c0] Loaded sym: cuInit
[AVHWDeviceContext @ 0x55db9479d0c0] Loaded sym: cuDeviceGetCount
[AVHWDeviceContext @ 0x55db9479d0c0] Loaded sym: cuDeviceGet
[AVHWDeviceContext @ 0x55db9479d0c0] Loaded sym: cuDeviceGetName
[AVHWDeviceContext @ 0x55db9479d0c0] Loaded sym: cuDeviceComputeCapability
[AVHWDeviceContext @ 0x55db9479d0c0] Loaded sym: cuCtxCreate_v2
[AVHWDeviceContext @ 0x55db9479d0c0] Loaded sym: cuCtxSetLimit
[AVHWDeviceContext @ 0x55db9479d0c0] Loaded sym: cuCtxPushCurrent_v2
[AVHWDeviceContext @ 0x55db9479d0c0] Loaded sym: cuCtxPopCurrent_v2
[AVHWDeviceContext @ 0x55db9479d0c0] Loaded sym: cuCtxDestroy_v2
[AVHWDeviceContext @ 0x55db9479d0c0] Loaded sym: cuMemAlloc_v2
[AVHWDeviceContext @ 0x55db9479d0c0] Loaded sym: cuMemFree_v2
[AVHWDeviceContext @ 0x55db9479d0c0] Loaded sym: cuMemcpy2D_v2
[AVHWDeviceContext @ 0x55db9479d0c0] Loaded sym: cuMemcpy2DAsync_v2
[AVHWDeviceContext @ 0x55db9479d0c0] Loaded sym: cuGetErrorName
[AVHWDeviceContext @ 0x55db9479d0c0] Loaded sym: cuGetErrorString
[AVHWDeviceContext @ 0x55db9479d0c0] Loaded sym: cuStreamCreate
[AVHWDeviceContext @ 0x55db9479d0c0] Loaded sym: cuStreamQuery
[AVHWDeviceContext @ 0x55db9479d0c0] Loaded sym: cuStreamSynchronize
[AVHWDeviceContext @ 0x55db9479d0c0] Loaded sym: cuStreamDestroy_v2
[AVHWDeviceContext @ 0x55db9479d0c0] Loaded sym: cuStreamAddCallback
[AVHWDeviceContext @ 0x55db9479d0c0] Loaded sym: cuEventCreate
[AVHWDeviceContext @ 0x55db9479d0c0] Loaded sym: cuEventDestroy_v2
[AVHWDeviceContext @ 0x55db9479d0c0] Loaded sym: cuEventSynchronize
[AVHWDeviceContext @ 0x55db9479d0c0] Loaded sym: cuEventQuery
[AVHWDeviceContext @ 0x55db9479d0c0] Loaded sym: cuEventRecord
[AVHWDeviceContext @ 0x55db9479d0c0] Loaded sym: cuGLGetDevices_v2
[AVHWDeviceContext @ 0x55db9479d0c0] Loaded sym: cuGraphicsGLRegisterImage
[AVHWDeviceContext @ 0x55db9479d0c0] Loaded sym: cuGraphicsUnregisterResource
[AVHWDeviceContext @ 0x55db9479d0c0] Loaded sym: cuGraphicsMapResources
[AVHWDeviceContext @ 0x55db9479d0c0] Loaded sym: cuGraphicsUnmapResources
[AVHWDeviceContext @ 0x55db9479d0c0] Loaded sym: cuGraphicsSubResourceGetMappedArray
[AVHWDeviceContext @ 0x55db9479d0c0] Could not initialize the CUDA driver API
Failed to create a CUDA device. Error code: Unknown error occurred