-
Notifications
You must be signed in to change notification settings - Fork 58
Use cuda.bindings and cuda.core for Linker
#133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6b66886
2c5e69e
b44f6bf
5f3eff0
fa80a4f
049ff57
9aeff49
b551d6f
ab9ac6f
172e340
4334b8b
0c8171a
cc70f1d
1ed3520
badafc6
bdd1f19
d6e682d
2ac2796
e444fb1
dcf4b92
a2fa420
0c84361
41b2565
23f32a4
a5fbf6a
9e1ecc5
bd0997d
43bdbbf
35bcf8c
aa9f6e6
3ad496e
b5b2b03
c32a850
568c2fc
890dfb4
a98ded0
4fad9f3
9f0fd74
1585116
72d34d7
c284f61
b2eb4d0
7bcbeb6
7383789
740d772
483b799
88cb04c
155ae81
8e5c422
b36f129
a0eabdd
1437329
a16947d
05afacd
7e9ed30
cbabfe4
7ceea50
b2ee472
0bfd849
29bc722
56b0f61
43d7490
4f20f90
3f371e9
ecc1ea9
ab07f3d
0005ef2
8f022f5
b975df7
52eb90a
e5df6d8
605d482
7f97b27
caaeedc
67ec8ee
3c0623b
b9b1f27
345f70c
500079d
06ddad2
1d94745
3e12fc3
ce00767
d726a7a
85f8710
edf0f0a
547dab5
3bd469d
ba5c20a
134f6ee
99c87f3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,7 +22,10 @@ def run_nvdisasm(cubin, flags): | |
| try: | ||
| fd, fname = tempfile.mkstemp() | ||
| with open(fname, "wb") as f: | ||
| f.write(cubin) | ||
| if config.CUDA_USE_NVIDIA_BINDING: | ||
| f.write(cubin.code) | ||
| else: | ||
| f.write(cubin) | ||
|
|
||
| try: | ||
| cp = subprocess.run( | ||
|
|
@@ -271,7 +274,7 @@ def get_cubin(self, cc=None): | |
| return cubin | ||
|
|
||
| if self._lto and config.DUMP_ASSEMBLY: | ||
| linker = driver.Linker.new( | ||
| linker = driver._Linker.new( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note / nit: this feels a little funny because the |
||
| max_registers=self._max_registers, | ||
| cc=cc, | ||
| additional_flags=["-ptx"], | ||
|
|
@@ -280,14 +283,14 @@ def get_cubin(self, cc=None): | |
| # `-ptx` flag is meant to view the optimized PTX for LTO objects. | ||
| # Non-LTO objects are not passed to linker. | ||
| self._link_all(linker, cc, ignore_nonlto=True) | ||
|
|
||
| ptx = linker.get_linked_ptx().decode("utf-8") | ||
| ptx = linker.get_linked_ptx() | ||
| ptx = ptx.decode("utf-8") | ||
|
|
||
| print(("ASSEMBLY (AFTER LTO) %s" % self._name).center(80, "-")) | ||
| print(ptx) | ||
| print("=" * 80) | ||
|
|
||
| linker = driver.Linker.new( | ||
| linker = driver._Linker.new( | ||
| max_registers=self._max_registers, cc=cc, lto=self._lto | ||
| ) | ||
| self._link_all(linker, cc, ignore_nonlto=False) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can't comment on line 294 / 300 just below as it's not part of the diff, but I suspect if it was changed so that |
||
|
|
@@ -312,7 +315,6 @@ def get_cufunc(self): | |
| cufunc = self._cufunc_cache.get(device.id, None) | ||
| if cufunc: | ||
| return cufunc | ||
|
|
||
| cubin = self.get_cubin(cc=device.compute_capability) | ||
| module = ctx.create_module_image( | ||
| cubin, self._setup_functions, self._teardown_functions | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because
config.CUDA_ENABLE_PYNVJITLINKis enabled automatically if it's found in the environment, disabling the NVIDIA bindings if pynvjitlink is installed now leads to this exception being hit.