Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 823882 - dev-util/nvidia-cuda-toolkit-11.5.0-r1: warning: PyMemoryView_FromObject: called while Python is not available! / Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Summary: dev-util/nvidia-cuda-toolkit-11.5.0-r1: warning: PyMemoryView_FromObject: cal...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Science Related Packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-15 22:59 UTC by David
Modified: 2022-02-23 09:48 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info output (emerge.info,8.23 KB, application/x-info)
2021-11-15 22:59 UTC, David
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David 2021-11-15 22:59:57 UTC
Created attachment 751354 [details]
emerge --info output

In my current setup with nvidia-cuda-toolkit 11.5.0-r1 and python 3.9.8 (compiled with GCC 11.2), cuda-gdb fails with the following error message:

cuda-gdb: warning: PyMemoryView_FromObject: called while Python is not available!
Python path configuration:
  PYTHONHOME = (not set)
  PYTHONPATH = (not set)
  program name = 'python3'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = '/usr/bin/python3'
  sys.base_prefix = '/usr'
  sys.base_exec_prefix = '/usr'
  sys.platlibdir = 'lib'
  sys.executable = '/usr/bin/python3'
  sys.prefix = '/usr'
  sys.exec_prefix = '/usr'
  sys.path = [
    '/usr/lib/python39.zip',
    '/usr/lib/python3.9',
    '/usr/lib/python3.9/lib-dynload',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
Traceback (most recent call last):
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
cuda-gdb: warning: PyMemoryView_FromObject: called while Python is not available!
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
cuda-gdb: warning: PyMemoryView_FromObject: called while Python is not available!
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
cuda-gdb: warning: PyMemoryView_FromObject: called while Python is not available!
  File "<frozen importlib._bootstrap_external>", line 846, in exec_module
cuda-gdb: warning: PyMemoryView_FromObject: called while Python is not available!
  File "<frozen importlib._bootstrap_external>", line 951, in get_code
cuda-gdb: warning: PyMemoryView_FromObject: called while Python is not available!
SystemError: <class 'memoryview'> returned NULL without setting an error

Searching online, I found that "init_fs_encoding: failed to get the Python codec of the filesystem encoding" is often a hint that something is not correct with the python environment, which makes me believe "PyMemoryView_FromObject: called while Python is not available!" is the actual error. But I could not find anything about this warning message at all.

Unfortunately I cannot tell exactly when it started to fail since I don't remember when I used cuda-gdb successfully last time. I certainly used it with a cuda 11.x release before, but meanwhile I did several distribution updates. I tried to downgrade CUDA to 11.4, but that yields the same error. Downgrading the whole distribution to what it was before is unfortunately not an option.
Comment 1 Guilherme Amadio gentoo-dev 2021-12-20 12:21:14 UTC
cuda-gdb works for me in CUDA 10.2, but not on any CUDA 11+ in the tree.
Comment 2 Larry the Git Cow gentoo-dev 2022-02-23 09:48:06 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4b43ff6fe5595ba4d930df5f358996a95f204425

commit 4b43ff6fe5595ba4d930df5f358996a95f204425
Author:     Guilherme Amadio <amadio@gentoo.org>
AuthorDate: 2022-02-23 09:46:10 +0000
Commit:     Guilherme Amadio <amadio@gentoo.org>
CommitDate: 2022-02-23 09:47:57 +0000

    dev-util/nvidia-cuda-toolkit: version bump to 11.6.1
    
    Closes: https://bugs.gentoo.org/823882
    Package-Manager: Portage-3.0.30, Repoman-3.0.3
    Signed-off-by: Guilherme Amadio <amadio@gentoo.org>

 dev-util/nvidia-cuda-toolkit/Manifest              |   1 +
 .../nvidia-cuda-toolkit-11.6.1.ebuild              | 271 +++++++++++++++++++++
 2 files changed, 272 insertions(+)