Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/marian-nmt/nccl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKe Wen <kwen@nvidia.com>2019-06-25 23:39:08 +0300
committerKe Wen <kwen@nvidia.com>2019-06-25 23:39:08 +0300
commit8e04d80382cc8bee10b70652dfdaf4e9a06f53dc (patch)
tree3c5a5c4141e266e3c26f26554311241cc17ac03c
parent7c72dee660e4d055b81721dd6b03e4e1c0a983cf (diff)
parent37e4f8729e5e6604ab739b2353064139af43fe2d (diff)
Merge branch 'master' into HEAD
-rw-r--r--README.md2
-rw-r--r--src/init.cc6
2 files changed, 5 insertions, 3 deletions
diff --git a/README.md b/README.md
index abfd1cd..7f0a72f 100644
--- a/README.md
+++ b/README.md
@@ -55,7 +55,7 @@ To install NCCL on the system, create a package then install it as root.
Debian/Ubuntu :
```shell
$ # Install tools to create debian packages
-$ sudo apt install build-essential devscripts debhelper
+$ sudo apt install build-essential devscripts debhelper fakeroot
$ # Build NCCL deb package
$ make pkg.debian.build
$ ls build/pkg/deb/
diff --git a/src/init.cc b/src/init.cc
index 42499c0..0158f8d 100644
--- a/src/init.cc
+++ b/src/init.cc
@@ -880,10 +880,12 @@ static ncclResult_t getCpuGpuAffinity(int cudaDev, cpu_set_t* mask) {
path[PATH_MAX-1] = '\0';
int fd;
SYSCHECKVAL(open(path, O_RDONLY), "open", fd);
- char affinityStr[sizeof(cpu_set_t)*2];
+ char affinityStr[sizeof(cpu_set_t)*2 + 1];
int r = read(fd, affinityStr, sizeof(cpu_set_t)*2);
- if (r > 0)
+ if (r > 0) {
+ affinityStr[r] = '\0';
NCCLCHECK(ncclStrToCpuset(affinityStr, mask));
+ }
close(fd);
free(cudaPath);
return ncclSuccess;