Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
TransformerEngine
Commits
2dd6b146
Unverified
Commit
2dd6b146
authored
Apr 02, 2024
by
Tim Moon
Committed by
GitHub
Apr 02, 2024
Browse files
Set CUDA context before loading NVRTC kernels (#734)
Signed-off-by:
Tim Moon
<
tmoon@nvidia.com
>
parent
16a469df
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
transformer_engine/common/util/rtc.cpp
transformer_engine/common/util/rtc.cpp
+5
-0
No files found.
transformer_engine/common/util/rtc.cpp
View file @
2dd6b146
...
...
@@ -76,6 +76,10 @@ Kernel::~Kernel() {
!=
CUDA_SUCCESS
)
{
continue
;
}
if
(
cuda_driver
::
call
(
"cuCtxSetCurrent"
,
context
)
!=
CUDA_SUCCESS
)
{
continue
;
}
cuda_driver
::
call
(
"cuModuleUnload"
,
modules_
[
device_id
]);
cuda_driver
::
call
(
"cuDevicePrimaryCtxRelease"
,
device
);
}
...
...
@@ -109,6 +113,7 @@ CUfunction Kernel::get_function(int device_id) {
CUcontext
context
;
NVTE_CALL_CHECK_CUDA_DRIVER
(
cuDeviceGet
,
&
device
,
device_id
);
NVTE_CALL_CHECK_CUDA_DRIVER
(
cuDevicePrimaryCtxRetain
,
&
context
,
device
);
NVTE_CALL_CHECK_CUDA_DRIVER
(
cuCtxSetCurrent
,
context
);
// Load function into driver context
NVTE_CALL_CHECK_CUDA_DRIVER
(
cuModuleLoadDataEx
,
...
...
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