We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 77eee0e commit 4a3113cCopy full SHA for 4a3113c
driverapi/src/librecuda.cpp
@@ -101,6 +101,8 @@ libreCudaStatus_t libreCuInit(int flags) {
101
// initialize mm
102
{
103
int fd_uvm_2 = open("/dev/nvidia-uvm", O_RDWR | O_CLOEXEC);
104
+ LIBRECUDA_VALIDATE(fd_uvm_2 != -1, LIBRECUDA_ERROR_INVALID_DEVICE);
105
+
106
UVM_MM_INITIALIZE_PARAMS params{
107
.uvmFd = fd_uvm
108
};
@@ -119,9 +121,11 @@ libreCudaStatus_t libreCuInit(int flags) {
119
121
} else {
120
122
LIBRECUDA_DEBUG("UVM_MM_INITIALIZE failed with return code " + std::to_string(ret) + " and status " +
123
std::to_string(status));
124
+ close(fd_uvm_2);
125
LIBRECUDA_FAIL(LIBRECUDA_ERROR_UNKNOWN);
126
}
127
128
129
driver_type = OPEN_KERNEL_MODULES;
130
131
0 commit comments