summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeungha Yang <seungha.yang@navercorp.com>2018-05-17 21:49:25 +0900
committerTim-Philipp Müller <tim@centricular.com>2018-05-18 10:43:39 +0100
commit535adfee37b7be8064e302e4f17b1df1ca14ae14 (patch)
tree39e54ed06e1e2f896ef0560f509f13098f991a9e
parentfeb6002680664f127034cbb2c5514228f4c62fca (diff)
nvenc: Fix build warning error
'cuDeviceComputeCapability' was deprecated as of CUDA 5.0 gstnvenc.c: In function ‘gst_nvenc_create_cuda_context’: gstnvenc.c:290:9: error: ‘cuDeviceComputeCapability’ is deprecated [-Werror=deprecated-declarations] && cuDeviceComputeCapability (&maj, &min, cdev) == CUDA_SUCCESS) { ^ https://bugzilla.gnome.org/show_bug.cgi?id=796203
-rw-r--r--sys/nvenc/gstnvenc.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/nvenc/gstnvenc.c b/sys/nvenc/gstnvenc.c
index a157006c8..a2edb7ee7 100644
--- a/sys/nvenc/gstnvenc.c
+++ b/sys/nvenc/gstnvenc.c
@@ -287,9 +287,13 @@ gst_nvenc_create_cuda_context (guint device_id)
for (i = 0; i < dev_count; ++i) {
if (cuDeviceGet (&cdev, i) == CUDA_SUCCESS
&& cuDeviceGetName (name, sizeof (name), cdev) == CUDA_SUCCESS
- && cuDeviceComputeCapability (&maj, &min, cdev) == CUDA_SUCCESS) {
- GST_INFO ("GPU #%d supports NVENC: %s (%s) (Compute SM %d.%d)",
- i, (((maj << 4) + min) >= 0x30) ? "yes" : "no", name, maj, min);
+ && cuDeviceGetAttribute (&maj,
+ CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, cdev) == CUDA_SUCCESS
+ && cuDeviceGetAttribute (&min,
+ CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR,
+ cdev) == CUDA_SUCCESS) {
+ GST_INFO ("GPU #%d supports NVENC: %s (%s) (Compute SM %d.%d)", i,
+ (((maj << 4) + min) >= 0x30) ? "yes" : "no", name, maj, min);
if (i == device_id) {
cuda_dev = cdev;
}