Skip to content

Commit

Permalink
[api] Fixes NeuronUtils issue when running as non-root user (#2735)
Browse files Browse the repository at this point in the history
  • Loading branch information
frankfliu authored Aug 2, 2023
1 parent d131712 commit 41a395d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/src/main/java/ai/djl/util/NeuronUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public static int getNeuronCoresForDevice(String location) {
return 0;
}
Path file = path.resolve("core_count");
if (Files.exists(file)) {
if (Files.exists(file) && Files.isReadable(file)) {
try (InputStream is = Files.newInputStream(file)) {
return Integer.parseInt(Utils.toString(is));
} catch (IOException e) {
Expand Down

0 comments on commit 41a395d

Please sign in to comment.