Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
5403d90f
Commit
5403d90f
authored
Jan 18, 2017
by
Timo Rothenpieler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/nvenc: make gpu indices independend of supported capabilities
parent
1c103100
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
nvenc.c
libavcodec/nvenc.c
+5
-2
No files found.
libavcodec/nvenc.c
View file @
5403d90f
...
@@ -338,6 +338,9 @@ static av_cold int nvenc_check_device(AVCodecContext *avctx, int idx)
...
@@ -338,6 +338,9 @@ static av_cold int nvenc_check_device(AVCodecContext *avctx, int idx)
goto
fail
;
goto
fail
;
}
}
if
(
ctx
->
device
!=
idx
&&
ctx
->
device
!=
ANY_DEVICE
)
return
-
1
;
cu_res
=
dl_fn
->
cuda_dl
->
cuCtxCreate
(
&
ctx
->
cu_context_internal
,
0
,
cu_device
);
cu_res
=
dl_fn
->
cuda_dl
->
cuCtxCreate
(
&
ctx
->
cu_context_internal
,
0
,
cu_device
);
if
(
cu_res
!=
CUDA_SUCCESS
)
{
if
(
cu_res
!=
CUDA_SUCCESS
)
{
av_log
(
avctx
,
AV_LOG_FATAL
,
"Failed creating CUDA context for NVENC: 0x%x
\n
"
,
(
int
)
cu_res
);
av_log
(
avctx
,
AV_LOG_FATAL
,
"Failed creating CUDA context for NVENC: 0x%x
\n
"
,
(
int
)
cu_res
);
...
@@ -362,7 +365,7 @@ static av_cold int nvenc_check_device(AVCodecContext *avctx, int idx)
...
@@ -362,7 +365,7 @@ static av_cold int nvenc_check_device(AVCodecContext *avctx, int idx)
dl_fn
->
nvenc_device_count
++
;
dl_fn
->
nvenc_device_count
++
;
if
(
ctx
->
device
==
dl_fn
->
nvenc_device_count
-
1
||
ctx
->
device
==
ANY_DEVICE
)
if
(
ctx
->
device
==
idx
||
ctx
->
device
==
ANY_DEVICE
)
return
0
;
return
0
;
fail3:
fail3:
...
@@ -451,7 +454,7 @@ static av_cold int nvenc_setup_device(AVCodecContext *avctx)
...
@@ -451,7 +454,7 @@ static av_cold int nvenc_setup_device(AVCodecContext *avctx)
return
AVERROR_EXTERNAL
;
return
AVERROR_EXTERNAL
;
}
}
av_log
(
avctx
,
AV_LOG_FATAL
,
"Requested GPU %d, but only %d GPUs are available!
\n
"
,
ctx
->
device
,
dl_fn
->
nvenc_device_count
);
av_log
(
avctx
,
AV_LOG_FATAL
,
"Requested GPU %d, but only %d GPUs are available!
\n
"
,
ctx
->
device
,
nb_devices
);
return
AVERROR
(
EINVAL
);
return
AVERROR
(
EINVAL
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment